[OFBiz] Users - Completing a work flow activity
Ancin Peter
APeter at Viziqor.com
Thu Jun 30 12:09:21 EDT 2005
Hello,
I am using ofbiz version 3.0 and I am doing the following.
I am creating 20 instances of a workflow (code snippet given below). The workflow has 3 activities.
In my test case, I complete the activities (code snippet given below). When the activities are completed, I am running into a problem where some of the workflows end up with activities in a 'open.not_running.not_started' state. It is quite random and the instances are all based on the same workflow.
I am not sure what I am doing wrong and I appreciate any insights that you can provide.
Thanks,
Ancin
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Here is a code snippet of the code I have for creating the workflow instances.
Map extraParameters = (Map)context.get( KEYWORD_EXTRA_PARAMS );
if( extraParameters == null )
{
extraParameters = new HashMap();
}
extraParameters.put( KEYWORD_REFERENCE_ID, referenceId );
ModelService model = new ModelService();
model.location = packageName;
model.invoke = workflowName;
model.engineName = "workflow";
ServiceDispatcher dispatcher = new ServiceDispatcher( delegator );
WorkflowEngine engine = new WorkflowEngine( dispatcher );
engine.runAsync( workflowName, model, extraParameters, false );
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Here is a code snippet of the code I have for competing the activities.
// get acitivity instance...
Iterator activitiesIt = workflow.getIteratorStep();
if( !activitiesIt.hasNext() )
{
log.warning( "An open.running workflow "+
"(wfId="+processWorkEffortId+",refId="+externalReferenceId+") "+
"has no open activities." );
return UtilMisc.toMap( KEYWORD_STATUS, STATUS_STARTING );
}
while(activitiesIt.hasNext()) {
WfActivity activity = (WfActivity)activitiesIt.next();
activity.complete();
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ofbiz.org/pipermail/users/attachments/20050630/8e72fe40/attachment.htm
More information about the Users
mailing list