11-19-2009 11:21 AM
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="tswf:report">
<swimlane name="initiator" />
<swimlane name="approver">
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
<actor>admin</actor>
</assignment>
</swimlane>
<start-state name="start">
<task name="tswf:askForReportTask" swimlane="initiator" />
<transition name="" to="startcollecting"/>
</start-state>
<node name="startcollecting">
<action class="org.alfresco.repo.workflow.jbpm.ForEachFork">
<foreach>#{bpm_assignees}</foreach>
<var>reporter</var>
</action>
<transition name="report" to="report" />
</node>
<task-node name="report">
<task name="tswf:reportTask">
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
<actor>#{reporter}</actor>
</assignment>
<event type="task-create">
<script>
if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
</script>
</event>
</task>
<transition name="send" to="endreport">
</transition>
</task-node>
<join name="endreport">
<transition to="reportscollected" />
</join>
<task-node name="reportscollected">
<task name="tswf:approvedReportTask" swimlane="approver" />
<transition to="end" />
</task-node>
<end-state name="end"/>
</process-definition>
<?xml version="1.0" encoding="UTF-8"?>
<model name="tswf:testworkflowmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<imports>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"/>
</imports>
<namespaces>
<namespace uri="http://www.alfresco.org/model/testworkflow/1.0" prefix="tswf"/>
</namespaces>
<types>
<type name="tswf:askForReportTask">
<parent>bpm:startTask</parent>
<mandatory-aspects>
<aspect>bpm:assignees</aspect>
</mandatory-aspects>
</type>
<type name="tswf:reportTask">
<parent>bpm:workflowTask</parent>
<overrides>
<property name="bpm:packageItemActionGroup">
<default>start_package_item_actions</default>
</property>
</overrides>
</type>
<type name="tswf:approvedReportTask">
<parent>bpm:workflowTask</parent>
</type>
</types>
</model>
var dataFolder = companyhome.childByNamePath("/reports/data");
if (dataFolder == null)
{
var reportFolder = companyhome.childByNamePath("/reports");
dataFolder = reportFolder.createFolder("data");
}
var reporters = people.getMembers(people.getGroup("GROUP_reporters"));
var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "jbpm$tswf:report";
workflow.parameters["bpm:assignees"] = reporters;
var futureDate = new Date();
futureDate.setDate(futureDate.getDate() + 2);
workflow.parameters["bpm:workflowDueDate"] = futureDate;
workflow.execute(dataFolder);
org.alfresco.repo.search.SearcherException: Invalid type: {http://www.alfresco.org/model/bpm/1.0}workflowPackage
11-20-2009 06:22 AM
<type name="tswf:reportTask">
<parent>bpm:workflowTask</parent>
<overrides>
<property name="bpm:packageItemActionGroup">
<default>start_package_item_actions</default>
</property>
</overrides>
</type>
by <type name="tswf:reportTask">
<parent>bpm:workflowTask</parent>
<overrides>
<property name="bpm:packageItemActionGroup">
<default>edit_package_item_actions</default>
</property>
</overrides>
</type>
11-20-2009 11:21 AM
12-04-2009 05:42 AM
12-06-2009 06:22 PM
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.