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

Introduction to advanced workflow

Jan 22, 2017

Download

Software

Gavin Cornwell
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to advanced workflow

Introduction to Advanced Workflows!

Gavin Cornwell, Development Manager, Services Team, Alfresco!

Page 2: Introduction to advanced workflow

Agenda!

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

•  Demo •  Q & A

Page 3: Introduction to advanced workflow

UI!

Page 4: Introduction to advanced workflow

My Tasks!

Page 5: Introduction to advanced workflow

Edit Task!

Page 6: Introduction to advanced workflow

Workflows Iʼve Started!

Page 7: Introduction to advanced workflow

Workflow Details!

Page 8: Introduction to advanced workflow

Admin Console!

Page 9: Introduction to advanced workflow

Workflow Console!

Page 10: Introduction to advanced workflow

Process Definition!

Page 11: Introduction to advanced workflow

Example Process Definition!

Page 12: Introduction to advanced workflow

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

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

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

Page 13: Introduction to advanced workflow

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 14: Introduction to advanced workflow

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 15: Introduction to advanced workflow

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 16: Introduction to advanced workflow

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 17: Introduction to advanced workflow

Task Definition!

Page 18: Introduction to advanced workflow

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 19: Introduction to advanced workflow

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

Page 20: Introduction to advanced workflow

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 21: Introduction to advanced workflow

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 22: Introduction to advanced workflow

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 23: Introduction to advanced workflow

Deployment!

Page 24: Introduction to advanced workflow

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 25: Introduction to advanced workflow

Workflow Console!

Page 26: Introduction to advanced workflow

Configuration!

Page 27: Introduction to advanced workflow

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 28: Introduction to advanced workflow

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

Page 29: Introduction to advanced workflow

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 30: Introduction to advanced workflow

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 31: Introduction to advanced workflow

Workflow Details Form!

Page 32: Introduction to advanced workflow

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 33: Introduction to advanced workflow

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 34: Introduction to advanced workflow

Demo!

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

Page 35: Introduction to advanced workflow

Questions ?!

Page 36: Introduction to advanced workflow

Learn More!

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