Introduction to Activiti email@example.com 2012.11.13
Contents Confidential Slide 2 21 November 2012• Introduction• Simple Demo• Configuration• Deployment• BPMN 2.0• Integration with RCP• actviti-karaf• Reference
Confidential Slide 3 21 November 2012Introduction
Why we need Activiti? Confidential Slide 4 21 November 2012• 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
Platform Introduction Confidential Slide 5 21 November 2012• 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
Confidential Slide 6 21 November 2012Simple Demo
Simple Demo Confidential Slide 7 21 November 2012
Simple Demo Confidential Slide 8 21 November 2012
Confidential Slide 9 21 November 2012Configuration
Creating a ProcessEngine Confidential Slide 10 21 November 2012 • Look for an activiti.cfg.xml file on the classpath and construct an engine based on the configuration in that file.
Creating a ProcessEngine(cont’) Confidential Slide 11 21 November 2012• ProcessEngineConfiguration from configurated bean• Don’t use a configuration file
Creating a ProcessEngine(cont’) Confidential Slide 12 21 November 2012• 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.
Database configuration Confidential Slide 13 21 November 2012• 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 Confidential Slide 14 21 November 2012• 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.
Supported databases Confidential Slide 15 21 November 2012 Activiti database type Versions tested Example JDBC URL Notes Default configured h2 1.2.132 jdbc:h2:tcp://localhost/activiti database Tested using jdbc:mysql://localhost:3306/activiti?aut mysql-connetor- mysql 5.1.11 oReconnect=true java database driver oracle 10.2.0 jdbc:oracle:thin:@localhost:1521:xe postgres 8.4 jdbc:postgresql://localhost:5432/activiti DB2 9.7 using db2 jdbc:db2://localhost:50000/activiti [EXPERIMENTAL] db2jcc4 2008 using jdbc:jtds:sqlserver://localhost:1433/acti mssql [EXPERIMENTAL] JDBC jtds-1.2.4 viti
Confidential Slide 16 21 November 2012Deployment
Deployment Confidential Slide 17 21 November 2012• Deploying programmatically• Deploying with ant• Deploying with Activiti Explorer • Refer to User Guide
Deploying with Activiti Explorer Confidential Slide 18 21 November 2012• Example process• Process definition database• Processes
Confidential Slide 19 21 November 2012BPMN 2.0
Introduction Confidential Slide 20 21 November 2012• 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.
Confidential Slide 22 21 November 2012Integration with RCP
BPMN Diagram Confidential Slide 23 21 November 2012
Condition Expression Confidential Slide 24 21 November 2012
Service Task Confidential Slide 25 21 November 2012
Service Implement Confidential Slide 26 21 November 2012• ProcessServiceDelegate• LayerServiceDelegate• CascalSessionHandlerServiceDelegate• CpmSessionHandlerServiceDelegate• ErrorSessionTypeHandlerServiceDelegate
Service Implement(cont’) Confidential Slide 27 21 November 2012• RunSessionServiceDelegate
Example View Confidential Slide 28 21 November 2012
Confidential Slide 29 21 November 2012activiti-karaf
activiti-karaf Confidential Slide 30 21 November 2012• 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
activiti-karaf Confidential Slide 31 21 November 2012• 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