get property owner
![giorgio giorgio](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2009 08:37 PM
![Smiley Surprised Smiley Surprised](/i/smilies/16x16_smiley-surprised.png)
<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>
What I want to know is how you would do this same thing for the property owner to take possession of the workflow and do it again when the workflow finishes.
I hope someone can help me because I have not found anything like this example. Thanks and regards.
- Labels:
-
Archive
![cheffilet cheffilet](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2009 02:57 AM
![giorgio giorgio](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2009 03:02 AM
![cheffilet cheffilet](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2009 04:03 AM
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript"><script>initiator.properties[ …. ]…
![giorgio giorgio](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2009 04:10 AM
thanks and regards.
![cheffilet cheffilet](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2009 05:24 AM
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.
![giorgio giorgio](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2009 06:42 AM
(you get the whole code review_pooled_processdefinition.xml), which is what I am doing wrong?
<?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>
![pjcaracuel pjcaracuel](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2009 04:01 AM
Regards :lol:
![giorgio giorgio](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Good, I autorrespondo myself, and post this in the forum for all those who serve, because although it was in front of the nose has cost enough to find this, thank you very much to all who have been helping me what they have been, giving me ideas to capture this property.
In the end it was so easy to use this syntax. In this way we get the owner of the workflow, since process_definition, in the case of the workflows of this type have pooled empty until we take possession of the task, what happens is still not how to capture this event in order to assign the property just in time to take possession, as now I can only assign when you finish the task, as I do in the process definition does not tell if someone knows how to capture the event of taking possession to do so at this time .
bpm_package.children . properties [ "my: tecnico"] = bpm_package.properties [ 'cm: owner'];
a greeting.
![cheffilet cheffilet](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2009 09:15 AM
sry for my late posting, im still busy at this time… but you got it by yourself 😉
Have a look to the task events: task-assign as well as the assignment-tag.
<task-node> … <task> … <event type="task-assign"> <action class="…. extends JBPMSpringActionHandler"> </event>
Regards
![](/skins/images/A90266AC6EB1934BC937DAFB2842964E/responsive_peak/images/icon_anonymous_message.png)