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

MongoDB (Advanced)
MongoDB (Advanced)MongoDB (Advanced)
MongoDB (Advanced)
TO THE NEW | Technology
 
Lille2010markp
Lille2010markpLille2010markp
Lille2010markp
Ch'ti JUG
 

Tendances (20)

MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?
MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?
MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?
 
Elastic Search (엘라스틱서치) 입문
Elastic Search (엘라스틱서치) 입문Elastic Search (엘라스틱서치) 입문
Elastic Search (엘라스틱서치) 입문
 
RxJS - The Basics & The Future
RxJS - The Basics & The FutureRxJS - The Basics & The Future
RxJS - The Basics & The Future
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
[Spring Camp 2018] 11번가 Spring Cloud 기반 MSA로의 전환 : 지난 1년간의 이야기
[Spring Camp 2018] 11번가 Spring Cloud 기반 MSA로의 전환 : 지난 1년간의 이야기[Spring Camp 2018] 11번가 Spring Cloud 기반 MSA로의 전환 : 지난 1년간의 이야기
[Spring Camp 2018] 11번가 Spring Cloud 기반 MSA로의 전환 : 지난 1년간의 이야기
 
Rich domain model
Rich domain modelRich domain model
Rich domain model
 
Kotlin coroutines 톺아보기
Kotlin coroutines 톺아보기Kotlin coroutines 톺아보기
Kotlin coroutines 톺아보기
 
Kogito: cloud native business automation
Kogito: cloud native business automationKogito: cloud native business automation
Kogito: cloud native business automation
 
MongoDB (Advanced)
MongoDB (Advanced)MongoDB (Advanced)
MongoDB (Advanced)
 
FHIR REST API 導論與使用
FHIR REST API 導論與使用FHIR REST API 導論與使用
FHIR REST API 導論與使用
 
QA Fest 2019. Андрей Солнцев. Selenide для профи
QA Fest 2019. Андрей Солнцев. Selenide для профиQA Fest 2019. Андрей Солнцев. Selenide для профи
QA Fest 2019. Андрей Солнцев. Selenide для профи
 
Developing RESTful Web APIs with Python, Flask and MongoDB
Developing RESTful Web APIs with Python, Flask and MongoDBDeveloping RESTful Web APIs with Python, Flask and MongoDB
Developing RESTful Web APIs with Python, Flask and MongoDB
 
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
 
Django Girls Tutorial
Django Girls TutorialDjango Girls Tutorial
Django Girls Tutorial
 
Hibernate presentation
Hibernate presentationHibernate presentation
Hibernate presentation
 
[AIS 2018] [Team Tools_Advanced] Confluence 100배 활용하기 - 커브
[AIS 2018] [Team Tools_Advanced] Confluence 100배 활용하기 - 커브[AIS 2018] [Team Tools_Advanced] Confluence 100배 활용하기 - 커브
[AIS 2018] [Team Tools_Advanced] Confluence 100배 활용하기 - 커브
 
Lille2010markp
Lille2010markpLille2010markp
Lille2010markp
 
Uber Cadence Fault Tolerant Actor Framework
Uber Cadence Fault Tolerant Actor FrameworkUber Cadence Fault Tolerant Actor Framework
Uber Cadence Fault Tolerant Actor Framework
 
Introduction to Grails
Introduction to GrailsIntroduction to Grails
Introduction to Grails
 
Ksug2015 - JPA3, JPA 내부구조
Ksug2015 - JPA3, JPA 내부구조Ksug2015 - JPA3, JPA 내부구조
Ksug2015 - JPA3, JPA 내부구조
 

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 Activiti
Joram Barrez
 
What are you waiting for
What are you waiting forWhat are you waiting for
What are you waiting for
Jason Strate
 
Kafka summit SF 2019 - the art of the event-streaming app
Kafka summit SF 2019 - the art of the event-streaming appKafka summit SF 2019 - the art of the event-streaming app
Kafka summit SF 2019 - the art of the event-streaming app
Neil Avery
 

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
 
Kafka summit SF 2019 - the art of the event-streaming app
Kafka summit SF 2019 - the art of the event-streaming appKafka summit SF 2019 - the art of the event-streaming app
Kafka summit SF 2019 - the art of the event-streaming app
 

Dernier

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

Dernier (20)

Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
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 🔝✔️✔️
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
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-...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 

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