transition - JBPM task instance is "IN_PROGRESS" when the workflow instance is ended -
transition - JBPM task instance is "IN_PROGRESS" when the workflow instance is ended -
in alfresco 4.1, using jbpm, have defined next workflow:
<?xml version="1.0" encoding="utf-8"?> <process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="dswf:testworkflow"> <swimlane name="initiator" /> <start-state name="start"> <task name="dswf:starttask" swimlane="initiator"/> <transition name="" to="wait" /> </start-state> <task-node name="wait"> <task name="dswf:waitcompletion"> <event type="task-create"> <action class="org.alfresco.repo.workflow.jbpm.alfrescojavascript"> <script> logger.log("waiting"); </script> </action> </event> </task> <transition name="complete" to="completed" /> </task-node> <node name="completed"> <event type="node-enter"> <action class="org.alfresco.repo.workflow.jbpm.alfrescojavascript"> <script> logger.log("completed"); </script> </action> </event> <transition name="" to="end" /> </node> <end-state name="end" /> </process-definition>
using next java code, have fired transition wait completed:
/* suppose workflowinstanceid id of instance of workflow */ list<workflowpath> paths = workflowservice.getworkflowpaths(workflowinstanceid); if (paths != null && paths.size() != 0) { (workflowpath wp : paths) { seek { /* checktransition() returns true if path contains transition "complete" */ boolean hascomplete = checktransition(wp, "complete"); if (hascomplete) { workflowservice.signal(wp.getid(), "complete"); } } grab (workflowexception ex) { ex.printstacktrace(); } } }
before executing code can see in workflow console workflow instance in right task , there transition "complete".
when code execute, command:
show workflows all
does not homecoming workflows.
everything seems ok, there seems problem. task instance "wait" still in "in_progress" , returned webscript though workflow instance not exist anymore.
it's old question i've got answer. i'm not sure if it's right reply you.
i had same issue , signalling didn't work. used next
<action class="org.alfresco.repo.workflow.jbpm.alfrescojavascript"> <script> <variable name="wf_ended" access="read,write" /> <expression>wf_ended = true;</expression> </script> </action> <script> executioncontext.gettaskmgmtinstance().endall(); </script>
transition alfresco jbpm
Comments
Post a Comment