Activiti for Business Process Designers

From Training Material
Revision as of 01:09, 20 November 2015 by Filip Stachecki (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


title
Activiti for Business Process Designers
author


Filip Stachecki (NobleProg)

https://www.dropbox.com/s/3tfxf5kgmxh8xsi/request.form?dl=0

Introduction⌘

License⌘

ClipCapIt-150713-202223.PNG

Download⌘

Required software⌘

  • JDK 6+
  • Eclipse (for Activiti Designer)
  • Tomcat (any web container, but Tomcat is recommended)
  • H2 database

Required software - database⌘

  • Activiti Explorer runs an in-memory H2 database by default.
  • To run the Activiti Explorer with a standalone H2 or another database the db.properties in the WEB-INF/classes of the Activiti Explorer web application should be changed.
  • Change the line:
jdbc.url=jdbc:h2:mem:activiti
  • to
jdbc.url=jdbc:h2:tcp://localhost/~/activiti

H2 console⌘

  • open H2 console and connect

ClipCapIt-150726-135745.PNG

Activiti Components⌘

ClipCapIt-150713-211700.PNG

http://activiti.org/components.html

Activiti Components - Modeling⌘

  • Activiti Modeler - a BPMN web modeler, part of the Activiti Explorer web application. Used to be based on Signavio.
  • Activiti Designer - an Eclipse plugin which allows you to model BPMN 2.0 processes from within your IDE-environment.
  • Activiti Kickstart - tool that allows creating processes with no XML or programming language knowledge

Activiti Components - Runtime⌘

  • Activiti Engine - Java process engine that runs BPMN 2 processes

ClipCapIt-150731-123308.PNG

source: http://activiti.org/userguide/index.html

  • The engine API is the most common way of interacting with Activiti. The central starting point is the ProcessEngine

Activiti Components - Management⌘

ClipCapIt-150721-105546.PNG

  • Activiti Explorer - a web application that provides access to the Activiti Engine runtime for all users of the system
    • It includes task management, process instance inspection, management features and viewing reports based on statistical history data.
  • Activiti REST - a REST API to the Activiti Engine

Activiti Competitors⌘

  • ClipCapIt-150720-153732.PNG
    • In 2010 the two key developers for jBPM: Tom Baeyens and Joram Barrez left Red Hat and started Activiti
    • Activiti and jBPM have a lot of the same concepts
    • jBPM is integrated with Drools
  • ClipCapIt-150720-153910.PNG
    • Activiti is more developer-focused

Running Activiti⌘

Activiti Modeler⌘

ClipCapIt-150722-130944.PNG

  • Activiti Modeler is a BPMN web modeler component that’s available as part of the Activiti Explorer web application.
  • The Modeler is a fork of the Signavio Core Components project.
  • Since version 5.17.0 maintained and developed as part of the Activiti project.

Creating New Model⌘

ClipCapIt-150722-132858.PNG

Table-driven definition⌘

ClipCapIt-150722-133303.PNG

  • formerly known as "Kickstart"
  • allows to build simple processes with a table-based view and adding forms

Exercises⌘

  • DEMO: Creating new model using table-driven definition
  • Exercise

Activiti Modeler⌘

ClipCapIt-150722-133119.PNG

Exercises⌘

  • DEMO: Creating new model using Activiti Modeler
  • Exercise

Activiti Explorer⌘

Task Management⌘

ClipCapIt-150723-101836.PNG

Processes⌘

ClipCapIt-150723-103559.PNG

  • Processes tab allows to see all process definitions that are deployed to the Activiti engine and start new process instances.

My Instances⌘

ClipCapIt-150728-095648.PNG

  • My instances tab shows all the process instances with an uncompleted user task.
  • It also shows the current activities of the process instance and the stored process variables.

Reporting⌘

ClipCapIt-150728-094722.PNG

  • Reports tab presents some report examples and allows adding new reports to the system
  • Reporting feature doesn't work under JDK8 (Activiti 5.17.0) - package import problems

Report process example⌘

ClipCapIt-150728-123804.PNG

  • The data that is used to create lists and charts in the report is generated by a process (with activiti-report as category).

Generate reports⌘

ClipCapIt-150728-100157.PNG

  • Shows a list of all reports known to the system.
  • Allows to run the report generation.

Report example⌘

ClipCapIt-150728-115233.PNG

Saved reports⌘

ClipCapIt-150728-122707.PNG

  • Shows a list of all personal reports that were previously saved.
  • It is not possible to see the saved reports of someone else.

Management⌘

Database⌘

ClipCapIt-150723-104722.PNG

  • Database tab shows tables stored in database

Deployments⌘

ClipCapIt-150723-104907.PNG

  • A deployment stores deployed process or processes.
  • A deployment can contain multiple BPMN 2.0 xml files and any other resource.

Jobs⌘

ClipCapIt-150723-105126.PNG

  • jobs can be used to execute timer events

Users and Groups⌘

ClipCapIt-150723-110744.PNG

Administration⌘

ClipCapIt-150723-111004.PNG

  • Administration tab allows to check:
    • running / completed process instances
    • database settings

Crystalball⌘

ClipCapIt-150723-111601.PNG

  • CrystalBall is simulation engine for Activiti Business Process Management Platform.
  • It is still experimental

Activiti Designer⌘

  • Activiti (Eclipse) Designer is an Eclipse plugin, that can be used to graphically model, test and deploy BPMN 2.0 processes.

Installation⌘

ClipCapIt-150724-130824.PNG

  • In Eclipse go to Help → Install New Software.
  • Click on Add button and fill in the following fields:

Create new process diagram⌘

ClipCapIt-150724-131939.PNG

Generate JUnit test⌘

ClipCapIt-150724-132337.PNG

JUnit example⌘

ClipCapIt-150726-193004.PNG

Add Referenced Libraries⌘

ClipCapIt-150726-222046.PNG

Debugging JUnit test⌘

ClipCapIt-150726-220704.PNG

  • add breakpoint in unit test file
  • Debug As -> JUnit Test
  • switch to Debug perspective

ClipCapIt-150726-220928.PNG

Deploying processes⌘

  • activiti.cfg.xml file:

ClipCapIt-150727-121924.PNG

Activiti REST⌘

  • Activiti includes a REST API to the Activiti Engine
  • REST can be installed:
    • by deploying the activiti-rest.war file Tomcat webapps folder
    • by including the servlet and all activiti-rest dependencies in your application
  • REST API uses JSON format
  • All REST-resources require a valid Activiti-user
kermit:kermit@localhost:8080/activiti-rest/service/repository/deployments/{deploymentId}

http://activiti.org/userguide/index.html#_rest_api

Activiti REST examples⌘

  • get list of process definitions
localhost/activiti-rest/service/repository/process-definitions
  • get a list of models
localhost/activiti-rest/service/repository/models
  • get a list of process instancess
localhost/activiti-rest/service/runtime/process-instances
  • get a list of tables
localhost/activiti-rest/service/management/tables

Appendix⌘

References⌘