Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Activiti Explorer

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "how to use Activiti Explorer". In daily operation, I believe many people have doubts about how to use Activiti Explorer. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to use Activiti Explorer"! Next, please follow the editor to study!

Introduction to Activiti Explorer

Activiti Explorer: Activiti console, which is a web application

When downloading Activiti's compressed zip file from Activiti's official website, the Activiti console is under the ${Activiti_home} / wars folder

The purpose of the console is not to create a complete web application, but only for client users. For the console, an in-memory database is used, or it can be converted to a custom database (see the applicationContext.xml file under the WEB-INF folder)

Log in to the console and have four main functional modules:

Manage users and groups

Execute and view stopped jobs

View the database and deploy new process definitions

The logged-in user will not be displayed until the user has Super Admin privileges

If you are the task executor, you can see the to-do tasks of the running process instance, or you can pick up group tasks

The functions involved in the console include sub-task work, people with different roles.

The console allows you to create a separate task that does not need to be associated with any process instance

Tasks: task management function

Processes: displays a list of deployed process definitions and can start a new process instance

Reports: generate reports and display the result data of previously saved history

Manage: a process engine for managing Activiti

Flow chart

The console contains functions that automatically generate a flow chart using the Rapha ë lJavascript framework:

The flowchart can be generated only when the process defines the BPMN injection information contained in the XML.

When there is no BPMN injection in the process definition XML, but a flowchart is included at the time of deployment, the picture will also be displayed

If you do not want to use Javascript to generate the flowchart, you can disable it in the ui.properties file

Activiti.ui.jsdiagram = false

The flow chart is displayed on the console, or you can view the flow chart. According to the ID of the process definition, the process definition picture is displayed:

Http://localhost:8080/activiti-explorer/diagram-viewer/index.html?processDefinitionId=reviewSaledLead:1:36

Through the request parameters of processInstanceId, you can display the status of the current process instance:

Http://localhost:8080/activiti-explorer/diagram-viewer/index.html?processDefinitionId=reviewSaledLead:1:36&processInstanceId=41Tasks

Task

Inbox: displays a list of all the tasks that the logged-in user needs to do

My Tasks: displays the task list of the owner of the logged-in user task:

When you create a stand-alone task, you can automate it

Queued: displays a list of unused group tasks, and the logged-in user is in the group:

All tasks here must be picked up before they can be completed.

Involved: displays the tasks in which the logged-in user is involved, that is, not the executor and the task owner

Archived: archive, containing completed historical tasks

ProcessesDeployed process definitions (deployment process definition)

In the process definition tab, allow you to view all process definitions deployed by the Activiti process engine

You can start a new process instance using the button on the right at the top of the page

If the process definition has a startup form, the form is displayed before starting the process instance

My instances (my process example)

Displays all process instances of user tasks that have not been completed by the currently logged in user

Visually display the current activity of the process instance and the stored process variables

Manage

In the administrative feature, this feature is displayed only if the logged-in user is a member of the permission group admin

When you click the Manage icon button:

Database

Database: database. Display the content related to Activiti. It is very useful when developing processes or troubleshooting problems.

Deployments

Deployments: deployment. Displays the currently deployed process engine, and you can see the contents of the deployment: process definitions, flowcharts, business rules, and so on.

When you click the deploy button, you can upload the new deployment:

Select a business document or an BPMN20.XML file from your computer

Simply drag and drop to the specified area to deploy a new business process

Jobs

Jobs: job

Display the current job (timer, etc.) on the left and run manual execution (such as triggering a timer before the deadline)

If the job execution fails (for example, the mail server does not work properly), then all exceptions are displayed

Users

Users: managing users

Create, modify and delete users. Associated user

Get permission to view task assignment specific user information

Groups

Groups: management group

Create, modify, and delete groups, associate groups

Get permission to view tasks, assign specific groups and other information

Reports

Report:

Note: if you want the report to work, the console needs configuration history at a level that cannot be none. The default configuration meets the requirements

There are 2 subtabs of the report tab:

Display a list of all previously saved reports

Only the reports saved by individuals are displayed, and the reports saved by others cannot be seen.

Displays a list of known reports in the system

Allow you to run the generated report

Generate a report:

Save the report:

The data of the process is used to generate lists and icons in the report. Advantages of using the process to generate report data:

It means that all things, such as parallel gateways, can generate branches based on data or user request input.

No new concepts, services or applications are needed

Deploying or uploading a new report is the same as deploying a new process

Ability to generate processes asynchronously

Only perform certain steps asynchronously

You can use timers to generate report data at certain points in time

You can access the database directly using the process engine

The process has direct access to the interior of the Activiti process engine:

The job executor can be used for any other process:

You can create a new report with known tools and concepts:

You can use the BPMN2.0 structure:

The process definition for generating report data requires that activiti-report be set to classification so that it can be displayed in the report list of Explorer.

The only requirement for being able to see the report is:

The process creates a process variable named reportData, which must be a binary array of json objects

Variables must be saved to the history table of Activiti, so the engine is required to enable the history feature

So you can get it later when the report is saved

ReportData

The report process must generate a variable reportData as the JSON data to be presented to the user:

{"title": "My Report", "datasets": [{"type": "lineChart", "description": "My first chart", "xaxis": "Year", "yaxis": "Total sales"data": {"2010": 50, "2011": 33, "2012": 17, "2013": 87 }}]}

Json data is obtained in Explorer and used to generate charts or lists

The elements of json are:

PieChart

LineChart

BarChart

List

Title: the title of the report

Datasets: an array of datasets that correspond to different charts and lists in a report

Type: the type of dataset. This type is used to determine how the data is rendered and the supported values:

Description: each chart displays a description in the report, which is optional

Xaxis: works only on the lineChart type. This parameter is optional and is used to change the name of the x-axis of the chart coordinate system.

Yaxis: works only on the lineChart type. This parameter is optional and is used to change the name of the y-axis of the chart coordinate system.

Data: the actual data, which is a json object in key:value format

Process example

Process instance overview report:

Contains only one script task: generate json datasets using javascript

Although all the examples in Explorer use javascript, you can also use java service tasks

The final result of the execution process is the reportData variable, which holds the data

In addition to the standard xml at the top of the process xml, the main difference is that targetNamespace is set to activiti-report and the classification is set to the same name as the deployed process definition

This is a technical problem:

The size of the binary array is infinite, but the length of the string is limited.

This is why a javascript string must be converted to a java string to get the ability to convert to binary

The first line of the script is to do some imports to avoid writing the package name every time you use it.

The first meaningful code is to use ReportingUtil to read the activiti database. The returned result is a JDBC result set

Below the query statement, javascript creates a json.json that meets the requirements described above

For the last line of script, you first need to convert the json object to a string, using the javascript function JSON.stringify (). The string needs to be saved as a variable of the binary array type

The native json feature is not available. Here are some helper classes ReportData and Dataset:

Report start form

Reports are generated using a normal process, so the form function can also be used

Add a start form directly to the start event, and Explorer will show it to the user before generating the report

Render a normal form for the user:

Form properties are submitted when the process is started and can then be used like normal process variables. These process variables can be used in the script to generate data:

Var processDefinition = execution.getVariable ("processDefinition"); process example

The console contains 4 examples of reports:

Another example of using the start form

The corresponding variables are used to dynamically generate SQL query statements

Report instances that use multiple datasets

The report contains pie charts and list views that use the same data

Show that multiple datasets can be used to generate different charts on one page

Use pie chart to show

Combine the query results of two different databases

Report presentation using line chart and start form

The script for the report is more complex than other examples because the data is interpreted in the script and then saved to the report data.

Employee productivity (employee productivity):

Helpdesk (front line and upgrade):

Process instance overview (Overview of process examples):

Task duration (Task duration):

Modify the database

To modify the database used by the console example:

Tomcat shared class library

In apps/apache-tomcat-6.x/webapps/activiti-explorer/WEB-INF/lib/

Change the properties file: apps/apache-tomcat-6.x/webapps/activiti-explorer/WEB-INF/classes/db.properties

Appropriate database drivers on the classpath:

At this point, the study on "how to use Activiti Explorer" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report