07-23-2007 04:30 AM
<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="ovs:ovaanvraag">
<swimlane name="initiator" />
<start-state name="start">
<task name="ovs:startaanvraag" swimlane="initiator">
<event type="node-leave">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<expression>
CoordinatorUser = "Bouw1";
BouwUser = "Bouw1";
ReclameUser = "Reclame1";
InuitritUser = "Inuitrit1";
KapUser = "Kap1";
SloopUser = "Sloop1";
</expression>
<variable name="CoordinatorUser" access="write" />
<variable name="BouwUser" access="write" />
<variable name="ReclameUser" access="write" />
<variable name="InuitritUser" access="write" />
<variable name="KapUser" access="write" />
<variable name="SloopUser" access="write" />
</script>
</action>
</event>
</task>
<transition name="" to="ControleerAanvraag"></transition>
</start-state>
<swimlane name="coordinator">
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
<actor>#{people.getPerson(CoordinatorUser).properties["cm:userName"]}</actor>
</assignment>
</swimlane>
<swimlane name="bouwadv">
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
<actor>#{BouwUser}</actor>
</assignment>
</swimlane>
………..
08-10-2007 10:03 AM
08-10-2007 10:54 AM
08-13-2007 03:27 AM
08-13-2007 06:54 AM
09-02-2007 08:05 AM
Start an advanced workflow via Javascript, and provide the workflow parameters such as reviewer, due date etc in the script. This will, however, bypass the Start Workflow Wizard, so you can't edit the values (defined in the script) in the UI.Thanks david, but where should i write this script, i mean in what file should i write this script…
http://wiki.alfresco.com/wiki/WorkflowAdministration#Step_7:_Integration_with_Rules_.28Optional.29
09-02-2007 10:52 PM
09-04-2007 08:45 AM
<types>
<type name="qcp:mtSignOff">
<parent>bpm:workflowTask</parent>
<mandatory-aspects>
<aspect>qcp:assignments</aspect>
</mandatory-aspects>
</type>
</types>
<aspects>
<aspect name="qcp:assignments">
<associations>
<association name="qcp:mtApprover">
<source>
<mandatory>false</mandatory>
<many>false</many>
</source>
<target>
<class>cm:person</class>
<mandatory>false</mandatory>
<many>false</many>
</target>
</association>
</associations>
</aspect>
</aspects>
Inside the workflow I added the following script: <start-state name="initiateCcr">
<task name="qcp:initiateCcr" swimlane="initiator">
<event type="task-create">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<variable name="qcp_mtApprover" access="write"/>
<expression>
qcp_mtApprover = people.getPerson("Francois Buijs");
</expression>
</script>
</action>
</event>
</task>
Although I added this to the <task-create> event of the start-state, the default will be visible in the next workflow step (provided the visibility is regulated in the "web-client-config-custom.xml" file as shown below:<config evaluator="node-type" condition="qcp:mtSignOff" replace="true">
<property-sheet>
<separator name="sep1" display-label="General" component-generator="HeaderSeparatorGenerator"/>
<show-property name="bpm:taskId" read-only="true"/>
<show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true"/>
<show-property name="bpm:dueDate" read-only="true"/>
<show-property name="bpm:priority" read-only="true"/>
<show-property name="bpm:status"/>
<separator name="sep2" display-label="Required metadata" component-generator="HeaderSeparatorGenerator"/>
<show-property name="qcp:wfPlannedArpRelease" display-label="Planned ARP release"/>
<separator name="sep3" display-label="Roles and assigned users" component-generator="HeaderSeparatorGenerator"/>
<show-association name="qcp:mtApprover" display-label="Assigned MT signer" read-only="true"/>
</property-sheet>
</config>
(I left out irrelevant lines to reduce to the minimum needed).09-14-2007 04:47 AM
Well in fact I succeeded in "predefining" a user and having the possibility to change it later on. I created an aspect holding the various users in the workflow and associated that aspect to all workflow types in the model description.Inside the workflow I added the following script:<types>
<type name="qcp:mtSignOff">
<parent>bpm:workflowTask</parent>
<mandatory-aspects>
<aspect>qcp:assignments</aspect>
</mandatory-aspects>
</type>
</types>
<aspects>
<aspect name="qcp:assignments">
<associations>
<association name="qcp:mtApprover">
<source>
<mandatory>false</mandatory>
<many>false</many>
</source>
<target>
<class>cm:person</class>
<mandatory>false</mandatory>
<many>false</many>
</target>
</association>
</associations>
</aspect>
</aspects>Although I added this to the <task-create> event of the start-state, the default will be visible in the next workflow step (provided the visibility is regulated in the "web-client-config-custom.xml" file as shown below:<start-state name="initiateCcr">
<task name="qcp:initiateCcr" swimlane="initiator">
<event type="task-create">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<variable name="qcp_mtApprover" access="write"/>
<expression>
qcp_mtApprover = people.getPerson("Francois Buijs");
</expression>
</script>
</action>
</event>
</task>
(I left out irrelevant lines to reduce to the minimum needed).<config evaluator="node-type" condition="qcp:mtSignOff" replace="true">
<property-sheet>
<separator name="sep1" display-label="General" component-generator="HeaderSeparatorGenerator"/>
<show-property name="bpm:taskId" read-only="true"/>
<show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true"/>
<show-property name="bpm:dueDate" read-only="true"/>
<show-property name="bpm:priority" read-only="true"/>
<show-property name="bpm:status"/>
<separator name="sep2" display-label="Required metadata" component-generator="HeaderSeparatorGenerator"/>
<show-property name="qcp:wfPlannedArpRelease" display-label="Planned ARP release"/>
<separator name="sep3" display-label="Roles and assigned users" component-generator="HeaderSeparatorGenerator"/>
<show-association name="qcp:mtApprover" display-label="Assigned MT signer" read-only="true"/>
</property-sheet>
</config>
During testing the workflow assigned the task to the mentioned person (Francois Buijs). And I was able to change the assigned person during the workflow with the expected effect.
09-14-2007 05:18 AM
09-17-2007 10:06 AM
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.