11-02-2011 09:23 AM
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://activiti.org/bpmn20">
<process id="Simple" name="Adhoc Activiti TestProcess">
<startEvent id="start" name="Start" activiti:formKey="sgwf:submitStart"></startEvent>
<userTask id="adhocTask" name="Adhoc Task" activiti:assignee="${bpm_assignee.properties.userName}" activiti:formKey="wf:adhocTask">
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
<userTask id="verifyTaskDone" name="Verify Adhoc Task Completed." activiti:assignee="${initiator.properties.userName}" activiti:formKey="wf:completedAdhocTask">
<documentation>
Verify the arbitrary task was completed.
</documentation>
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
if (wf_notifyMe)
{
var mail = actions.create("mail");
mail.parameters.to = initiator.properties.email;
mail.parameters.subject = "Adhoc Task " + bpm_workflowDescription;
mail.parameters.from = bpm_assignee.properties.email;
mail.parameters.text = "It's done";
mail.execute(bpm_package);</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
<endEvent id="theEnd" name="End"></endEvent>
<sequenceFlow id="flow1" name="" sourceRef="start" targetRef="adhocTask"></sequenceFlow>
<sequenceFlow id="flow2" name="" sourceRef="adhocTask" targetRef="verifyTaskDone"></sequenceFlow>
<sequenceFlow id="flow3" name="" sourceRef="verifyTaskDone" targetRef="theEnd"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_Simple">
<bpmndi:BPMNPlane bpmnElement="Simple" id="BPMNPlane_Simple">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
<omgdc:Bounds height="35" width="35" x="30" y="200"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="adhocTask" id="BPMNShape_adhocTask">
<omgdc:Bounds height="55" width="105" x="105" y="190"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="verifyTaskDone" id="BPMNShape_verifyTaskDone">
<omgdc:Bounds height="55" width="105" x="250" y="190"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="theEnd" id="BPMNShape_theEnd">
<omgdc:Bounds height="35" width="35" x="395" y="200"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="65" y="217"></omgdi:waypoint>
<omgdi:waypoint x="105" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="210" y="217"></omgdi:waypoint>
<omgdi:waypoint x="250" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="355" y="217"></omgdi:waypoint>
<omgdi:waypoint x="395" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
…
<bean id="simple.custom.workflowBootstrap" parent="workflowDeployer">
<property name="workflowDefinitions">
<list>
<props>
<prop key="engineId">activiti</prop>
<prop key="location">alfresco/module/custom/workflow/financial/simple/Simple.bpmn20.xml</prop>
<prop key="mimetype">text/xml</prop>
<prop key="redeploy">true</prop>
</props>
</list>
</property>
<property name="labels">
<list>
<value>alfresco.module.custom.resources.wf_custom</value>
</list>
</property>
</bean>
</beans>
3. In my AMP module for Alfresco : Creation of the model (customWorkflow.xml):
<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of a Workflow –>
<model name="sgwf:workflowModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!– Optional meta-data about the model –>
<description>Custom Workflow Model</description>
<author>Custom </author>
<version>1.0</version>
<!–
Imports are required to allow references to definitions in other
models
–>
<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>
<!– Introduction of new namespaces defined by this model –>
<namespaces>
<namespace uri="http://www.Custom.ch/model/workflow/1.0"
prefix="sgwf" />
</namespaces>
<types>
<type name="sgwf:submitStart">
<parent>bpm:startTask</parent>
<!– To select a user –>
<mandatory-aspects>
<aspect>bpm:assignee</aspect>
</mandatory-aspects>
</type>
<type name="sgwf:approve">
<parent>bpm:workflowTask</parent>
<overrides>
<property name="bpm:packageItemActionGroup">
<default>read_package_item_actions</default>
</property>
</overrides>
</type>
</types>
</model>
…
<config evaluator="task-type" condition="sgwf:submitStart">
<forms>
<form id="workflow-details">
<field-visibility>
<show id="bpm:sendEMailNotifications" />
<show id="packageItems" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.workflow.more_info" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<field id="packageItems" set="items" />
</appearance>
</form>
<form>
<field-visibility>
<!– <show id="message" />–>
<show id="taskOwner" />
<show id="bpm:workflowPriority" />
<show id="bpm:workflowDueDate" />
<show id="bpm:taskId" />
<!– <show id="bpm:status" />–>
<show id="packageItems" />
<show id="bpm:sendEMailNotifications" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.task.info" />
<set id="info" appearance="" template="/org/alfresco/components/form/3-column-set.ftl" />
<set id="progress" appearance="title" label-id="workflow.set.task.progress" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="other" appearance="title" label-id="workflow.set.other" />
<field id="message">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>
<field id="taskOwner" set="info" />
<field id="bpm:taskId" set="info">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>
<field id="bpm:workflowPriority" label-id="workflow.field.priority" set="info" read-only="true">
<control template="/org/alfresco/components/form/controls/workflow/priority.ftl" />
</field>
<field id="bpm:workflowDueDate" set="info" label-id="workflow.field.due">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>
<field id="bpm:status" set="progress" />
<field id="bpm:sendEMailNotifications" set="other" />
<field id="packageItems" set="items" />
</appearance>
</form>
</forms>
</config>
</alfresco-config>
11-04-2011 06:41 AM
<config evaluator="string-compare" condition="activiti$Simple">
<forms>
<form>
<field-visibility>
<show id="bpm:workflowDescription" />
<show id="bpm:workflowDueDate" />
<show id="bpm:workflowPriority" />
<show id="bpm:assignee" />
<show id="packageItems" />
<show id="bpm:sendEMailNotifications" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.general" />
<set id="info" appearance="" template="/org/alfresco/components/form/2-column-set.ftl" />
<set id="assignee" appearance="title" label-id="workflow.set.assignee" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="other" appearance="title" label-id="workflow.set.other" />
<field id="bpm:workflowDescription" label-id="workflow.field.message">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 95%</control-param>
</control>
</field>
<field id="bpm:workflowDueDate" label-id="workflow.field.due" set="info" />
<field id="bpm:workflowPriority" label-id="workflow.field.priority" set="info">
<control template="/org/alfresco/components/form/controls/workflow/priority.ftl" />
</field>
<field id="bpm:assignee" label-id="workflow.field.assign_to" set="assignee" />
<field id="packageItems" set="items" />
<field id="bpm:sendEMailNotifications" set="other">
<control template="/org/alfresco/components/form/controls/workflow/email-notification.ftl" />
</field>
</appearance>
</form>
</forms>
</config>
11-07-2011 07:39 AM
prop.sgfwf_centre=Center a
worfklow.field.sgfwf_centre=Center b
sgfwf_centre=Centre c
property.sgfwf_centre=Centre d
sgfwf_workflowModel.property.sgfwf_centre=Centre e
sgfwf_workflowModel.property.sgfwf_centre.title=Centre f
sgfwf_centre.title=Centre g
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<!– Add Messages –>
<bean id="webscripts.custom.resources" class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent">
<property name="resourceBundles">
<list>
<value>alfresco.module.custom.resources.models_customGeneral</value>
<value>alfresco.module.custom.resources.models_sgfwfWorkflow</value>
</list>
</property>
</bean>
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of a Workflow –>
<model name="sgfwf:workflowModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!– Optional meta-data about the model –>
<description>Custom Workflow Model for Finance</description>
<author>Custom</author>
<version>1.0</version>
<!–
Imports are required to allow references to definitions in other
models
–>
<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>
<!– Introduction of new namespaces defined by this model –>
<namespaces>
<namespace uri="http://www.Custom.ch/model/workflow/finance/1.0"
prefix="sgfwf" />
</namespaces>
<types>
<type name="sgfwf:submitStart">
<parent>bpm:startTask</parent>
<properties>
<property name="sgfwf:centre">
<type>d:int</type>
<mandatory>true</mandatory>
<multiple>false</multiple>
</property>
<property name="sgfwf:genre">
<type>d:int</type>
<mandatory>true</mandatory>
<multiple>false</multiple>
</property>
<property name="sgfwf:account">
<type>d:int</type>
<mandatory>true</mandatory>
<multiple>false</multiple>
</property>
<property name="sgfwf:montant">
<type>d:text</type>
<mandatory>true</mandatory>
<multiple>false</multiple>
</property>
<property name="sgfwf:libelle">
<type>d:text</type>
<mandatory>true</mandatory>
<multiple>false</multiple>
</property>
</properties>
<!– To select a user –>
<mandatory-aspects>
<aspect>bpm:assignee</aspect>
</mandatory-aspects>
</type>
<type name="sgfwf:addData">
<parent>sgfwf:submitStart</parent>
</type>
<type name="sgfwf:approve">
<parent>bpm:workflowTask</parent>
<overrides>
<property name="bpm:packageItemActionGroup">
<default>read_package_item_actions</default>
</property>
</overrides>
</type>
</types>
</model>
<!– Activiti Ad Hoc Workflow Definition –>
<config evaluator="string-compare" condition="activiti$Simple">
<forms>
<form>
<field-visibility>
<show id="bpm:workflowDescription" />
<show id="bpm:workflowDueDate" />
<show id="bpm:workflowPriority" />
<show id="sgfwf:centre" />
<show id="sgfwf:genre" />
<show id="sgfwf:account" />
<show id="sgfwf:montant" />
<show id="sgfwf:libelle" />
<show id="bpm:assignee" />
<show id="packageItems" />
<show id="bpm:sendEMailNotifications" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.general" />
<set id="info" appearance="" template="/org/alfresco/components/form/2-column-set.ftl" />
<set id="assignee" appearance="title" label-id="workflow.set.assignee" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="other" appearance="title" label-id="workflow.set.other" />
<field id="bpm:workflowDescription" label-id="workflow.field.message">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 95%</control-param>
</control>
</field>
<field id="sgfwf:centre" set="other" label-id="sgfwf:centre" />
<field id="sgfwf:genre" set="other" />
<field id="sgfwf:account" set="other" />
<field id="sgfwf:montant" set="other" />
<field id="sgfwf:libelle" set="other" />
<field id="bpm:status" set="progress" />>
<field id="bpm:workflowDueDate" label-id="workflow.field.due" set="info" />
<field id="bpm:workflowPriority" label-id="workflow.field.priority" set="info">
<control template="/org/alfresco/components/form/controls/workflow/priority.ftl" />
</field>
<field id="bpm:assignee" label-id="workflow.field.assign_to" set="assignee" />
<field id="packageItems" set="items" />
<field id="bpm:sendEMailNotifications" set="other">
<control template="/org/alfresco/components/form/controls/workflow/email-notification.ftl" />
</field>
</appearance>
</form>
</forms>
</config>
11-17-2011 04:49 AM
<bean id="simple.custom.workflowBootstrap" parent="workflowDeployer">
<property name="workflowDefinitions">
<list>
<props>
<prop key="engineId">activiti</prop>
<prop key="location">alfresco/module/custom/workflow/financial/simple/Simple.bpmn20.xml</prop>
<prop key="mimetype">text/xml</prop>
<prop key="redeploy">true</prop>
</props>
</list>
</property>
<property name="models">
<list>
<value>alfresco/module/custom/model/sgfWorkflow.xml</value>
</list>
</property>
<property name="labels">
<list>
<value>alfresco.module.custom.resources.models_sgfWorkflow</value>
</list>
</property>
</bean>
2. Create the label file : models_sgfWorkflow.properties and add your properties :
# Workflow
Simple.workflow.title=Title of the Workflow
# Properties
sgfwf_workflowModel.property.sgfwf_centre.title=Center
3. In Share, in share-config-custom.xml, do not use : label-id="… Just :<field id="sgfwf:centre" set="other" />
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.