User:anonymousLog inRegister
Recents:
HowTo: Completing a Workitem From the Application Associated to Another Activity

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)


Created: 11/28/08 01:00 PM by marcedupo Last update: 03/14/12 03:47 PM by dmarquez
 
Page
Share
Categories
Group
Powered by GXwiki 4.0 Beta1 (generated with GeneXus X Evolution 2)