Introduction to Activiti

yunshui 7,552 views 33 slides Nov 20, 2012
Slide 1
Slide 1 of 33
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33

About This Presentation

Base on Activiti user guider.
http://www.activiti.org/userguide/index.html


Slide Content

[email protected]
2012.11.13
Introduction to Activiti

Contents
21 November 2012
Confidential
Slide 2
•Introduction
•Simple Demo
•Configuration
•Deployment
•BPMN 2.0
•Integration with RCP
•actviti-karaf
•Reference

Introduction
21 November 2012
Confidential
Slide 3

Why we need Activiti?
•Everyday we are faced with all kinds of different processes. For
example, when you order a book in an online bookstore a process is
executed to get the book paid, packaged and shipped to you.
•Activiti provides an open source framework to design, implement and
run processes. Organizations can use Activiti to implement their
business processes.
•Modeler, a web-based graphical workflow authoring
•Designer, an Eclipse plug-in for developing workflows
•Engine, the core workflow processor
•Explorer, a web tool to deploy process definitions
•Cycle, a web app for collaboration between business users and software
engineers
21 November 2012
Confidential
Slide 4

Platform Introduction
•Apache V2 License
•Required software: JDK 5+, Ant 1.8.1+, Eclipse 3.6+
•Download: http://activiti.org/download.html
•Reporting problems
•Activiti Forums - http://forums.activiti.org/
•JIRA: http://jira.codehaus.org/browse/ACT
•Experimental features
•Not stable
•Sections marked with [EXPERIMENTAL],
•All classes that have .impl. in the package name
•Stable
•User guide mentions those classes as configuration values
21 November 2012
Confidential
Slide 5

Simple Demo
21 November 2012
Confidential
Slide 6

Simple Demo

21 November 2012
Confidential
Slide 7

Simple Demo

21 November 2012
Confidential
Slide 8

Configuration
21 November 2012
Confidential
Slide 9

Creating a ProcessEngine

•Look for an activiti.cfg.xml file on the classpath and construct an engine
based on the configuration in that file.
21 November 2012
Confidential
Slide 10

Creating a ProcessEngine(cont’)
•ProcessEngineConfiguration from configurated bean



•Don’t use a configuration file
21 November 2012
Confidential
Slide 11

Creating a ProcessEngine(cont’)
•ProcessEngineConfiguration bean
This bean is used to construct the ProcessEngine.
•org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration
•Process engine is used in a standalone way. Activiti will take care of the
transactions.
•org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration
•An H2 in-memory database is used by default. The database will be created and
dropped when the engine boots and shuts down.
•org.activiti.spring.SpringProcessEngineConfiguration
•Process engine is used in a Spring environment.
•org.activiti.engine.impl.cfg.JtaProcessEngineConfiguration
•([EXPERIMENTAL]) Using when the engine runs in standalone mode, with JTA
transactions.
21 November 2012
Confidential
Slide 12

Database configuration
21 November 2012
Confidential
Slide 13
•jdbcUrl
•jdbcDriver
•jdbcUsername
•jdbcPassword
•Optional
•jdbcMaxActiveConnections: The maximum number of active connections.
Default is 10.
•jdbcMaxIdleConnections: The number of idle connections
•jdbcMaxCheckoutTime: Connection can be 'checked out' from the
connection pool before it is forcefully returned. Default is 20000 (20
seconds).
•jdbcMaxWaitTime: Chance to print a log status and re-attempt the
acquisition of a connection waiting time, Default is 20000 (20 seconds).

Database table names
•Database names of Activiti all start with ACT_
•ACT_RE_*: 'RE' stands for repository. 'static'' information such as process
definitions and, process resources (images, rules, etc.).
•ACT_RU_*: 'RU' stands for runtime. Runtime data of process instances,
user tasks,variables, jobs, etc. Removes the records when a process
instance ends.
•ACT_ID_*: 'ID' stands for identity. Identity information, such as users,
groups, etc.
•ACT_HI_*: 'HI' stands for history. Historic data, such as past process
instances, variables, tasks, etc.
•ACT_GE_*: general data, which is used in various use cases.
21 November 2012
Confidential
Slide 14

Supported databases
21 November 2012
Confidential
Slide 15
Activiti database type Versions tested Example JDBC URL Notes
h2 1.2.132 jdbc:h2:tcp://localhost/activiti
Default configured
database
mysql 5.1.11
jdbc:mysql://localhost:3306/activiti?aut
oReconnect=true
Tested using
mysql-connetor-
java database
driver
oracle 10.2.0 jdbc:oracle:thin:@localhost:1521:xe
postgres 8.4 jdbc:postgresql://localhost:5432/activiti
db2
DB2 9.7 using
db2jcc4
jdbc:db2://localhost:50000/activiti [EXPERIMENTAL]
mssql
2008 using
JDBC jtds-1.2.4
jdbc:jtds:sqlserver://localhost:1433/acti
viti
[EXPERIMENTAL]

Deployment
21 November 2012
Confidential
Slide 16

Deployment
•Deploying programmatically

•Deploying with ant



•Deploying with Activiti Explorer



•Refer to User Guide
21 November 2012
Confidential
Slide 17

Deploying with Activiti Explorer
•Example process


•Process definition database




•Processes
21 November 2012
Confidential
Slide 18

BPMN 2.0
21 November 2012
Confidential
Slide 19

Introduction
•What is BPMN?
•BPMN(Business Process Model and Notation) is a graphical
representation for specifying business processes in a business process
model.
•Business Process Management Initiative (BPMI) developed BPMN, which
has been maintained by the Object Management Group since the two
organizations merged in 2005. As of March 2011, the current version of
BPMN is 2.0.
21 November 2012
Confidential
Slide 20

BPMN 2.0 Constructs
•Eclipse Activiti BPMN Designer
•Eclipse - http://activiti.org/designer/update/

21 November 2012
Confidential
Slide 21

Integration with RCP
21 November 2012
Confidential
Slide 22

BPMN Diagram

21 November 2012
Confidential
Slide 23

Condition Expression






21 November 2012
Confidential
Slide 24

Service Task

21 November 2012
Confidential
Slide 25

Service Implement
• ProcessServiceDelegate

•LayerServiceDelegate

•CascalSessionHandlerServiceDelegate

•CpmSessionHandlerServiceDelegate

•ErrorSessionTypeHandlerServiceDelegate




21 November 2012
Confidential
Slide 26

Service Implement(cont’)
• RunSessionServiceDelegate






21 November 2012
Confidential
Slide 27

Example View
21 November 2012
Confidential
Slide 28

activiti-karaf
21 November 2012
Confidential
Slide 29

activiti-karaf
•This project packages and configures Activiti components (Runtime,
CLI and Web based tools) in Apache Karaf Container to make Activiti
available on a ready to use OSGi platform.
•Consists:
•Maven projects - to configure and package the Activiti components with
Apache Karaf
•Activiti CLI - set of Karaf Commands to manage Activiti/BPMN artifacts
deployed on the Activiti runtime in the Karaf Container
•Examples - example code to build and deploy osgi bundles with Activiti
BPMN artifacts to the Activiti runtime in the Karaf Container.
•Activiti Maven Archetype - to create a maven based project to develop,
build and deploy Activiti BPMN artifacts.
•Other patches to the Activiti components(like web based tools) to make
them usable in OSGi container





21 November 2012
Confidential
Slide 30

activiti-karaf
•1. Download distribution archive
•2. Unzip the downloaded file to some location (e.g c:/demo)
note: if unzip tool prompts for overwrite files, ignore
•3. Install Required Software
•4. Start Activiti Karaf - cd to bin directory in unziped folder and
execute karaf
•5. Access Activiti Web tools
•5.1 Open Activiti Modeler - http://localhost:8181/activiti-modeler
•5.2 Open Activiti Explorer - http://localhost:8181/activiti-explorer
•use kermit/kermit as username/password for login
•…
•Run Activiti CLI commands



21 November 2012
Confidential
Slide 31

21 November 2012
Confidential
Slide 32
Reference
•http://activiti.org/download.html
•http://activiti.org/userguide/index.html
•http://activiti.org/javadocs/index.html
•http://www.manning.com/rademakers2/
•http://code.google.com/p/activiti-karaf/

Thanks!