Hello.
We have an e-commerce (WooCommerce) that we have connected with espoCRM.
Every time a sale is generated in WooCommerce a mirror record is generated in espoCRM. A sale generates in espoCRM a WCOrder record and n WCOrderLine records related to it
This part of the integration between WooCommerce and espoCRM works well.
Within espoCRM we have prepared the process so that once a WCOrder record has been created it will generate a logistic order.
There is a BPM process that for each WCOrder created, a LGOrder record and its n LGOrderLine are generated.
In the image you can see what happens when that BPM is executed:
1.- The sub-process finish with Status"Rejected". However, if I consult the detail of the sub-process, I see that all its steps have been executed correctly.
2.- The process stops at the script task "CT 1" step (Final calculation). Its status is "Created", and is marked in blue in the image.
I have already discovered what generates these two effects: it is the code included in the "CT 1" step.
There is an entity\countRelated instruction on the records that have been generated within the sub-process, the n LGOrderLine. These are the instructions:
ifThenElse(
entity\countRelated('lGOrderLines', 'reportFilter5e4d1d30c2c8of32f') > 0,
$prLGLineBusinessGXC = 1,
$prLGLineBusinessGXC = 0);
If I delete that code, the sub-process is processed correctly (it does not have a status "Rejected" any longer) and the process continues to its end without stopping.
I understand that when the main process relinquishes control to the sub-process, the main process is stopped until the sub-process ends.
Then the sub-process returns control of the flow, including the return variables.
Therefore the subprocess should be completely finished.
But the reality is that it does not allow the entity\countRelated code to be executed. So it doesn't seem that the subprocess is completely finished.
I don't know if what I described is a mistake or it is the behaviour that was intended.
Anyway , how can I solve this situation? How can I count those records?
Thank you very much for your help.
We have an e-commerce (WooCommerce) that we have connected with espoCRM.
Every time a sale is generated in WooCommerce a mirror record is generated in espoCRM. A sale generates in espoCRM a WCOrder record and n WCOrderLine records related to it
This part of the integration between WooCommerce and espoCRM works well.
Within espoCRM we have prepared the process so that once a WCOrder record has been created it will generate a logistic order.
There is a BPM process that for each WCOrder created, a LGOrder record and its n LGOrderLine are generated.
In the image you can see what happens when that BPM is executed:
1.- The sub-process finish with Status"Rejected". However, if I consult the detail of the sub-process, I see that all its steps have been executed correctly.
2.- The process stops at the script task "CT 1" step (Final calculation). Its status is "Created", and is marked in blue in the image.
I have already discovered what generates these two effects: it is the code included in the "CT 1" step.
There is an entity\countRelated instruction on the records that have been generated within the sub-process, the n LGOrderLine. These are the instructions:
ifThenElse(
entity\countRelated('lGOrderLines', 'reportFilter5e4d1d30c2c8of32f') > 0,
$prLGLineBusinessGXC = 1,
$prLGLineBusinessGXC = 0);
If I delete that code, the sub-process is processed correctly (it does not have a status "Rejected" any longer) and the process continues to its end without stopping.
I understand that when the main process relinquishes control to the sub-process, the main process is stopped until the sub-process ends.
Then the sub-process returns control of the flow, including the return variables.
Therefore the subprocess should be completely finished.
But the reality is that it does not allow the entity\countRelated code to be executed. So it doesn't seem that the subprocess is completely finished.
I don't know if what I described is a mistake or it is the behaviour that was intended.
Anyway , how can I solve this situation? How can I count those records?
Thank you very much for your help.
Comment