Activiti for Business Process Designers

From Training Material
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⌘

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

Activiti Components⌘

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

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⌘

  • 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⌘

    • 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
    • Activiti is more developer-focused

Running Activiti⌘

Activiti Modeler⌘

  • 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⌘

Table-driven definition⌘

  • 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⌘

Exercises⌘

  • DEMO: Creating new model using Activiti Modeler
  • Exercise

Activiti Explorer⌘

Task Management⌘

Processes⌘

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

My Instances⌘

  • 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⌘

  • 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⌘

  • 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⌘

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

Report example⌘

Saved reports⌘

  • 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⌘

  • Database tab shows tables stored in database

Deployments⌘

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

Jobs⌘

  • jobs can be used to execute timer events

Users and Groups⌘

Administration⌘

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

Crystalball⌘

  • 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⌘

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

Create new process diagram⌘

Generate JUnit test⌘

JUnit example⌘

Add Referenced Libraries⌘

Debugging JUnit test⌘

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

Deploying processes⌘

  • activiti.cfg.xml file:

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⌘