38
Activiti in A Tom Baeyens & Joram Barrez Alfresco 1

Devoxx Activiti in Action

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Devoxx Activiti in Action

Activiti in ActionTom Baeyens & Joram Barrez

Alfresco

1

Page 2: Devoxx Activiti in Action

Last year…• We talked about jBPM

• JBoss

• Things change

• BPMN 2.0

• Consolidating efforts

• Liberal license required

• Alfresco

• Warm heart

2

Page 3: Devoxx Activiti in Action

33

Page 4: Devoxx Activiti in Action

4

ECM + BPM

Page 5: Devoxx Activiti in Action

BPMN 2.0• OMG standard

–Shapes

–Execution semantics

–File format

• Membership

• First pure play BPM standard

• General endorsement

5

Page 6: Devoxx Activiti in Action

Activiti In Evolution

6

DSLs

Page 7: Devoxx Activiti in Action

Activiti & Java• Out-of-the-box

–Control flow

–Functional activity types

–Everything you exect in a typical BPM System

• But…–Not limited to out of the box

7

Page 8: Devoxx Activiti in Action

Activiti is an Embeddable Process Engine

8

Oracle || MySQL || PostgreSQL || Any DB…

Executions

History

.jar

Processes

Your Domain Tables

Any JavaEnvironment

Page 9: Devoxx Activiti in Action

Activiti Embeds In Your App• Embeds in

• Your database• Your transaction• Your domain model• Your tests• Your Spring configuration

9

TomcatJDK 5JBoss…

Oracle, MySQL, PostgreSQL

Activiti YourApp

Spring

Page 10: Devoxx Activiti in Action

Community

10

Page 11: Devoxx Activiti in Action

Community

11

Page 12: Devoxx Activiti in Action

12

Last year…

12

jBPM 3

jBPM 4

Page 13: Devoxx Activiti in Action

13

Today

13

Page 14: Devoxx Activiti in Action

14

What do you get?• World-class rock-solid BPM and workflow engine

14

Page 15: Devoxx Activiti in Action

Not only the engine?

15

Activiti ModelerActiviti

Modeler

Activiti CycleActiviti Cycle

Activiti ExplorerActiviti

Explorer

Activiti ProbeActiviti Probe

Activiti Designer

Activiti Designer

REST interfaceREST interface

iPhoneExploreriPhone

Explorer

Activiti EngineActiviti Engine

AndroidExplorerAndroidExplorer

Java ApplicationsJava Applications

Page 16: Devoxx Activiti in Action

16

Activiti Modeler• Webbased BPMN 2.0 graphical editor

16

Page 17: Devoxx Activiti in Action

17

Activiti Explorer• Task management

• Process instance inspection, reporting

17

Page 18: Devoxx Activiti in Action

18

Activiti Probe• System admin functionality

• Status overview, stuck jobs, exception inspection, logs, etc

18

Page 19: Devoxx Activiti in Action

19

Activiti Cycle• BPM collaboration … done right

19

Driven by

The Community!

Page 20: Devoxx Activiti in Action

Activiti REST API

20

• Remote communication regarless of the technology

Page 21: Devoxx Activiti in Action

• Activiti extension support, BPMN 2.0 validation, hierarchical modeling

Activiti Eclipse designer

21

Driven by

The Community!

Page 22: Devoxx Activiti in Action

• Pluggable activity support

Activiti Eclipse designer

22

Driven by

The Community!

Page 23: Devoxx Activiti in Action

• Mobile BPM == natural evolution of doing work

• Android client coming up!

Activiti & IPhone

23

Driven by

The Community!

Page 24: Devoxx Activiti in Action

• Grails convience capabilities• Typical configuration• Easy business archive deployment• Generate controllers/view/example app

Activiti Grails integration

24

Driven by

The Community!

Page 25: Devoxx Activiti in Action

Hello World

25

<process id=”helloWorldProcess" name=“My first process"> <startEvent id="theStart" /> <sequenceFlow id="flow1" sourceRef="theStart" targetRef="theTask" /> <userTask id="theTask" name="my task" /> <sequenceFlow id="flow2" sourceRef="theTask" targetRef="theEnd" /> <endEvent id="theEnd" /> </process>

Activiti Modeler, MS Visio,Aris, (Oracle)

ProcessEngine engine= new ProcessEngineBuilder() .configureFromResource(“activiti.cfg.xml”) .buildProcessEngine();engine.getRuntimeService().startProcessInstanceByKey(“helloWorldProcess”);Task task = engine.getTaskService().createTaskQuery().singleResult();Engine.getTaskService().complete(task.getId());

Page 26: Devoxx Activiti in Action

Real-life demo

26

• Use case: banks shouldn’t lend money to just anybody• Thorough analysis is needed• All steps needs to be recorded in official documents• Decisions are done based on Excel decision tables

Page 27: Devoxx Activiti in Action

The mortgage process

27

Page 28: Devoxx Activiti in Action

The mortgage process

28

Page 29: Devoxx Activiti in Action

The mortgage process

29

= CMIS call

Page 30: Devoxx Activiti in Action

The power of Java

30

Out-of-the-box

Custom Java

Page 31: Devoxx Activiti in Action

The power of Java

31

public class CreateLoanApplicationDocument implements JavaDelegation {

public void execute(DelegateExecution execution) {

Session session = CmisUtil.createCmisSession("admin", "admin", Constants.ALFRESCO_URL); Folder folder = CmisUtil.getFolder(session, Constants.LOAN_APPLICATION_STORAGE_FOLDER); Document document = createWordDocument(session, folder, execution); storeDocumentReferencesAsProcessVariables(execution, folder, document); session.save(); }

Page 32: Devoxx Activiti in Action

The cool stuff

32

• That didn’t make it in the demo

• But is just too cool not to show you

• Unit test support

• Query API

• Spring integration

• Method expressions

• JPA integration

Page 33: Devoxx Activiti in Action

Unit testing your processes

33

• With Activiti, business processes

• Live and breath along your regular app code

• Should be tested just the same!

• Typical BPM vendor & testing

• Activiti supports Junit 3 & 4 and offers lots of convience while testing

Page 34: Devoxx Activiti in Action

Query API• No need to learn the intern data model • Powerful and uniform query API

• Deployments and process definitions

• Process instances and executions

• History

• Variables

• Tasks, jobs, users, groups, historic activities/process instances/variables, …

repositoryService.createProcessDefinitionQuery.keyLike(“%mortgage%”).latest();

runtimeService.createProcessInstanceQuery .processDefinitionKey(“mortgage-process)”.orderByProcessInstanceId().desc();

historyService.createHistoricActivityQuery().processDefinitionId(procDefId) .activityType(“userTask”).orderByDuration().asc();

runtimeService.createProcessInstanceQuery() .variableValueGreaterThan(“amount”, 50000);

Page 35: Devoxx Activiti in Action

Spring integration• ProcessEngine as a Spring bean

• Delegate to Spring beans

35

<bean id=“printer” …

Page 36: Devoxx Activiti in Action

Method expressions & JPA

36

Process variables

Spring bean

Decision based on JPA entity property

Page 37: Devoxx Activiti in Action

The Activiti Experience

37

• Satisfy your Activiti itch

• One-stop-shop download• http://activiti.org

• Demo: “The Activiti Experience”• Do you have an excuse for

not trying out Activiti tonight?

Page 38: Devoxx Activiti in Action

Did you like what you saw?

38

• We keep making Activiti better, every day.

• Help us today and tweet your enthousiasm!

• @johnpowell996 I saw #activiti on #devoxx and I like it!

John Powell

CEO Alfresco