AnsweredAssumed Answered

get username in workflow pooled

Question asked by giorgio on Jun 2, 2009
Latest reply on Jun 2, 2009 by giorgio
Good, I'm changing a property of a document workflow, executing code from process_definition.xml, and in the case of workflows pooled for groups of type, I have no trouble getting the group name, but I think I need to when a user takes possession of the workflow to get the name of that user to modify the property, how we could do?

you get the code that I run to get the group name in review_pooled_processdefinition.xml


<? 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>
</ script>
</ 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 [ "my: priority"] = bpm_workflowPriority;
bpm_package.children . properties [ "my: state"] = "Pending";
/ / get the line with this group, but in that time you could get?
bpm_package.children . properties [ "my: tecnico"] = bpm_groupAssignee.properties [ "usr: authorityName"];
bpm_package.children . save ();
)
</ script>
</ action>
</ event>
</ task-node>



<task-node name="completed">
<event type="node-enter">
<! - Update the status to take advantage 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 [ "my: priority"] = bpm_workflowPriority;
bpm_package.children [a]. properties [ "my: state"] = "Finish";
bpm_package.children [a]. properties [ "my: tecnico"] = bpm_groupAssignee.properties [ "usr: authorityName"];
bpm_package.children [a]. save ();
)
</ script>
</ action>
</ event>
<transition name="" to="end" />
</ task-node>

<end-state name="end" />

</ process-definition>



I hope someone can help me.

Greetings and thanks in advance

Outcomes