activiti in action (devoxx 2010)

38
Activiti in A Tom Baeyens & Joram Barrez Alfresco 1

Upload: joram-barrez

Post on 20-Jan-2015

773 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Activiti in Action (Devoxx 2010)

Activiti in ActionTom Baeyens & Joram Barrez

Alfresco

1

Page 2: Activiti in Action (Devoxx 2010)

Last year…• We talked about jBPM

• JBoss

• Things change

• BPMN 2.0

• Consolidating efforts

• Liberal license required

• Alfresco

• Warm heart

2

Page 3: Activiti in Action (Devoxx 2010)

33

Page 4: Activiti in Action (Devoxx 2010)

4

ECM + BPM

Page 5: Activiti in Action (Devoxx 2010)

BPMN 2.0• OMG standard

–Shapes

–Execution semantics

–File format

• Membership

• First pure play BPM standard

• General endorsement

5

Page 6: Activiti in Action (Devoxx 2010)

Activiti In Evolution

6

DSLs

Page 7: Activiti in Action (Devoxx 2010)

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: Activiti in Action (Devoxx 2010)

Activiti is an Embeddable Process Engine

8

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

Executions

History

.jar

Processes

Your Domain Tables

Any JavaEnvironment

Page 9: Activiti in Action (Devoxx 2010)

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: Activiti in Action (Devoxx 2010)

Community

10

Page 11: Activiti in Action (Devoxx 2010)

Community

11

Page 12: Activiti in Action (Devoxx 2010)

12

Last year…

12

jBPM 3

jBPM 4

Page 13: Activiti in Action (Devoxx 2010)

13

Today

13

Page 14: Activiti in Action (Devoxx 2010)

14

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

14

Page 15: Activiti in Action (Devoxx 2010)

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: Activiti in Action (Devoxx 2010)

16

Activiti Modeler• Webbased BPMN 2.0 graphical editor

16

Page 17: Activiti in Action (Devoxx 2010)

17

Activiti Explorer• Task management

• Process instance inspection, reporting

17

Page 18: Activiti in Action (Devoxx 2010)

18

Activiti Probe• System admin functionality

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

18

Page 19: Activiti in Action (Devoxx 2010)

19

Activiti Cycle• BPM collaboration … done right

19

Driven by

The Community!

Page 20: Activiti in Action (Devoxx 2010)

Activiti REST API

20

• Remote communication regarless of the technology

Page 21: Activiti in Action (Devoxx 2010)

• Activiti extension support, BPMN 2.0 validation, hierarchical modeling

Activiti Eclipse designer

21

Driven by

The Community!

Page 22: Activiti in Action (Devoxx 2010)

• Pluggable activity support

Activiti Eclipse designer

22

Driven by

The Community!

Page 23: Activiti in Action (Devoxx 2010)

• Mobile BPM == natural evolution of doing work

• Android client coming up!

Activiti & IPhone

23

Driven by

The Community!

Page 24: Activiti in Action (Devoxx 2010)

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

Activiti Grails integration

24

Driven by

The Community!

Page 25: Activiti in Action (Devoxx 2010)

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: Activiti in Action (Devoxx 2010)

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: Activiti in Action (Devoxx 2010)

The mortgage process

27

Page 28: Activiti in Action (Devoxx 2010)

The mortgage process

28

Page 29: Activiti in Action (Devoxx 2010)

The mortgage process

29

= CMIS call

Page 30: Activiti in Action (Devoxx 2010)

The power of Java

30

Out-of-the-box

Custom Java

Page 31: Activiti in Action (Devoxx 2010)

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: Activiti in Action (Devoxx 2010)

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: Activiti in Action (Devoxx 2010)

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: Activiti in Action (Devoxx 2010)

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: Activiti in Action (Devoxx 2010)

Spring integration• ProcessEngine as a Spring bean

• Delegate to Spring beans

35

<bean id=“printer” …

Page 36: Activiti in Action (Devoxx 2010)

Method expressions & JPA

36

Process variables

Spring bean

Decision based on JPA entity property

Page 37: Activiti in Action (Devoxx 2010)

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: Activiti in Action (Devoxx 2010)

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