06-03-2009 08:37 PM
<task-node name="rejected">
<transition name="" to="end" />
<event type="node-enter">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
for (var z = 0; z < bpm_package.children.length; z++)
{
bpm_package.children[z].properties["my:expert"] = bpm_groupAssignee.properties["usr:authorityName"];
bpm_package.children[z].save();
}
</script>
</action>
</event>
</task-node>
06-04-2009 02:57 AM
06-04-2009 03:02 AM
06-04-2009 04:03 AM
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
initiator.properties[ …. ]
…
06-04-2009 04:10 AM
06-04-2009 05:24 AM
<event type="task-end">
<script>
var wf_parenttaskowner= taskInstance.actorId;
</script>
<controller>
<variable name="wf_parenttaskowner" access="read, write" mapped-name="wf_parenttaskowner"/>
</controller>
</event>
06-04-2009 06:42 AM
<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wf:reviewpooled">
<swimlane name="initiator" />
<start-state name="start">
<task name="wf:submitGroupReviewTask" swimlane="initiator" />
<transition name="" to="review" />
</start-state>
<swimlane name="reviewer">
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
<pooledactors>#{bpm_groupAssignee}</pooledactors>
</assignment>
</swimlane>
<task-node name="review">
<task name="wf:reviewTask" swimlane="reviewer">
<event type="task-create">
<script>
if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
</script>
</event>
<event type="task-end">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<variable name="bpm_assignee" access="write"/>
<expression>
if (taskInstance.actorId != null)
people.getPerson(taskInstance.actorId);
else
person;
</expression>
var wf_parenttaskowner= taskInstance.actorId;
</script>
<controller>
<variable name="wf_parenttaskowner" access="read, write" mapped-name="wf_parenttaskowner"/>
</controller>
</action>
</event>
</task>
<transition name="" to="completed" />
<event type="node-enter">
<!– Update the status to Rejected when we enter this task –>
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
for (var i = 0; i < bpm_package.children.length; i++)
{
bpm_package.children.properties["myrioridad"] = bpm_workflowPriority;
bpm_package.children.properties["my:estado"] = "Pendent";
bpm_package.children.properties["my:tecnico"] = wf_parenttaskowner;
bpm_package.children.save();
}
</script>
</action>
</event>
</task-node>
<task-node name="completed">
<event type="node-enter">
<!– Update the status to Aproved when we enter this task –>
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
for (var a = 0; a < bpm_package.children.length; a++)
{
bpm_package.children[a].properties["myrioridad"] = bpm_workflowPriority;
bpm_package.children[a].properties["my:estado"] = "Acabat";
bpm_package.children[a].properties["my:tecnico"] = wf_parenttaskowner;
bpm_package.children[a].save();
}
</script>
</action>
</event>
<transition name="" to="end" />
</task-node>
<end-state name="end" />
</process-definition>
06-05-2009 04:01 AM
06-08-2009 03:33 AM
Ah allright now i´ve understand.
I do not know whether its possible to retrieve the last task-node thas has been performed. As in your code-excerpt in post-1 you´re already in the next step.
In your previous task-node (where the user/actor performs some actions) you could add a new event being called "task-end" where you can retrieve the current task-owner and set it as a variable to the current workflow. But you have to scoping this variable as task-properties does not automatically passing such properties to the whole workflow.
You should add something like:
<event type="task-end">
<script>
var wf_parenttaskowner= taskInstance.actorId;
</script>
<controller>
<variable name="wf_parenttaskowner" access="read, write" mapped-name="wf_parenttaskowner"/>
</controller>
</event>
I´ve not tested but something like this should be working. But thats not an appropriated solution as we could have paraellel tasks so it doesnt works for it.
bpm_package.children . properties [ "my: tecnico"] = bpm_package.properties [ 'cm: owner'];
06-08-2009 09:15 AM
<task-node>
…
<task>
…
<event type="task-assign">
<action class="…. extends JBPMSpringActionHandler">
</event>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.