BPM-1 Introduction to Advanced Workflows

36
Introduction to Advanced Workflows Gavin Cornwell, Development Manager, Services Team, Alfresco

description

This session will introduce the audience to the workflow capabilities available in Alfresco. We will discuss the workflow UI in Share and the configuration options available. A working example will also show how custom Activiti workflows can be implemented, deployed, configured and monitored.

Transcript of BPM-1 Introduction to Advanced Workflows

Page 1: BPM-1 Introduction to Advanced Workflows

Introduction to Advanced Workflows!

Gavin Cornwell, Development Manager, Services Team, Alfresco!

Page 2: BPM-1 Introduction to Advanced Workflows

Agenda!

•  Demo •  UI •  Task Definition •  Process Definition •  Deployment •  Configuration • UI!• Form!• Engine!

•  Q & A

Page 3: BPM-1 Introduction to Advanced Workflows

Demo!

•  Start ‘DevCon Presentation Review’ Workflow •  Manage Task •  Monitor Progress • Workflow Details!• Workflow Console!

Page 4: BPM-1 Introduction to Advanced Workflows

UI!

Page 5: BPM-1 Introduction to Advanced Workflows

My Tasks!

Page 6: BPM-1 Introduction to Advanced Workflows

Edit Task!

Page 7: BPM-1 Introduction to Advanced Workflows

Workflows Iʼve Started!

Page 8: BPM-1 Introduction to Advanced Workflows

Workflow Details!

Page 9: BPM-1 Introduction to Advanced Workflows

Admin Console!

Page 10: BPM-1 Introduction to Advanced Workflows

Workflow Console!

Page 11: BPM-1 Introduction to Advanced Workflows

Task Definition!

Page 12: BPM-1 Introduction to Advanced Workflows

Based on Alfresco Content Modelling!

• bpmModel.xml • bpm:task!• bpm:workflowTask!• bpm:startTask!• bpm:activitiStartTask!• bpm:activitiOutcomeTask!

• workflowModel.xml • wf:submitAdhocTask!• wf:reviewTask!• wf:activitiReviewTask!• wf:approvedTask!

Page 13: BPM-1 Introduction to Advanced Workflows

Start Task!<type name="dcwkflw:submitPresentationReviewTask"> <parent>wf:submitReviewTask</parent> <mandatory-aspects> <aspect>dcwkflw:details</aspect> </mandatory-aspects> </type>

Page 14: BPM-1 Introduction to Advanced Workflows

Task Definition – Start Task cont.!<aspect name="dcwkflw:details">! <properties>! <property name="dcwkflw:abstract">! <type>d:text</type>! </property>! <property name="dcwkflw:duration">! <type>d:int</type>! </property>! </properties>! <associations>! <association name="dcwkflw:presenter”>! <source>…</source>! <target>! <class>cm:person</class>! <mandatory>true</mandatory>! <many>false</many>! </target>! </association>! </associations>!</aspect>!

Page 15: BPM-1 Introduction to Advanced Workflows

Task Definition – Review Task!<type name="dcwkflw:presentationReviewTask"> <parent>bpm:activitiOutcomeTask</parent> <properties> <property name="dcwkflw:reviewOutcome"> <type>d:text</type> <default>Reject</default> <constraints> <constraint ref="dcwkflw:choices" /> </constraints> </property> </properties> <overrides> <property name="bpm:outcomePropertyName"> <default> {http://www.alfresco.org/model/dcworkflow/1.0}reviewOutcome </default> </property> </overrides> <mandatory-aspects><aspect>dcwkflw:details</aspect></mandatory-

aspects> </type>

Page 16: BPM-1 Introduction to Advanced Workflows

Task Definition – Review Task cont.!<constraint name="dcwkflw:choices" type="LIST"> <parameter name="allowedValues"> <list> <value>Publish</value> <value>Reject</value> </list> </parameter> </constraint>

Page 17: BPM-1 Introduction to Advanced Workflows

Process Definition!

Page 18: BPM-1 Introduction to Advanced Workflows

Example Process Definition!

Page 19: BPM-1 Introduction to Advanced Workflows

Start Task!<process id="presentationReview” name="DevCon Presentation Review">

<startEvent id="start” activiti:formKey="dcwkflw:submitPresentationReviewTask" />

<sequenceFlow id='flow1' sourceRef='start' targetRef='reviewTask' />

Page 20: BPM-1 Introduction to Advanced Workflows

Review Task!<userTask id="reviewTask" name="Review Presentation" activiti:formKey="dcwkflw:presentationReviewTask"> <extensionElements> <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> … </activiti:taskListener> <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> <activiti:field name="script"> <activiti:string> execution.setVariable('dcwkflw_reviewOutcome', task.getVariable('dcwkflw_reviewOutcome')); </activiti:string> </activiti:field> </activiti:taskListener> </extensionElements> <humanPerformer> <resourceAssignmentExpression> <formalExpression>${bpm_assignee.properties.userName}</formalExpression> </resourceAssignmentExpression> </humanPerformer> </userTask>

Page 21: BPM-1 Introduction to Advanced Workflows

Decision!<sequenceFlow id='flow2' sourceRef='reviewTask' targetRef='reviewDecision' />

<exclusiveGateway id="reviewDecision" name="Review Decision" />

<sequenceFlow id='flow3' sourceRef='reviewDecision' targetRef='approved' > <conditionExpression xsi:type="tFormalExpression"> ${dcwkflw_reviewOutcome == 'Publish'} </conditionExpression> </sequenceFlow>

<sequenceFlow id='flow4' sourceRef='reviewDecision' targetRef='rejected' />

Page 22: BPM-1 Introduction to Advanced Workflows

Approved Task!<userTask id="approved" name="Presentation Approved"

activiti:formKey="wf:approvedTask" > <extensionElements> <activiti:taskListener event="create” class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> … </activiti:taskListener> </extensionElements> <humanPerformer> <resourceAssignmentExpression> <formalExpression>${initiator.properties.userName}</formalExpression> </resourceAssignmentExpression> </humanPerformer> </userTask>

Page 23: BPM-1 Introduction to Advanced Workflows

Rejected Task!<userTask id=”rejected" name="Presentation Rejected"

activiti:formKey="wf:rejectedTask" > <extensionElements> <activiti:taskListener event="create” class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> … </activiti:taskListener> </extensionElements> <humanPerformer> <resourceAssignmentExpression> <formalExpression>${initiator.properties.userName}</formalExpression> </resourceAssignmentExpression> </humanPerformer> </userTask>

Page 24: BPM-1 Introduction to Advanced Workflows

Deployment!

Page 25: BPM-1 Introduction to Advanced Workflows

Spring: your-context.xml!<bean id="devconWorkflowBootstrap" parent="workflowDeployer"> <property name="workflowDefinitions"> <list> <props> <prop key="engineId">activiti</prop> <prop key="location">alfresco/extension/devcon-workflow.bpmn20.xml</prop> <prop key="mimetype">text/xml</prop> <prop key="redeploy">false</prop> </props> </list> </property> <property name="models"> <list><value>alfresco/extension/devcon-workflow-model.xml</value></list> </property> <property name="labels"> <list><value>alfresco/extension/devcon-workflow-model</value></list> </property> </bean>

Page 26: BPM-1 Introduction to Advanced Workflows

Workflow Console!

Page 27: BPM-1 Introduction to Advanced Workflows

Configuration!

Page 28: BPM-1 Introduction to Advanced Workflows

UI – Hiding Workflows!<config evaluator="string-compare" condition="Workflow"> <hidden-workflows> <!-- Hide all WCM related workflows --> <workflow name="jbpm$wcmwf:*"/> <workflow name="jbpm$wf:articleapproval"/> </hidden-workflows> </config>

Page 29: BPM-1 Introduction to Advanced Workflows

UI – Hiding Tasks!<config evaluator="string-compare" condition="Workflow"> <hidden-tasks> <!-- Hide all WCM related tasks --> <task type="wcmwf:*"/> </hidden-tasks> </config>

Page 30: BPM-1 Introduction to Advanced Workflows

Start Workflow Form!<config evaluator="string-compare" condition="activiti$presentationReview"> <forms> <form> <field-visibility> <show id="bpm:workflowDescription" /> <show id="bpm:workflowDueDate" /> <show id="bpm:workflowPriority" /> <show id="bpm:assignee" /> <show id="dcwkflw:abstract" /> <show id="dcwkflw:duration" /> <show id="dcwkflw:presenter" /> <show id="packageItems" /> <show id="bpm:sendEMailNotifications" /> </field-visibility> <appearance>…</appearance> </form> </forms> </config>

Page 31: BPM-1 Introduction to Advanced Workflows

Task Form!<config evaluator="task-type" condition="dcwkflw:presentationReviewTask"> <forms> <form> <field-visibility> … <show id="dcwkflw:abstract" /> <show id="dcwkflw:duration" /> <show id="dcwkflw:presenter" /> <show id="dcwkflw:reviewOutcome" /> </field-visibility> <appearance> … <field id="dcwkflw:reviewOutcome”> <control template="/org/.../workflow/activiti-transitions.ftl" /> </field> … </appearance> </form> </forms> </config>

Page 32: BPM-1 Introduction to Advanced Workflows

Workflow Details Form!

Page 33: BPM-1 Introduction to Advanced Workflows

Workflow Details Form!<config evaluator="task-type” condition="dcwkflw:submitPresentationReviewTask"> <forms> <form id="workflow-details"> <field-visibility> <show id="bpm:sendEMailNotifications" /> <show id="dcwkflw:abstract" /> <show id="dcwkflw:duration" /> <show id="dcwkflw:presenter" /> <show id="packageItems" /> </field-visibility> <appearance>…</appearance> </form> </forms> </config>

Page 34: BPM-1 Introduction to Advanced Workflows

Engine!

• Disabling • system.workflow.engine.jbpm.enabled=true!• system.workflow.engine.activiti.enabled=true!

• Definition Visibility • system.workflow.engine.jbpm.definitions.visible=false!• system.workflow.engine.activiti.definitions.visible=true!

• Override in alfresco-global.properties • Values shown in Admin Console or JMX Dump

Page 35: BPM-1 Introduction to Advanced Workflows

Questions ?!

Page 36: BPM-1 Introduction to Advanced Workflows

Learn More!

http://wiki.alfresco.com/wiki/Workflow http://wiki.alfresco.com/wiki/Forms http://www.activiti.org