Introduction to Activiti

6,417 views

Published on

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

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
6,417
On SlideShare
0
From Embeds
0
Number of Embeds
28
Actions
Shares
0
Downloads
219
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Introduction to Activiti

  1. 1. Introduction to Activiti yangyunshuichn@gmail.com 2012.11.13
  2. 2. Contents Confidential Slide 2 21 November 2012• Introduction• Simple Demo• Configuration• Deployment• BPMN 2.0• Integration with RCP• actviti-karaf• Reference
  3. 3. Confidential Slide 3 21 November 2012Introduction
  4. 4. 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
  5. 5. 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
  6. 6. Confidential Slide 6 21 November 2012Simple Demo
  7. 7. Simple Demo Confidential Slide 7 21 November 2012
  8. 8. Simple Demo Confidential Slide 8 21 November 2012
  9. 9. Confidential Slide 9 21 November 2012Configuration
  10. 10. 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.
  11. 11. Creating a ProcessEngine(cont’) Confidential Slide 11 21 November 2012• ProcessEngineConfiguration from configurated bean• Don’t use a configuration file
  12. 12. 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.
  13. 13. 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).
  14. 14. 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.
  15. 15. 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
  16. 16. Confidential Slide 16 21 November 2012Deployment
  17. 17. Deployment Confidential Slide 17 21 November 2012• Deploying programmatically• Deploying with ant• Deploying with Activiti Explorer • Refer to User Guide
  18. 18. Deploying with Activiti Explorer Confidential Slide 18 21 November 2012• Example process• Process definition database• Processes
  19. 19. Confidential Slide 19 21 November 2012BPMN 2.0
  20. 20. 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.
  21. 21. BPMN 2.0 Constructs Confidential Slide 21 21 November 2012• Eclipse Activiti BPMN Designer • Eclipse - http://activiti.org/designer/update/
  22. 22. Confidential Slide 22 21 November 2012Integration with RCP
  23. 23. BPMN Diagram Confidential Slide 23 21 November 2012
  24. 24. Condition Expression Confidential Slide 24 21 November 2012
  25. 25. Service Task Confidential Slide 25 21 November 2012
  26. 26. Service Implement Confidential Slide 26 21 November 2012• ProcessServiceDelegate• LayerServiceDelegate• CascalSessionHandlerServiceDelegate• CpmSessionHandlerServiceDelegate• ErrorSessionTypeHandlerServiceDelegate
  27. 27. Service Implement(cont’) Confidential Slide 27 21 November 2012• RunSessionServiceDelegate
  28. 28. Example View Confidential Slide 28 21 November 2012
  29. 29. Confidential Slide 29 21 November 2012activiti-karaf
  30. 30. 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
  31. 31. 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
  32. 32. Reference Confidential Slide 32 21 November 2012• 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/
  33. 33. Thanks!

×