SlideShare une entreprise Scribd logo
1  sur  32
Activiti BPM
Activiti BPM Database Reporting and Analytics
Agenda
• Over view of BPM
• Over view of Activiti BPM
• Activiti BPM Database
• Activiti BPM Reporting
• Analytics using Activiti BPM Database
What is Business Process and Business
Process Management
• Business Process:
• A business process is an activity or set of activities that will
accomplish a specific organizational goal.
• Business process management (BPM) is a systematic approach to
improving those processes.
• Business Process Management:
• Business process management (BPM) is a systematic approach to
making an organization's workflow more effective, more efficient and
more capable of adapting to an ever-changing environment.
Few important terms
• BPMN(Business Process Modelling Notation):
• BPMN is a method of illustrating business processes in the form of a diagram
similar to a flowchart.
• Can be divided into 2 parts:
• Tasks: represented as rectangular shape.
• Events: represented as circular shape.
• Gateways: represented as diamond shape.
• Connecting objects: represented as arrow shape.
• Swimlanes: represented as path shape.
Tasks Events
Gate
way Swimlanes
Few important terms
• BPD (Business Process Discovery):
• Business process discovery, also called process discovery, is a collection of
tools and techniques used to define, map and analyse an organization’s
existing business processes.
• It’s a initial step of BPM.
• Mostly used for BI(Business Intelligence) and BA(Business Analytics).
• We can say it as a way of creating Business Process Diagram logically using
BPMN.
• BPEL (Business Process Execution Language)
• BPEL is an XML-based language that enables task-sharing in a distributed
computing or grid computing environment.
Business Process Diagram
Activiti BPM
• Activiti is a light-weight workflow and Business Process Management
(BPM) Platform targeted at business people, developers and system
admins.
• Its core is a super-fast and rock-solid BPMN 2 process engine for Java.
It's open-source and distributed under the Apache license.
• Activiti runs in any Java application, on a server, on a cluster or in the
cloud.
• It integrates perfectly with Spring, it is extremely lightweight and
based on simple concepts.
Activiti BPM Components
Database
Activiti Database
• Activiti database is a repository which includes all process, tasks,
events and process variables related data, which is used to maintain
different Business Processes and to create their statistics.
• Its stores static information, runtime data, identity, history and
general data.
Supporting Databases
• Activiti supports different databases.
Database Configuration
• Define the JDBC properties of the database:
• jdbcUrl: JDBC URL of the database.
• jdbcDriver: implementation of the driver for the specific database type.
• jdbcUsername: username to connect to the database.
• jdbcPassword: password to connect to the database.
• The following attributes can optionally be set to tweak that connection pool (taken from
the MyBatis documentation):
• jdbcMaxActiveConnections: The number of active connections that the connection pool at
maximum at any time can contain. Default is 10.
• jdbcMaxIdleConnections: The number of idle connections that the connection pool at maximum
at any time can contain.
• jdbcMaxCheckoutTime: The amount of time in milliseconds a connection can be 'checked out'
from the connection pool before it is forcefully returned. Default is 20000 (20 seconds).
• jdbcMaxWaitTime: This is a low level setting that gives the pool a chance to print a log status and
re-attempt the acquisition of a connection in the case that it’s taking unusually long (to avoid
failing silently forever if the pool is misconfigured) Default is 20000 (20 seconds).
• databaseSchemaUpdate: true/false/create-drop
Database table names explained
• The database names of Activiti all start with ACT_.
• ACT_RE_*: 'RE' stands for repository. Tables with this prefix contain
'static' information such as process definitions and process
resources(images, rules, etc.).
• ACT_RU_*: 'RU' stands for runtime. These are the runtime tables,
that contain the runtime data of process instances, user tasks,
variables, jobs, etc. Activiti only stores the runtime data during
process instance execution, and removes the records when a process
instance ends. This keeps the runtime tables small and fast.
• ACT_ID_*: 'ID' stands for identity. These tables contain identity
information, such as users, groups, etc.
Database table names explained
• ACT_HI_*: 'HI' stands for history. These are the tables that contain
historic data, such as past process instances, variables, tasks, etc.
• ACT_GE_*: ‘GE' stands for general data, which is used in various use
cases.
History
• Activiti Database contains all process instance related details.
• There are 5 history entities:
• HistoricProcessInstances containing information about current and past process
instances.
• HistoricVariableInstances containing the latest value of a process variable or task
variable.
• HistoricActivityInstances containing information about a single execution of an
activity (node in the process).
• HistoricTaskInstances containing information about current and past (completed and
deleted) task instances.
• HistoricDetails containing various kinds of information related to either a historic
process instances, an activity instance or a task instance.
Query History
• Activiti has provided Java API’s for querying history from Activiti
database.
• These API’s are known as Query API’s.
• Methods to expose all 5 history entities:
• HistoricProcessInstances: createHistoricProcessInstanceQuery()
• HistoricVariableInstances: createHistoricVariableInstanceQuery()
• HistoricActivityInstances: createHistoricActivityInstanceQuery()
• HistoricDetails: createHistoricDetailQuery()
• HistoricTaskInstances: createHistoricTaskInstanceQuery()
Query History Examples
• Historic Process Instance Query:
• Get 10 HistoricProcessInstances that are finished and which took the most
time to complete (the longest duration) of all finished processes with
definition ‘XXX‘:
historyService.createHistoricProcessInstanceQuery()
.finished()
.processDefinitionId(“XXX")
.orderByProcessInstanceDuration().desc()
.listPage(0, 10);
Query History Examples
• Historic Variable Instance Query:
• Get all Historic Variable Instances from a finished process instance with id
‘XXX' ordered by variable name.
historyService.createHistoricVariableInstanceQuery()
.processInstanceId("XXX")
.orderByVariableName.desc()
.list();
Query History Examples
• Historic Activity Instance Query:
• Get the last Historic Activity Instance of type 'serviceTask' that has been
finished in any process that uses the process definition with id XXX.
historyService.createHistoricActivityInstanceQuery()
.activityType("serviceTask")
.processDefinitionId("XXX")
.finished()
.orderByHistoricActivityInstanceEndTime().desc()
.listPage(0, 1);
Query History Examples
• Historic Detail Query:
• Get all variable-updates that have been done in process with id ‘XXX’.
• Its possible that a certain variable name has multiple Historic Variable Update
entries, for each time the variable was updated in the process.
historyService.createHistoricDetailQuery()
.variableUpdates()
.processInstanceId(“XXX")
.orderByVariableName().asc()
.list();
Query History Examples
• Historic Detail Query:
• Gets all variable updates that were performed on the task with id “XXX".
• This returns all Historic Variable Updates for variables that were set on the
task (task local variables), and NOT on the process instance.
historyService.createHistoricDetailQuery()
.variableUpdates()
.taskId(“XXX")
.orderByVariableName().asc()
.list()
Query History Examples
• Historic Detail Query:
• Gets all form-properties that were submitted in any task or when starting the
process with id “XXX".
• Task local variables can be set using the TaskService or on a DelegateTask,
inside TaskListener:
historyService.createHistoricDetailQuery()
.formProperties()
.processInstanceId(“XXX")
.orderByVariableName().asc()
.list()
taskService.setVariableLocal(“XXX", "myVariable", "Variable value");
OR
public void notify(DelegateTask delegateTask) {
delegateTask.setVariableLocal("myVariable", "Variable value");
}
Query History Examples
• Historic Task Instance Query:
• Get 10 Historic Task Instances that are finished and which took the most time
to complete (the longest duration) of all tasks.
• Get Historic Task Instances that are deleted with a delete reason that contains
"invalid", which were last assigned to user 'kermit'.
historyService.createHistoricTaskInstanceQuery()
.finished()
.orderByHistoricTaskInstanceDuration().desc()
.list Page(0, 10);
historyService.createHistoricTaskInstanceQuery()
.finished()
.taskDeleteReasonLike("%invalid%")
.taskAssignee("kermit")
.listPage(0, 10);
Reporting
• Activiti explorer has 4 important tabs, from reporting is one of the tab.
• Several advantages:
• The process has straight access to the internals of the Activiti engine. It has direct
access to the database used by the engine.
• The job executor can be used as for any other process. This means that you can
asynchronously generate the process or only execute certain steps asynchronously. It
also means you can use timers, eg. to generate the report data on certain points in
time.
• Creating a new report can be done with known tools and known concepts. Also, no
new concepts, services or applications are needed. Deploying or uploading a new
report is the same as deploying a new process.
• It allows to use the BPMN 2.0 constructs. This means that all things like parallel
steps, do branching based on data or even request user input during the generation
are possible out-of-the-box
Reporting
• How to generate reports in
Activiti?
• The process produces a variable
called ‘reportData’ is created.
• This variable must be a byte array
representation of a json object.
• This variable is stored in the history
tables of Activiti so it can be
retrieved later when the report is
saved.
Reporting
• Reporting JSON structure:
• title: this is the general title for the whole report
• datasets: this is an array of datasets corresponding with
the different charts and lists on the report.
• type: Each dataset has a type. This type will be used to
determine how the data will be rendered. Currently
supported values are: pieChart, lineChart, barChart and list.
• description: each chart can have an optional description
that will be shown in the report.
• x- and y-axis: only usable for type lineChart. Optional
parameter that determines the name of the axes of the
chart
• data: this is the actual data. The data is a json object with
key-value elements.
{
"title": "My Report",
"datasets": [
{
"type" : "lineChart",
"description" : "My first chart",
"xaxis" : "Year"
"yaxis" : "Total sales"
"data" :
{
"2010" : 50,
"2011" : 33,
"2012" : 17,
"2013" : 87,
}
}
]
}
Reporting Example
• Generate Reports
between all process
instances and process
instances of different
process definitions
<?xml version="1.0" encoding="UTF-8"?><definitions
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti="http://activiti.org/bpmn"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI"
typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="activiti-report">
<process id="process-instance-overview-report" name="Process
Instance Overview" isExecutable="true">
<startEvent id="startevent1" name="Start" />
<sequenceFlow id="flow1" sourceRef="startevent1"
targetRef="generateDataset" />
<scriptTask id="generateDataset" name="Execute script"
scriptFormat="JavaScript" activiti:autoStoreVariables="false">
<script> <!– write your java script code here  </script>
</scriptTask>
<sequenceFlow id="flow3" sourceRef="generateDataset"
targetRef="theEnd" /><endEvent id="theEnd" />
</process>
</definitions>
Reporting Example
• JavaScript code:
importPackage(java.sql);
importPackage(java.lang);
importPackage(org.activiti.explorer.reporting);
var result =
ReportingUtil.executeSelectSqlQuery("SELECT PD.NAME_,
PD.VERSION_ , count(*) FROM ACT_HI_PROCINST PI inner
join ACT_RE_PROCDEF PD on PI.PROC_DEF_ID_ = PD.ID_
group by PROC_DEF_ID_");
var reportData = new ReportData;
var dataset = reportData.newDataset();
dataset.type = "pieChart";
dataset.description = "Process instance overview (" +
new java.util.Date() + ")“;
while (result.next()) { // process results one row at a
time
var name = result.getString(1);
var version = result.getLong(2);
var count = result.getLong(3);
dataset.add(name + " (v" + version + ")",
count);
}
execution.setVariable("reportData",
reportData.toBytes());
Reporting Example
• List type output:
Reporting Example
• Pie Chart type output:
Activiti BPM Database and Analytics
• Analytics is a technology and field that helps any organization in
decision making and enhancing their business in more profitable and
more predictive way, by using their own huge data.
• Most of the organization analysis their business mostly in terms of
cost and time.
• Activiti has their own database where it maintains each every task
and process related data, so we can say somehow its possible to do
analytics on it.
Activiti BPM Database and Analytics
• Analytics can be of 2 types on Activiti database:
• Process Analytics
• Data Analytics
• Demo on Process Analytics using Disco (Fluxicon).
Activiti BPM Database and Analytics Example
• Here will take an example of Travel Domain.
• Most time taking tasks.
• Most costly and cost efficient tasks.
• Total cost of travels per quarter on company v/s cost per BU per quarter v/s
cost per BU per account per quarter v/s cost per BU per account per project
per quarter (v/s total cost revenue generated by company in that quarter)
Company revenue per account per project v/s expenditure on travel per quarter

Contenu connexe

Tendances

Business Process Modeling
Business Process ModelingBusiness Process Modeling
Business Process Modelingguest2c3da5c7
 
Stored Procedures and Triggers
Stored Procedures and TriggersStored Procedures and Triggers
Stored Procedures and Triggersflaviognm
 
Princípios Fundamentais da Análise de Requisitos
Princípios Fundamentais da Análise de RequisitosPrincípios Fundamentais da Análise de Requisitos
Princípios Fundamentais da Análise de Requisitoselliando dias
 
Introduction to Activiti BPM
Introduction to Activiti BPMIntroduction to Activiti BPM
Introduction to Activiti BPMAlfresco Software
 
BPMN Introduction
BPMN IntroductionBPMN Introduction
BPMN Introductionejlp12
 
Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014JWORKS powered by Ordina
 
Aula 02 - Engenharia de Requisitos
Aula 02 - Engenharia de RequisitosAula 02 - Engenharia de Requisitos
Aula 02 - Engenharia de RequisitosAlberto Simões
 
Enteprise Integration Patterns
Enteprise Integration PatternsEnteprise Integration Patterns
Enteprise Integration PatternsAlessandro Kieras
 
De a máxima cobertura nos seus testes de API
De a máxima cobertura nos seus testes de APIDe a máxima cobertura nos seus testes de API
De a máxima cobertura nos seus testes de APIElias Nogueira
 
All about Office UI Fabric
All about Office UI FabricAll about Office UI Fabric
All about Office UI FabricFabio Franzini
 
Desenvolvimento em Três Camadas com PHP, MVC e Ajax
Desenvolvimento em Três Camadas com PHP, MVC e AjaxDesenvolvimento em Três Camadas com PHP, MVC e Ajax
Desenvolvimento em Três Camadas com PHP, MVC e AjaxAlmir Neto
 
Gerência de Configuração
Gerência de ConfiguraçãoGerência de Configuração
Gerência de ConfiguraçãoWagner Zaparoli
 
Splunk as a_big_data_platform_for_developers_spring_one2gx
Splunk as a_big_data_platform_for_developers_spring_one2gxSplunk as a_big_data_platform_for_developers_spring_one2gx
Splunk as a_big_data_platform_for_developers_spring_one2gxDamien Dallimore
 

Tendances (20)

Aula javascript
Aula  javascriptAula  javascript
Aula javascript
 
Models for hierarchical data
Models for hierarchical dataModels for hierarchical data
Models for hierarchical data
 
AWS Kinesis Streams
AWS Kinesis StreamsAWS Kinesis Streams
AWS Kinesis Streams
 
Requisitos Ágeis
Requisitos ÁgeisRequisitos Ágeis
Requisitos Ágeis
 
Business Process Modeling
Business Process ModelingBusiness Process Modeling
Business Process Modeling
 
Stored Procedures and Triggers
Stored Procedures and TriggersStored Procedures and Triggers
Stored Procedures and Triggers
 
Princípios Fundamentais da Análise de Requisitos
Princípios Fundamentais da Análise de RequisitosPrincípios Fundamentais da Análise de Requisitos
Princípios Fundamentais da Análise de Requisitos
 
Introduction to Activiti BPM
Introduction to Activiti BPMIntroduction to Activiti BPM
Introduction to Activiti BPM
 
BPMN Introduction
BPMN IntroductionBPMN Introduction
BPMN Introduction
 
Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014
 
Aula 02 - Engenharia de Requisitos
Aula 02 - Engenharia de RequisitosAula 02 - Engenharia de Requisitos
Aula 02 - Engenharia de Requisitos
 
Introduction to Redux
Introduction to ReduxIntroduction to Redux
Introduction to Redux
 
Enteprise Integration Patterns
Enteprise Integration PatternsEnteprise Integration Patterns
Enteprise Integration Patterns
 
De a máxima cobertura nos seus testes de API
De a máxima cobertura nos seus testes de APIDe a máxima cobertura nos seus testes de API
De a máxima cobertura nos seus testes de API
 
Curso de Node JS Básico
Curso de Node JS BásicoCurso de Node JS Básico
Curso de Node JS Básico
 
Uml
UmlUml
Uml
 
All about Office UI Fabric
All about Office UI FabricAll about Office UI Fabric
All about Office UI Fabric
 
Desenvolvimento em Três Camadas com PHP, MVC e Ajax
Desenvolvimento em Três Camadas com PHP, MVC e AjaxDesenvolvimento em Três Camadas com PHP, MVC e Ajax
Desenvolvimento em Três Camadas com PHP, MVC e Ajax
 
Gerência de Configuração
Gerência de ConfiguraçãoGerência de Configuração
Gerência de Configuração
 
Splunk as a_big_data_platform_for_developers_spring_one2gx
Splunk as a_big_data_platform_for_developers_spring_one2gxSplunk as a_big_data_platform_for_developers_spring_one2gx
Splunk as a_big_data_platform_for_developers_spring_one2gx
 

Similaire à Activiti bpm

Alfresco Devcon 2010: A new kind of BPM with Activiti
Alfresco Devcon 2010: A new kind of BPM with ActivitiAlfresco Devcon 2010: A new kind of BPM with Activiti
Alfresco Devcon 2010: A new kind of BPM with ActivitiJoram Barrez
 
How we evolved data pipeline at Celtra and what we learned along the way
How we evolved data pipeline at Celtra and what we learned along the wayHow we evolved data pipeline at Celtra and what we learned along the way
How we evolved data pipeline at Celtra and what we learned along the wayGrega Kespret
 
SQL Server 2014 Monitoring and Profiling
SQL Server 2014 Monitoring and ProfilingSQL Server 2014 Monitoring and Profiling
SQL Server 2014 Monitoring and ProfilingAbouzar Noori
 
What are you waiting for
What are you waiting forWhat are you waiting for
What are you waiting forJason Strate
 
Ruote: A Ruby workflow engine
Ruote:  A Ruby workflow engineRuote:  A Ruby workflow engine
Ruote: A Ruby workflow engineWes Gamble
 
Geek Sync I Learn to Troubleshoot Query Performance in Analysis Services
Geek Sync I Learn to Troubleshoot Query Performance in Analysis ServicesGeek Sync I Learn to Troubleshoot Query Performance in Analysis Services
Geek Sync I Learn to Troubleshoot Query Performance in Analysis ServicesIDERA Software
 
4 the 3rd party libraries
4 the 3rd party libraries4 the 3rd party libraries
4 the 3rd party librariesjavadch
 
Utilizing the OpenNTF Domino API
Utilizing the OpenNTF Domino APIUtilizing the OpenNTF Domino API
Utilizing the OpenNTF Domino APIOliver Busse
 
Deep Dive into Azure Data Factory v2
Deep Dive into Azure Data Factory v2Deep Dive into Azure Data Factory v2
Deep Dive into Azure Data Factory v2Eric Bragas
 
Practical examples of using extended events
Practical examples of using extended eventsPractical examples of using extended events
Practical examples of using extended eventsDean Richards
 
Sage 300 ERP: Technical Tour of Diagnostic Tools
Sage 300 ERP: Technical Tour of Diagnostic ToolsSage 300 ERP: Technical Tour of Diagnostic Tools
Sage 300 ERP: Technical Tour of Diagnostic ToolsSage 300 ERP CS
 
Utilizing the open ntf domino api
Utilizing the open ntf domino apiUtilizing the open ntf domino api
Utilizing the open ntf domino apiOliver Busse
 
Remote DBA Experts SQL Server 2008 New Features
Remote DBA Experts SQL Server 2008 New FeaturesRemote DBA Experts SQL Server 2008 New Features
Remote DBA Experts SQL Server 2008 New FeaturesRemote DBA Experts
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disquszeeg
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSPC Adriatics
 
The art of the event streaming application: streams, stream processors and sc...
The art of the event streaming application: streams, stream processors and sc...The art of the event streaming application: streams, stream processors and sc...
The art of the event streaming application: streams, stream processors and sc...confluent
 

Similaire à Activiti bpm (20)

Alfresco Devcon 2010: A new kind of BPM with Activiti
Alfresco Devcon 2010: A new kind of BPM with ActivitiAlfresco Devcon 2010: A new kind of BPM with Activiti
Alfresco Devcon 2010: A new kind of BPM with Activiti
 
How we evolved data pipeline at Celtra and what we learned along the way
How we evolved data pipeline at Celtra and what we learned along the wayHow we evolved data pipeline at Celtra and what we learned along the way
How we evolved data pipeline at Celtra and what we learned along the way
 
Where to save my data, for devs!
Where to save my data, for devs!Where to save my data, for devs!
Where to save my data, for devs!
 
IBM File Net P8
IBM File Net P8IBM File Net P8
IBM File Net P8
 
SQL Server 2014 Monitoring and Profiling
SQL Server 2014 Monitoring and ProfilingSQL Server 2014 Monitoring and Profiling
SQL Server 2014 Monitoring and Profiling
 
What are you waiting for
What are you waiting forWhat are you waiting for
What are you waiting for
 
Ruote: A Ruby workflow engine
Ruote:  A Ruby workflow engineRuote:  A Ruby workflow engine
Ruote: A Ruby workflow engine
 
Geek Sync I Learn to Troubleshoot Query Performance in Analysis Services
Geek Sync I Learn to Troubleshoot Query Performance in Analysis ServicesGeek Sync I Learn to Troubleshoot Query Performance in Analysis Services
Geek Sync I Learn to Troubleshoot Query Performance in Analysis Services
 
4 the 3rd party libraries
4 the 3rd party libraries4 the 3rd party libraries
4 the 3rd party libraries
 
Utilizing the OpenNTF Domino API
Utilizing the OpenNTF Domino APIUtilizing the OpenNTF Domino API
Utilizing the OpenNTF Domino API
 
Deep Dive into Azure Data Factory v2
Deep Dive into Azure Data Factory v2Deep Dive into Azure Data Factory v2
Deep Dive into Azure Data Factory v2
 
Practical examples of using extended events
Practical examples of using extended eventsPractical examples of using extended events
Practical examples of using extended events
 
Sage 300 ERP: Technical Tour of Diagnostic Tools
Sage 300 ERP: Technical Tour of Diagnostic ToolsSage 300 ERP: Technical Tour of Diagnostic Tools
Sage 300 ERP: Technical Tour of Diagnostic Tools
 
Utilizing the open ntf domino api
Utilizing the open ntf domino apiUtilizing the open ntf domino api
Utilizing the open ntf domino api
 
Remote DBA Experts SQL Server 2008 New Features
Remote DBA Experts SQL Server 2008 New FeaturesRemote DBA Experts SQL Server 2008 New Features
Remote DBA Experts SQL Server 2008 New Features
 
Micro strategy 7i
Micro strategy 7iMicro strategy 7i
Micro strategy 7i
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disqus
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi Vončina
 
Soa workflow
Soa workflowSoa workflow
Soa workflow
 
The art of the event streaming application: streams, stream processors and sc...
The art of the event streaming application: streams, stream processors and sc...The art of the event streaming application: streams, stream processors and sc...
The art of the event streaming application: streams, stream processors and sc...
 

Dernier

Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 

Dernier (20)

Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 

Activiti bpm

  • 1. Activiti BPM Activiti BPM Database Reporting and Analytics
  • 2. Agenda • Over view of BPM • Over view of Activiti BPM • Activiti BPM Database • Activiti BPM Reporting • Analytics using Activiti BPM Database
  • 3. What is Business Process and Business Process Management • Business Process: • A business process is an activity or set of activities that will accomplish a specific organizational goal. • Business process management (BPM) is a systematic approach to improving those processes. • Business Process Management: • Business process management (BPM) is a systematic approach to making an organization's workflow more effective, more efficient and more capable of adapting to an ever-changing environment.
  • 4. Few important terms • BPMN(Business Process Modelling Notation): • BPMN is a method of illustrating business processes in the form of a diagram similar to a flowchart. • Can be divided into 2 parts: • Tasks: represented as rectangular shape. • Events: represented as circular shape. • Gateways: represented as diamond shape. • Connecting objects: represented as arrow shape. • Swimlanes: represented as path shape. Tasks Events Gate way Swimlanes
  • 5. Few important terms • BPD (Business Process Discovery): • Business process discovery, also called process discovery, is a collection of tools and techniques used to define, map and analyse an organization’s existing business processes. • It’s a initial step of BPM. • Mostly used for BI(Business Intelligence) and BA(Business Analytics). • We can say it as a way of creating Business Process Diagram logically using BPMN. • BPEL (Business Process Execution Language) • BPEL is an XML-based language that enables task-sharing in a distributed computing or grid computing environment.
  • 7. Activiti BPM • Activiti is a light-weight workflow and Business Process Management (BPM) Platform targeted at business people, developers and system admins. • Its core is a super-fast and rock-solid BPMN 2 process engine for Java. It's open-source and distributed under the Apache license. • Activiti runs in any Java application, on a server, on a cluster or in the cloud. • It integrates perfectly with Spring, it is extremely lightweight and based on simple concepts.
  • 9. Activiti Database • Activiti database is a repository which includes all process, tasks, events and process variables related data, which is used to maintain different Business Processes and to create their statistics. • Its stores static information, runtime data, identity, history and general data.
  • 10. Supporting Databases • Activiti supports different databases.
  • 11. Database Configuration • Define the JDBC properties of the database: • jdbcUrl: JDBC URL of the database. • jdbcDriver: implementation of the driver for the specific database type. • jdbcUsername: username to connect to the database. • jdbcPassword: password to connect to the database. • The following attributes can optionally be set to tweak that connection pool (taken from the MyBatis documentation): • jdbcMaxActiveConnections: The number of active connections that the connection pool at maximum at any time can contain. Default is 10. • jdbcMaxIdleConnections: The number of idle connections that the connection pool at maximum at any time can contain. • jdbcMaxCheckoutTime: The amount of time in milliseconds a connection can be 'checked out' from the connection pool before it is forcefully returned. Default is 20000 (20 seconds). • jdbcMaxWaitTime: This is a low level setting that gives the pool a chance to print a log status and re-attempt the acquisition of a connection in the case that it’s taking unusually long (to avoid failing silently forever if the pool is misconfigured) Default is 20000 (20 seconds). • databaseSchemaUpdate: true/false/create-drop
  • 12. Database table names explained • The database names of Activiti all start with ACT_. • ACT_RE_*: 'RE' stands for repository. Tables with this prefix contain 'static' information such as process definitions and process resources(images, rules, etc.). • ACT_RU_*: 'RU' stands for runtime. These are the runtime tables, that contain the runtime data of process instances, user tasks, variables, jobs, etc. Activiti only stores the runtime data during process instance execution, and removes the records when a process instance ends. This keeps the runtime tables small and fast. • ACT_ID_*: 'ID' stands for identity. These tables contain identity information, such as users, groups, etc.
  • 13. Database table names explained • ACT_HI_*: 'HI' stands for history. These are the tables that contain historic data, such as past process instances, variables, tasks, etc. • ACT_GE_*: ‘GE' stands for general data, which is used in various use cases.
  • 14. History • Activiti Database contains all process instance related details. • There are 5 history entities: • HistoricProcessInstances containing information about current and past process instances. • HistoricVariableInstances containing the latest value of a process variable or task variable. • HistoricActivityInstances containing information about a single execution of an activity (node in the process). • HistoricTaskInstances containing information about current and past (completed and deleted) task instances. • HistoricDetails containing various kinds of information related to either a historic process instances, an activity instance or a task instance.
  • 15. Query History • Activiti has provided Java API’s for querying history from Activiti database. • These API’s are known as Query API’s. • Methods to expose all 5 history entities: • HistoricProcessInstances: createHistoricProcessInstanceQuery() • HistoricVariableInstances: createHistoricVariableInstanceQuery() • HistoricActivityInstances: createHistoricActivityInstanceQuery() • HistoricDetails: createHistoricDetailQuery() • HistoricTaskInstances: createHistoricTaskInstanceQuery()
  • 16. Query History Examples • Historic Process Instance Query: • Get 10 HistoricProcessInstances that are finished and which took the most time to complete (the longest duration) of all finished processes with definition ‘XXX‘: historyService.createHistoricProcessInstanceQuery() .finished() .processDefinitionId(“XXX") .orderByProcessInstanceDuration().desc() .listPage(0, 10);
  • 17. Query History Examples • Historic Variable Instance Query: • Get all Historic Variable Instances from a finished process instance with id ‘XXX' ordered by variable name. historyService.createHistoricVariableInstanceQuery() .processInstanceId("XXX") .orderByVariableName.desc() .list();
  • 18. Query History Examples • Historic Activity Instance Query: • Get the last Historic Activity Instance of type 'serviceTask' that has been finished in any process that uses the process definition with id XXX. historyService.createHistoricActivityInstanceQuery() .activityType("serviceTask") .processDefinitionId("XXX") .finished() .orderByHistoricActivityInstanceEndTime().desc() .listPage(0, 1);
  • 19. Query History Examples • Historic Detail Query: • Get all variable-updates that have been done in process with id ‘XXX’. • Its possible that a certain variable name has multiple Historic Variable Update entries, for each time the variable was updated in the process. historyService.createHistoricDetailQuery() .variableUpdates() .processInstanceId(“XXX") .orderByVariableName().asc() .list();
  • 20. Query History Examples • Historic Detail Query: • Gets all variable updates that were performed on the task with id “XXX". • This returns all Historic Variable Updates for variables that were set on the task (task local variables), and NOT on the process instance. historyService.createHistoricDetailQuery() .variableUpdates() .taskId(“XXX") .orderByVariableName().asc() .list()
  • 21. Query History Examples • Historic Detail Query: • Gets all form-properties that were submitted in any task or when starting the process with id “XXX". • Task local variables can be set using the TaskService or on a DelegateTask, inside TaskListener: historyService.createHistoricDetailQuery() .formProperties() .processInstanceId(“XXX") .orderByVariableName().asc() .list() taskService.setVariableLocal(“XXX", "myVariable", "Variable value"); OR public void notify(DelegateTask delegateTask) { delegateTask.setVariableLocal("myVariable", "Variable value"); }
  • 22. Query History Examples • Historic Task Instance Query: • Get 10 Historic Task Instances that are finished and which took the most time to complete (the longest duration) of all tasks. • Get Historic Task Instances that are deleted with a delete reason that contains "invalid", which were last assigned to user 'kermit'. historyService.createHistoricTaskInstanceQuery() .finished() .orderByHistoricTaskInstanceDuration().desc() .list Page(0, 10); historyService.createHistoricTaskInstanceQuery() .finished() .taskDeleteReasonLike("%invalid%") .taskAssignee("kermit") .listPage(0, 10);
  • 23. Reporting • Activiti explorer has 4 important tabs, from reporting is one of the tab. • Several advantages: • The process has straight access to the internals of the Activiti engine. It has direct access to the database used by the engine. • The job executor can be used as for any other process. This means that you can asynchronously generate the process or only execute certain steps asynchronously. It also means you can use timers, eg. to generate the report data on certain points in time. • Creating a new report can be done with known tools and known concepts. Also, no new concepts, services or applications are needed. Deploying or uploading a new report is the same as deploying a new process. • It allows to use the BPMN 2.0 constructs. This means that all things like parallel steps, do branching based on data or even request user input during the generation are possible out-of-the-box
  • 24. Reporting • How to generate reports in Activiti? • The process produces a variable called ‘reportData’ is created. • This variable must be a byte array representation of a json object. • This variable is stored in the history tables of Activiti so it can be retrieved later when the report is saved.
  • 25. Reporting • Reporting JSON structure: • title: this is the general title for the whole report • datasets: this is an array of datasets corresponding with the different charts and lists on the report. • type: Each dataset has a type. This type will be used to determine how the data will be rendered. Currently supported values are: pieChart, lineChart, barChart and list. • description: each chart can have an optional description that will be shown in the report. • x- and y-axis: only usable for type lineChart. Optional parameter that determines the name of the axes of the chart • data: this is the actual data. The data is a json object with key-value elements. { "title": "My Report", "datasets": [ { "type" : "lineChart", "description" : "My first chart", "xaxis" : "Year" "yaxis" : "Total sales" "data" : { "2010" : 50, "2011" : 33, "2012" : 17, "2013" : 87, } } ] }
  • 26. Reporting Example • Generate Reports between all process instances and process instances of different process definitions <?xml version="1.0" encoding="UTF-8"?><definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="activiti-report"> <process id="process-instance-overview-report" name="Process Instance Overview" isExecutable="true"> <startEvent id="startevent1" name="Start" /> <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="generateDataset" /> <scriptTask id="generateDataset" name="Execute script" scriptFormat="JavaScript" activiti:autoStoreVariables="false"> <script> <!– write your java script code here  </script> </scriptTask> <sequenceFlow id="flow3" sourceRef="generateDataset" targetRef="theEnd" /><endEvent id="theEnd" /> </process> </definitions>
  • 27. Reporting Example • JavaScript code: importPackage(java.sql); importPackage(java.lang); importPackage(org.activiti.explorer.reporting); var result = ReportingUtil.executeSelectSqlQuery("SELECT PD.NAME_, PD.VERSION_ , count(*) FROM ACT_HI_PROCINST PI inner join ACT_RE_PROCDEF PD on PI.PROC_DEF_ID_ = PD.ID_ group by PROC_DEF_ID_"); var reportData = new ReportData; var dataset = reportData.newDataset(); dataset.type = "pieChart"; dataset.description = "Process instance overview (" + new java.util.Date() + ")“; while (result.next()) { // process results one row at a time var name = result.getString(1); var version = result.getLong(2); var count = result.getLong(3); dataset.add(name + " (v" + version + ")", count); } execution.setVariable("reportData", reportData.toBytes());
  • 29. Reporting Example • Pie Chart type output:
  • 30. Activiti BPM Database and Analytics • Analytics is a technology and field that helps any organization in decision making and enhancing their business in more profitable and more predictive way, by using their own huge data. • Most of the organization analysis their business mostly in terms of cost and time. • Activiti has their own database where it maintains each every task and process related data, so we can say somehow its possible to do analytics on it.
  • 31. Activiti BPM Database and Analytics • Analytics can be of 2 types on Activiti database: • Process Analytics • Data Analytics • Demo on Process Analytics using Disco (Fluxicon).
  • 32. Activiti BPM Database and Analytics Example • Here will take an example of Travel Domain. • Most time taking tasks. • Most costly and cost efficient tasks. • Total cost of travels per quarter on company v/s cost per BU per quarter v/s cost per BU per account per quarter v/s cost per BU per account per project per quarter (v/s total cost revenue generated by company in that quarter) Company revenue per account per project v/s expenditure on travel per quarter