+ All Categories
Home > Technology > BPM-4 Migration from jBPM to Activiti

BPM-4 Migration from jBPM to Activiti

Date post: 22-Nov-2014
Category:
Upload: alfresco-software
View: 4,460 times
Download: 4 times
Share this document with a friend
Description:
This session will look deeper into the differences between using jBPM or Activiti in Alfresco. We’ll be showing how common concepts can be mapped from jBPM to Activiti’s BPMN 2.0 modeling. This session will provide you with a better view on what it takes to migrate your existing Alfresco jBPM-processes to Activiti, embracing the standard for business process modeling.
28
Migration from jBPM to Activiti Frederik Heremans Software Engineer, Activiti Team, Alfresco
Transcript
Page 1: BPM-4 Migration from jBPM to Activiti

Migration from jBPM to Activiti!

Frederik Heremans!Software Engineer, Activiti Team, Alfresco!

Page 2: BPM-4 Migration from jBPM to Activiti

Introduction!

Frederik Heremans Software Engineer at Alfresco

•  Activiti core developer!•  Open-source enthusiast!•  Former J2EE and ECM consultant!•  Based in Belgium!

Page 3: BPM-4 Migration from jBPM to Activiti

Agenda!

•  What is Activiti?!•  BPMN 2.0!•  Activiti and JBPM compared!•  Migrating your workflow!

•  Process definition!•  Your code!

•  Designer Demo!•  Q&A!

Page 4: BPM-4 Migration from jBPM to Activiti

What is Activiti?!

•  100% Open source BPM!•  100% Java!•  Lightweight!•  Embeddable!•  Customizable!•  Excellent testability!

Page 5: BPM-4 Migration from jBPM to Activiti

What is Activiti?!

•  Not only an Alfresco effort!•  Active community!•  Release fast, release often!

Page 6: BPM-4 Migration from jBPM to Activiti

What is Activiti?!

API

runtimeService.startProcessInstance…

Forms

Process

Java

Page 7: BPM-4 Migration from jBPM to Activiti

More than just a simple library…!

Page 8: BPM-4 Migration from jBPM to Activiti

Activiti Modeler (Browser)!

Page 9: BPM-4 Migration from jBPM to Activiti

Activiti Designer (Eclipse)!

Page 10: BPM-4 Migration from jBPM to Activiti

Activiti Explorer!

Page 11: BPM-4 Migration from jBPM to Activiti

Activiti REST API!

Page 12: BPM-4 Migration from jBPM to Activiti

BPMN 2.0!

OMG standard •  Shapes!•  Execution semantics!•  File format!

First pure play BPM standard •  With general endorsement

Page 13: BPM-4 Migration from jBPM to Activiti

What does that mean?!

•  Huge pool of skilled analysts!•  Any BPMN 2.0 Compliant editor!

•  MS Visio, Oracle, IBM, Aris, …!

•  Executable on the Activiti engine!

Page 14: BPM-4 Migration from jBPM to Activiti

Activiti and JBPM compared!

•  Apache licensed!•  Started from scratch, new architecture!•  Clean (fluent) API!•  History separated from runtime data!•  Hibernate replaced by myBatis!•  BPMN 2.0 offers more constructs than JPDL!

Page 15: BPM-4 Migration from jBPM to Activiti

Migrating your workflows!

No automatic database-upgrade possible •  Due to big difference in architecture!•  Not necessary in Alfresco, both engines can be running alongside

during transition period!

What to migrate? •  Convert process definition!•  Convert (or reuse) task-definitions!•  Convert custom coding!

Page 16: BPM-4 Migration from jBPM to Activiti

Migrating your workflows!

No automatic database-upgrade possible •  Due to big difference in architecture!•  Not necessary in Alfresco, both engines can be running alongside

during transition period!

What to migrate? •  Convert process definition!•  Convert (or reuse) task-definitions!•  Convert custom coding!

Page 17: BPM-4 Migration from jBPM to Activiti

Modeling an Activiti process!

Using the Activiti designer •  Eclipse plug-in (uses Graphiti)!•  Built-in extensions & templates for Alfresco!

Editing XML by hand •  Activiti offers some extensions for making BPMN less verbose!

Modeling BPMN 2.0 in the Web-base modeler •  Pure BPMN modeler, no custom activiti/alfresco features!

Page 18: BPM-4 Migration from jBPM to Activiti

Common constructs!

JBPM Start-state = Activiti start event •  No notion of start-task in BPMN 2.0!

<start-state name="start"> <task name="wf:submitAdhocTask" swimlane="initiator"/> <transition name="" to="adhoc"/> </start-state>

<!-- Activiti --><startEvent id="start” activiti:formKey="wf:submitAdhocTask" />

<sequenceFlow id='flow1’ sourceRef='start’ targetRef='adhocTask' />

Page 19: BPM-4 Migration from jBPM to Activiti

Common constructs!

User tasks

<task-node name="completed"> <task name="wf:completedAdhocTask" swimlane="initiator"/> <transition name="" to="end"/></task-node>

<!-- Activiti --><userTask id="adhocTask" name="Adhoc Task” activiti:formKey="wf:adhocTask"> <humanPerformer> <resourceAssignmentExpression> <formalExpression> ${bpm_assignee.properties.userName}

</formalExpression> </resourceAssignmentExpression> </humanPerformer></userTask>

<sequenceFlow id='flow2’ sourceRef='adhocTask’ targetRef='verifyTaskDone' />

Page 20: BPM-4 Migration from jBPM to Activiti

Common constructs!

User tasks

<task-node name="completed"> <task name="wf:completedAdhocTask" swimlane="initiator"/> <transition name="" to="end"/></task-node>

<!-- Activiti --><userTask id="adhocTask" name="Adhoc Task” activiti:assignee="${bpm_assignee.properties.userName}” activiti:formKey="wf:adhocTask” />

<sequenceFlow id='flow2’ sourceRef='adhocTask’ targetRef='verifyTaskDone' />

Page 21: BPM-4 Migration from jBPM to Activiti

Assignment!

Swimlanes not supported in Activiti, use one of: •  Assignee (human performer)!•  Candidate users (potential owner)!•  Candidate groups (potential owner)!

Use of expressions is possible •  Assignment based on process-variables!

Page 22: BPM-4 Migration from jBPM to Activiti

Common constructs!

Variables

•  Process and Task-local variables!•  Some correspond to task-properties (QName)!•  Supports same variable types!•  Task-variables arenʼt flushed to the process (by default)!•  Can be used in expressions and alfresco scripts!

Page 23: BPM-4 Migration from jBPM to Activiti

Multiple transitions - Gateway!<task-node name="review"> <task name="wf:reviewTask" swimlane="reviewer” /> <transition name="approve" to="approved" /> <transition name="reject" to="rejected" /></task-node>

<!-- Activiti --><exclusiveGateway id="reviewDecision" name="Review Decision" />

<sequenceFlow id='flow3' sourceRef='reviewDecision' targetRef='approved’> <conditionExpression xsi:type="tFormalExpression"> ${wf_reviewOutcome == 'Approve’} </conditionExpression></sequenceFlow><sequenceFlow id='flow4’ sourceRef='reviewDecision’ targetRef='rejected' />

Page 24: BPM-4 Migration from jBPM to Activiti

Executing your code!

Service-task instead of action •  Executing Java code as part of the process!•  Field injection possible, using process context!•  Java Class, evaluate expression or use Spring-bean!•  Provided class to execute script against Alfresco!

Page 25: BPM-4 Migration from jBPM to Activiti

Executing your code!

Execution Listener •  Available events!

•  Process start!•  Process end!•  Transition taken (sequenceflow)!

•  ExecutionListener provided which executes a Script!

Task Listener •  Available events!

•  Task assigned!•  Task created!•  Task completed!

•  TaskListener provided which executes a Script!

Page 26: BPM-4 Migration from jBPM to Activiti

Tips!

•  Look at the process-definitions shipped with Alfresco!•  Property handling!•  Timers!•  Scripting!•  Gateways and outcomes!

•  Activiti userguide!•  Contains a lot of examples!•  All supported BPMN 2.0 constructs explained!

•  No need to read the full BPMN 2.0 spec (unless you have a lot of time on your hands…)!

•  Come to the “Workflow Deep Dive” talk to learn more!!

Page 27: BPM-4 Migration from jBPM to Activiti

Eclipse designer demo!

Page 28: BPM-4 Migration from jBPM to Activiti

Thank you for your attention!Any questions?!


Recommended