Let us suppose that, from an application associated to an A activity we want to complete the workitem associated to a B activity. In this case, the workflow context workitem is the one corresponding to A activity, and not to B activity. Consequently, we must iterate in the collection of workitems associated to the process instance to search for the one corresponding to Activity B. One of the processes to do this is shown below:
&workitems = &wfprocessinstance.Workitems
For &i = 1 to &workitems.Count
&workitem = &workitems.Item(&i)
&activity = &workitem.Activity
If &activity.Name = 'B'
&workitem.Complete()
commit
Endif
Endfor
where the variables data
&wfprocessInstance – WorkflowProcessInstance
&workitems – WorkflowWorkitem (collection property = yes)
&activity – WorkflowActivity
&i – Numeric(4)
|