Hi all, while using siebel workflow i had a requirement where i need to call a workflow asynchronously. The exact requirement was to capture some login user information and add the information in other table but this was to be done so that the performance was not degraded since the first approach we were using was based on calling a workflow in the write event of BC but this was taking time as the execution was synchronous so we used the following approach.
1. Wrote script on write record event of BC to call workflow asynchronously.
2. Used Asynchronous Server Request business service to call the workflow.
Sample script looked like
var bo = TheApplication().ActiveBusObject();
var bc = bo.GetBusComp("Opportunity");
svc = TheApplication().GetService("Asynchronous Server Requests");
input = TheApplication().NewPropertySet();
child = TheApplication().NewPropertySet();
output = TheApplication().NewPropertySet();
rowid = bc.GetFieldValue("Id");
child.SetProperty("ProcessName", "HW Device Tracking Workflow");
svc.InvokeMethod("SubmitRequest", input, output);
Note: please refer bookshelf for the exact syntax
the advantage of calling WF asynchronously is that the control is returned to the main process instantly after submitting the request and it does not wait for the execution of the workflow, the request is submitted on the server and is executed in background.
this process can also be done without using scripting by calling a workflow using Run Time Event on BC event and define the process of calling workflow asynchronously in the created workflow.
for more details about Synchronous workflow execution please refer the following link
Post a Comment