AnsweredAssumed Answered

Explanations about WorkflowService and related classes

Question asked by amenel on May 11, 2009
Latest reply on Aug 27, 2009 by amenel
Hi all,
I an currently trying to integrate workflows into some Java piece of software we wrote that uses Alfresco. I have little general knowledge about workflows so I am targeting the well-informed people around here. All classes I refer to are in org.alfresco.service.cmr.workflow

In WorkflowService, function startWorkflow takes a workflow definition id and parameters to initialize the properties of the start task. It returns a WorkflowPath object that has a WorkflowInstance and a WorkflowNode. The WorkflowInstance object has two objects workflowPackage and context, both as NodeRef.

- If I start an advanced workflow from a content's properties page, is it correct to say that doing so created a workflow instance ?

- What is the meaning attached to WorkflowNode, workflowPackage and context ? I am trying to know whether one of these holds a reference to the content I started the workflow for.

- How can I determine (from the WorkflowPath object that's returned) which content the workflow instance I started is attached to ?

- How can I grab the taskId for the "start task" from the WorkflowPath object returned ? Is there even a taskId attached to a "start task" ? This question is motivated by the user actions I plan to have later (one button per possible transition), which will only require using "updateTask" (to save properties) and "endTask" (to follow transitions).

Outcomes