Views: 5393
Last Modified: 22.09.2014
Some activities may suspend the execution of a business process pending user’s response.
For such activities, there is an option to perform tasks instead of the user through API. To do so, send an external event to the workflow as follows:
CBPDocument::SendExternalEvent($workflowId, $activityName, $arEventParameters);
where:
Example for the Activity "Document Approval":
CBPDocument::SendExternalEvent("5046fe0fbf1888.64722245","Approve1",array("USER_ID"=>1,"APPROVE"=>true));
where:
"5046fe0fbf1888.64722245"
- the identifier of a business process instance;
"Approve1"
- the name of the approval activity;
"USER_ID"=>1
- the identifier of the approving user;
"APPROVE"=>true
- the approval result (if declined - false).