I ended up creating a module for it as it didn't seem possible to implement using rules.
here is the function that is called on hook_node_update
//load all pending orders
$orders = commerce_order_load_multiple(array(), array('status'=>'pending'), TRUE);
//go through the loaded orders
foreach($orders as $order){
//load each order as an entity
$order_wrapper = entity_metadata_wrapper('commerce_order', $order);
foreach($order_wrapper->commerce_line_items as $line_item_wrapper){
//check if the order contains this node's product
$product = $line_item_wrapper->commerce_product;
$node_product = $node_wrapper->field_product;
if($product->sku->value() === $node_product->sku->value()){
//change the status of the order to processing
$order_wrapper->status = 'processing';
$line_item_wrapper->save();
$order_wrapper->save();
}
}
}
return TRUE;
Now since I got the respective orders to processing status, I can go on using rules for the rest of the implementation.