jBPM and Drools Introduction

jBPM and Drools Introduction


BPMN Introduction[edit]

BPMN Basics[edit]

Flow Objects

  • Element start event.png Events (Circles)
  • Element activity.png Activities (Roundtangles)
  • Element gateway.png Gateways (Diamonds)

Swimlanes

  • Element pool.png Pools
  • Element lane.png Lanes

Connecting Objects

  • Element sequence flow.pngSequence Flows
  • Element message flow.pngMessage Flows
  • Element association.pngAssociations
  • Element association.pngData Associations

Artifacts (used to provide additional information about the Process)

  • Element group.png Group
  • Text annotations.png Text Annotation

Event Basics[edit]

EventsBasics.png

An Event is something that “happens” during the course of a Process.
  • Events affect the flow of the Process and usually have a cause or an impact. The term “event” is general enough to cover many things in a Process.
  • The start of an Activity, the end of an Activity, the change of state of a document, a Message that arrives, etc., all could be considered Events

Gateways[edit]

Figure10-103-different-types-of-gateways.png

Gateways are used to control splitting and merging of sequence flows.

  • do not represent ‘work’ being done
  • are considered to have zero effect on the operational measures of the process (cost, time, etc.).
  • two types of gateways: converge and diverge
  • type of gateway determines type of behaviour for both, the diverging and converging Sequence Flow
  • are optional

Types of Tasks[edit]

BPMNTypesOfTasks.png

JBPM 6 - 0.0 - jBPM Overview[edit]

jBPM General Info[edit]

  • jBPM is a BPMS (Business Process Management Suite) written in Java
jBPM是一个用Java写的业务流程管理系统
  • It allows you to design, model, execute, and monitor business processes throughout their life cycle.
jBPM让你可以在业务流程生命周期里:设计,建模,执行和监视业务流程
  • Contains Drools - BRMS
包括Drools - BRMS (业务规则管理系统)集成
  • jBPM, released by JBOSS (Red Hat boght JBOSS)
jBPM是由 Red Hat Inc. 发布的(Red Hat 收购了 JBOSS Inc.)
  • Open Source and Commercial
有两个版本,开源和商业版

BPMN[edit]

BPMN name and standard。[edit]

  • In Version 1.x BPMN stands for Business Process Modelling Notation
BPMN 1.版本是业务流程建模标记法
  • Since Version 2.x BPMN stands for Business Process Model and Notation
BPMN 2.x版本是业务流程模型和标记法

BPMN 2.0 Purpose。[edit]

  • Provide a notation that is readily understandable by business and technical people
为业务和技术人员提供了一个容易理解的语言
  • Create a standardised bridge for the gap between the business process design and process implementation
在业务流程的设计和实现之间搭建了一个标准化的桥梁
  • To standardise a business process model and notation in the face of many different modelling notations and viewpoints
业务流程建模标记法
  • To provide a means of communicating process information to other businesses, users, managers and process implementers
为其他的业务,用户,经理和过程的实现人提供了一种沟通过程信息的手段
  • To exchange BPMN definitions (both domain model and diagram layout) between different tools
在不同的工具之间交换BPMN的定义(域模型和框图布局)

Audience of BPMN|BPMN的用户。[edit]

  • Business users 业务用户
    • Business analysts 业务分析员
    • Strategy analyst 策略分析员
    • Quality managers 质量管理员
  • Technical developers 技术开发人员
    • Process designers 流程设计员
    • Developers 开发人员
    • Integrators 集成人员
    • Software, System and Enterprise Architects 软件,系统和企业架构人员

BPMN Conformance|BPMN标准一致性。[edit]

Software  based on spec 软件基于BPMN标准
  • software tool developed only partially matching compliance/conformance
如果软件工具(BPMNS)与部分标准一致,这叫做 基于BPMN标准
Modeling Conformance
建模标准一致性
  • Process modeling 流程建模
  • Choreography modelling Choreography建模一致性
Execution Conformance 执行标准一致性
  • Process Execution 过程的执行
  • BPEL Process Execution
A tool can comply to one of the above or any subset of them.
工具可以符合上面的标准的任何部分
BPMN Complete Conformance complies to the all 4 above.
BPMN完全标准一致符合以上全部四个标准
jBPM  is based on BPMN 2.0, but doesn't conform to BPMN standard
jBPM是基于BPMN2.0标准,但是她不符合BPMN的标准

Sub-models within an end-to-end BPMN model 。[edit]

  1. Processes (Orchestration)
    • Private non-executable (internal) BP
    • Private executable (internal) BP <- jBPM
    • Public Processes
  2. Choreographies
  3. Collaborations (can include Processes and Choreographies
    • Conversations

jBPM components[edit]

ClipCapIt-140916-144554.PNG

BPM tools[edit]

ClipCapIt-150824-145749.PNG

JBPM 6 - 1.0 - Workbench Overview[edit]

Starting jBPM console[edit]

cd /opt/jbpm-installer
ant start.demo

or

ant start.demo.noeclipse

Go to Firefox and type: http://localhost:8080/jbpm-console

Hello World Demo[edit]

Evaluation Demo 评估的演示[edit]

  • An employee performance needs to be evaluated
员工绩效评估
  • First, the employee gives feedback about their own performance
首先员工自我评估
  • Later, HR (mary) and PM (john) departments give their opinion about employee department
然后人事(marry)和项目经理(john)部门评估
  • It does not matter whether HR or PM evaluation is done first
marry和john的评估顺序无所谓

Evaluation.png

Lab 1.1.1 Executing Process in Kie[edit]

  1. localhost:8080/jbpm-console
  2. login krisv/krisv
  3. Build Project
    1. Got to Authoring/Project Autorining
    2. In Project Explorer select demo / jbpm-playground / Evaluation project
    3. Click BUSINESS PROCESSES / 'evaluation' process to view the diagram
    4. Click Open Project Editor / Build & Deploy
  4. Start an Process Instance
    1. Process Management / Process Definitions
    2. Actions / Start
    3. Employee: krisv (must be this user)
    4. Reason: evaluation
  5. Perform Self-Evaluation
    1. Task List / Actions / Start
    2. Performance: "I am excellent"
  6. HR Evaluation
    1. Log in as mary
    2. Tasks / Actions / Start
    3. Click on Magnifying Glass icon / Work tab / Complete
  7. PM Evaluation
    1. Log in as john
    2. Task / Actions / Start
    3. Click on Magnifying Glass icon / Work tab / Complete
  8. View Log
    1. Process Management / Process Instances / Completed
    2. Actions / Details

Exercise 1[edit]

  • Run another instance of the process on your own

JBPM 6 - 1.1 - Creating Simple Process 创建简单流程[edit]

Scenario 场景[edit]

  • We are going to recruit people
我们要招人
  • At first the company is small, so it involves only interviewing people over the phone
起初公司规模小,所以只需要电话面试即可
  • Later more things to the process will be added
以后会有更多的东西加入流程里
  • We will use this example over the most of the materials
我们将在大部分教材中使用这个例子

Hrproj.employee recruitment.png

Creating Organization Unit, repository, project and package 创建组织单元、库、项目和包[edit]

Jbpm orgaizing konwoledge.png

  1. Creating Organizational Unit
    1. Log in as krisv
    2. Authoring/Administration
    3. Organization Units/Manage Organization Units/Add
    4. Name: npou / Owner: NobleProg Ltd
  2. Creating Repository
    1. Authoring/Administration
    2. Repositories/New Repository
    3. Repository Name: nprep/Organizational Unit: npou
  3. Creating Project
    1. Authoring/ Project Authoring
    2. Switch to npou/nprep
    3. New Item/Project
    4. Resource Name: npproj1
    5. Group ID: nppack

Creating Simple Process[edit]

  1. Creating simple diagram
    1. Authoring/Project Authoring
    2. New Item/Business Process/Name: emp_recruitment1
    3. Create User Task, set
    4. Name HT Phone Interview
    5. Task Name to HT Phone Interview
    6. Actor: krisv
    7. Validate the process
    8. Save, check in with "Added Phone Interview Task" message

Deploying and Executing[edit]

  1. Deploy the process
    1. Open Project Editor 
      ClipCapIt-150813-131445.PNG
    2. Project Editor/Build & Deploy 
      JBPM Build&Deploy.png
    3. Process Management/Process Definitions
    4. Actions/Start
  2. Check whether Instance is running
    1. Process Management/Process Instances
  3. Performing a task
    1. Tasks/Task List
    2. Actions/Start
    3. Details / Work / Complete
  4. Check the Instance
    1. Process Management / Process Instances / Completed
    2. View Instance log of the task

Optional Browsing Database for completed instances and tasks[edit]

  1. Download SQL Workbench
  2. Login to /home/installuser/jbpm-db (username sa, no password)
  3. select * from taskevent;

JBPM 6 - 1.2 - Process Variables 过程变量[edit]

Scenario 场景[edit]

  • We would like to record the name of the person we are interviewing and the outcome of the interview.
我们想记录我们面试的人的名字和面试的结果

Instructions 步骤[edit]

  1. Copy emp_recruitment1 to emp_recruitment2
    Top Right Corner, click Copy
  2. Change the Process Name and ID accordingly
    JBMPProcessIDandName.png
  3. Create process variable pv_candidate_name (Properties/Variable Definitions)
  4. Generate forms 
    JBPMNGenerateAllForms.png
  5. Check in Project Explorer under FORM DEFINITIONS that the forms has been properly generated
  6. Deploy
  7. Start new process instance
  8. Perform a task
  9. Check in Completed instances (Process Management/Process Instances/Completed/Actions/Details) the value of the variable 
    JBPMProcessVariables.png

Exercise 1.2.1[edit]

  • Add pv_candidate_suitable:Boolean variable and generate forms for it

JBPM 6 - 1.3 - InputSets and OutputSets[edit]

InputDataSets Instructions[edit]

  1. Copy emp_recruitment2 to emp_recruitment3
  2. Change the Process Name and ID accordingly
  3. In the Phone Interview task, add DataInputSet ut_candidate_name
  4. In assignments, map pv_candidate_name to ut_candidate_name
  5. Generate forms
  6. Deploy
  7. Start new process, input Albert as the candidate name
  8. Perform a task, change the ut_candidate_name field value before complete a task to AlbertModifiedInUserTask
  9. Check in Completed instances the value of the variable

OutputDataSets Innstructions[edit]

Hrproj.employee recruitment.png

  1. Create DataOutputSet in Phone Interview task name ut_candidate_suitable:Boolean
  2. In Assignments, map ut_candidate_suitable to pv_candidate_suitable
  3. Generate all forms (remove old forms before)
  4. Edit process form (npproj.emp_recruitment3-taskform) and remove pv_candidate_suitable field
  5. Save and Deploy
  6. Execute the process
  7. When performing the task, tick the "candidate_suitable" field
  8. After completing the task, go to completed instances and view the process variables and process model.

Exclusive Gateway[edit]

Hrproj.emp recruitmen3.png

  • Modify process as shown on the diagram above
  • Add constraint to the appropriate sequence flows:
  • to Hired end:
return pv_candidate_suitable;
  • to Not Hired end:
return pv_candidate_suitable == false;
  • Run process twice selecting different option in ut_candidate_suitable check-box
  • In completed instances check whether the variable got different values

JBPM 6 - 1.4 - Actors and Groups[edit]

You will learn 你将学到[edit]

  • How to create a new user
如何建立用户
  • How to create a new group
如何建立组
  • How to assign task to a user
如何分配任务给一个用户
  • How a user can claim and release tasks assign to a group
如何一个用户可以领取和释放分配给组的任务

Scenario 场景[edit]

  • NobleProg is growing and now more people will perform the tasks.
诺波在发展并且更多的人将做这个任务
  • We will create np_hr_role with two people: isabel and greg
我们将建立一个np_hr_role,其中包含两个人:isabel 和 greg
  • We will also create np_manager_role with one person: bernard
我们还将建立np_manager_role,其中只有一个人:bernard
  • Manager will be responsible for face to face interview
经理将负责面对面的面试

Creating users instructions[edit]

  1. Creating roles
    1. edit /opt/jbpm-installer/wildfly-8.1.0.Final/standalone/configuration/roles.properties and add following lines (please note that the admin role has been added in order to grant the users permission to Workbench)
bernard=np_manager_role,admin
isabel=np_hr_role,admin
greg=np_hr_role,admin
  1. Creating users
    1. edit /opt/jbpm-installer/wildfly-8.1.0.Final/standalone/configuration/users.properies and add folowing lines
isabel=isabel
greg=greg
bernard=bernard

Group Assignment[edit]

  1. Copy emp_recuritment3 to emp_recuritment4
  2. Change the Process Name and ID accordingly
  3. Edit Phone Interview task properties
  4. Remove Actor property
  5. In Group property type np_hr_role
  6. Deploy and start the process

Claiming task[edit]

  1. Log in as greg
  2. In Tasks you should see unlock padloc icon
  3. Log in as bernard
  4. You cannot claim the task because bernard is not np_hr_role

Face to Face interview[edit]

Npproj.emp recruitment4.png

  1. Add new user task as show in the digram
  2. Assign the np_manager_role to Face to Face interview user task
  3. Create pv_f2f_candidate_suitable:Boolean process variable
  4. Create ut_f2f_candidate_suitable:Boolean task DataOutputSet in Face to Face interview task
  5. Create appropriate assignments
  6. Generate task forms
  7. Create appropriate conditions on the second gateway sequence flows
  8. Execute and test the process

Lanes[edit]

Sometimes it is a good idea to show different group assignments in lanes

Npproj.emp recruitment4 2.png

JBPM 6 - 1.5 - BAM[edit]

Summary[edit]

  • How to find meaningful statistics related to process variables

JBPM BAM.png

Instructions[edit]

  1. Dahboards
  2. Business Dashboards
  3. Login in as krisv/krisv
  4. Administration -> Data Providers
  5. Check if jBPM Process Summary exists (go to Instances by process), if not create one
  6. Create new data provider
  7. Fill out the query and name as below:
Name: jBPM Process Summary, Type: SQL Query
Query:
       select processinstanceid,
       processname,
       status,
       start_date,
       end_date,
       user_identity,
       processversion,
       duration
       from processinstancelog

Instances by process[edit]

  1. Change workspace to jBPM Dashboard
ProcessDashboard.png

Report based on custom variables[edit]

Browse database structure

cd /opt/jbpm-installer
ant stop.demo
cd /opt/jbpm-installer/db/driver 
java -jar h2.jar

Change database to jbpm or other location where it is (JDBC URL)

JDBC URL: jdbc:h2:~/jbpm

H2connection.png


Find VARIABLEINSTANCELOG Click on it and run

SELECT * FROM VARIABLEINSTANCELOG

Create Data Provider[edit]

  1. Dashboards / Business Dahsboards
  2. Workspace: Showcase
  3. Administration / Data Providers / Create new data provider
  4. Type: SQL Query
  5. Name: Process Variables
  6. Paste the query:
SELECT * FROM VARIABLEINSTANCELOG;

Create Page[edit]

  1. Page: Click on the "Create new page icon"
  2. Title: Process Variables Analysis
  3. Go to Workspace
  4. Choose Page: Process Variables Analysis
  5. Create new panel in current page
  6. Click on Key Performance Indicator
  7. Drag "Create Panel" to the CENTER_1 side area 
    BusinessDashboardKPI.png
  8. Choose Process Variables data source
    1. KIP's name: Variables
    2. Domain X Axis: value
    3. Rage (Y Axis): variableid
    4. Change type pie chart
BusinessDashboardChart.png

Create Filters[edit]

  1. Create new panel
  2. Filter & Drill-down
  3. Drag it to the left hand side
  4. Click on the cog and Edit Content
  5. Tick processid and variableid
BusinessDashboardFilter.png

The final view:

BusinessDashboardFinal.png.png

More Information[edit]

http://docs.jboss.org/jbpm/v6.0/userguide/chap-bam.html

JBPM 6 - 2.0.0 - Unit Testing Introduction 单元测试介绍[edit]

Unit testing 单元测试[edit]

  • Unit testing is a software testing method by which individual units of source code are tested to determine if they are fit for use
单元测试是一个软件测试方法,人们经过测试代码的独立单元,从而决定是否代码可以投入使用
  • Unit tests are short code fragments created by programmers or testers during the development process.
单元测试代码是开发过程中程序员或测试人员写的很短的代码片段
  • Unit testing provides a sort of living documentation of the system.
单元测试相当于提供了一套活着的系统文档

JUnit[edit]

  • JUnit is a unit testing framework for the Java programming language.
public class TestFoobar {

    @Test
    public void testOneThing() {
        // Code that tests one thing
    }
 
    @Test
    public void testAnotherThing() {
        // Code that tests another thing
    }

}

Assertion[edit]

  • An assertion is a true–false statement placed in a program to indicate that the developer thinks 'that the predicate is always true at that place.
  • If an assertion evaluates to false at run-time, an assertion failure results, which typically causes execution to abort.
x = 1;
assert (x > 0);
x++;
assert (x > 1);

Appendix[edit]

assert methods used in jBPM[edit]

assertNodeTriggered(processInstance.getId(),"Book Hotel");
assertNodeTriggered(processInstance.getId(), "StartProcess", "Hello", "EndProcess");
// checks whether the given node(s) was/were executed during the process execution

assertProcessInstanceActive(processInstanceId, ksession)
// checks whether the process instance is active

assertProcessInstanceCompleted(processInstanceId, ksession);
// checks whether the process instance has completed successfully

java operators[edit]

Simple Assignment Operator[edit]
=       Simple assignment operator
Arithmetic Operators[edit]
+       Additive operator (also used for String concatenation)
-       Subtraction operator
*       Multiplication operator
/       Division operator
%       Remainder operator
Equality and Relational Operators[edit]
==      equal to
!=      not equal to
>       greater than
>=      greater than or equal to
<       less than
<=      less than or equal to
!       logical complement operator; inverts the value of a boolean
Conditional Operators[edit]
&& Conditional-AND
|| Conditional-OR

JBPM 6 - 2.0.1 - Eclipse Overview[edit]

Sample jBPM Project[edit]

  • Start eclipse using ant
$ ant start.eclipse
  • Create new jBPM project, include sample project

Elipse00HelloWorld.png

ProcesTest.java file:

public class ProcessTest extends JbpmJUnitBaseTestCase {

	@Test
	public void testProcess() {
		RuntimeManager manager = createRuntimeManager("sample.bpmn");
		RuntimeEngine engine = getRuntimeEngine(null);
		KieSession ksession = engine.getKieSession();
		
		ProcessInstance processInstance = ksession.startProcess("com.sample.bpmn.hello");
		// check whether the process instance has completed successfully
		assertProcessInstanceCompleted(processInstance.getId(), ksession);
		assertNodeTriggered(processInstance.getId(), "Hello");
		
		manager.disposeRuntimeEngine(engine);
		manager.close();
	}

}

Sample.bpmn file:

Eclipse00HelloWorldSampleFile.png

  • Run the project (Menu: Run / Run or Ctrl-F11) and check Console and JUnit windows

More Advanced jBPM Project[edit]

Scenario: A salesman will get a bonus if his sales is over 1000.

BPMN file[edit]

  • Create new jBPM project (or open 04.1.2_exercise project)
  • Change diagram file name to Bonus.bpmn2

Eclipse00BonusStart.png

  • Add sales variable
    • Properties Window/Data Items/Variable List for Process/Add
  • Add conditions
    • sales>1000
    • else - default flow

Eclipse00BonusConditions.png

  • Define script tasks
    • Congratulation!
System.out.println("You are the best!");
  • Try harder!
System.out.println("Maybe next time.");

ProcessTest.java file[edit]

  • Write Unit Test - add code to ProcessTest class
  • Import Man and HashMap (import java.util.HashMap;, import java.util.Map;)
  • Run project and check what happens if sales is 20000. Is bonus assigned? Check JUnit Window.
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("sales", 20000);
        ProcessInstance processInstance = ksession.startProcess("com.sample.test", params);
        assertNodeTriggered(processInstance.getId(),"Bonus Assigned");
        assertProcessInstanceCompleted(processInstance.getId(), ksession);
  • The final code
public class ProcessTest extends JbpmJUnitBaseTestCase {

	@Test
	public void testProcess() throws Exception {
		createRuntimeManager("Bonus.bpmn2");
		RuntimeEngine engine = getRuntimeEngine(null);
		KieSession ksession = engine.getKieSession();
		

        Map<String, Object> params = new HashMap<String, Object>();
        params.put("sales", 20000);
        ProcessInstance processInstance = ksession.startProcess("com.sample.test", params);
        assertNodeTriggered(processInstance.getId(),"Bonus Assigned");
        assertProcessInstanceCompleted(processInstance.getId(), ksession);

	}
}
  • Add another test

Solution[edit]

/**
 * Copyright NobleProg Ltd
 * Author: Filip Stachecki (filip@nobleprog.pl)
 * more info: http://www.nobleprog.co.uk
 */
package com.nobleprog;

import java.util.HashMap;
import java.util.Map;

import org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler;
import org.jbpm.test.JbpmJUnitBaseTestCase;
import org.junit.Test;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.manager.RuntimeEngine;
import org.kie.api.runtime.process.ProcessInstance;
import org.kie.internal.KnowledgeBase;
import org.kie.internal.runtime.StatefulKnowledgeSession;

public class ProcessTest extends JbpmJUnitBaseTestCase {

	@Test
	public void testProcess() throws Exception {
		createRuntimeManager("Bonus.bpmn2");
		RuntimeEngine engine = getRuntimeEngine(null);
		KieSession ksession = engine.getKieSession();
		

        Map<String, Object> params = new HashMap<String, Object>();
        params.put("sales", 20000);
        ProcessInstance processInstance = ksession.startProcess("com.sample.test", params);
        assertNodeTriggered(processInstance.getId(),"Bonus Assigned");
        assertProcessInstanceCompleted(processInstance.getId(), ksession);

	}
	
	@Test
	public void testProcessNoBonus() throws Exception {
		createRuntimeManager("Bonus.bpmn2");
		RuntimeEngine engine = getRuntimeEngine(null);
		KieSession ksession = engine.getKieSession();
		

        Map<String, Object> params = new HashMap<String, Object>();
        params.put("sales", 500);
        ProcessInstance processInstance = ksession.startProcess("com.sample.test", params);
        assertNodeTriggered(processInstance.getId(),"No Bonus");
        assertProcessInstanceCompleted(processInstance.getId(), ksession);

	}
}

Exercises[edit]

  • 04.1_exclusive_gateway
    • 04.1.2_exercise
  • 04.2_inclusive_gateway
    • 04.2.1_exercise
  • Parallel gateway
    • 04.3_parallel_exercise
  • 05_timer_delay
  • 05.1_timer_delay
    • 05.1.1_exercise_timer_delay

JBPM 6 - 2.2 - User Task[edit]

public class ProcessTestEmpRec extends JbpmJUnitBaseTestCase {

	@Test
	public void testProcess() {
		RuntimeManager manager = createRuntimeManager("emp_recruitment1.bpmn2");
		RuntimeEngine engine = getRuntimeEngine(null);
		KieSession ksession = engine.getKieSession();
		TaskService taskService = engine.getTaskService();
		
		ProcessInstance processInstance = ksession.startProcess("hrproj.employee_recruitment");

		assertProcessInstanceActive(processInstance.getId(), ksession);
		
		// Executing PhoneInterview task
		List<TaskSummary> list = taskService.getTasksAssignedAsPotentialOwner("krisv", "en-UK");
		TaskSummary task = list.get(0);
		System.out.println("Kris is executing task " + task.getName());
		taskService.start(task.getId(), "krisv");
		taskService.complete(task.getId(), "krisv", null);
		
		assertNodeTriggered(processInstance.getId(), "PhoneInterview");

		assertProcessInstanceCompleted(processInstance.getId(), ksession);
		
		manager.disposeRuntimeEngine(engine);
		manager.close();
	}
	public ProcessTestEmpRec() {
		  super(true, true, "org.jbpm.persistence.jpa.updated");  
	}
}

Execise[edit]

  1. Write tests for emp_recuritment4 covering all possible paths

JBPM 6 - 2.3 - Debugging Processes[edit]

Breakpoints[edit]

  • current state of your running processes can be inspected and visualized during the execution.
  • currently breakpoints cannot be put on the nodes within a process directly
  • breakpoints can be put inside any Java code:
    • code that is invoking the engine
    • code invoked by the engine
    • listeners
    • rules (than part)

Debug views[edit]

  1. The process instances view
    1. shows all running process instances (and their state)
    2. shows the current state of a process instance
  2. The audit view
    1. shows the audit log
  3. The global data view
  4. Working memory view (facts)
  5. Agenda view (activated rules)

The process instances view[edit]

  1. Open 04_Debuging project
  2. Windows / Show View / Other / Drools / Process Instances
  3. Put a breakpoint after ksession.startProcess line
  4. Press F11 (Debug as JUnit Test)
  5. Switch to debug perspective
  6. In Variables window click on ksession
  7. In Process Instances windows, click on ksession insance
  8. Look at Process Instance windows to see where the process "hanged"

The process instance view and persistance

  • This kind of debuging will not work with pressistance
  • Please make sure you will turn persistance off by setting super(true,false)

Audit View[edit]

  • Open 04_Deubgging project
  • Run ProcessTestAudit.java
  • Open the Audit view
  • Open mylogfile file
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值