`

Activiti 5.6:流程活动自动与手工触发执行

 
阅读更多
Activiti 5.6支持流程活动自动执行与手工触发执行。其中,自动执行是指,在启动流程之前,准备流程所需要的控制流程进度的变量数据,启动流程之后,无需外部干预,就能够按照预定义的流程执行;手工触发执行是指,执行到流程中某个个结点后流程暂时停止运行,直到收到外部发送的信号以后,才会继续向前推进,这样情况可以更加精细地控制流程。

下面主要通过基于Activiti 5.6的<parallelGateway>、<serviceTask>、<receiveTask>、<userTask>元素来看一下。首先,我们在测试的过程中,用到JUnit 3.x,为了方便,这里给了一层封装,代码如下所示:
package org.shirdrn.workflow.activiti;

import junit.framework.TestCase;

import org.activiti.engine.FormService;
import org.activiti.engine.HistoryService;
import org.activiti.engine.IdentityService;
import org.activiti.engine.ManagementService;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;

public abstract class AbstractTest extends TestCase {

	private ProcessEngine processEngine;
	protected String deploymentId;
	protected RepositoryService repositoryService;
	protected RuntimeService runtimeService;
	protected TaskService taskService;
	protected FormService formService;
	protected HistoryService historyService;
	protected IdentityService identityService;
	protected ManagementService managementService;
	
	@Override
	protected void setUp() throws Exception {
		super.setUp();
		if(processEngine==null) {
			processEngine = ProcessEngines.getDefaultProcessEngine();
		}
		repositoryService = processEngine.getRepositoryService();
		runtimeService = processEngine.getRuntimeService();
		taskService = processEngine.getTaskService();
		formService = processEngine.getFormService();
		historyService = processEngine.getHistoryService();
		identityService = processEngine.getIdentityService();
		managementService = processEngine.getManagementService();
		initialize();
	}
	
	@Override
	protected void tearDown() throws Exception {
		super.tearDown();
		destroy();
	}
	
	protected abstract void initialize() throws Exception;
	
	protected abstract void destroy() throws Exception;
}


这里面,主要是在测试之前做一些初始化工作,主要包括流程引擎实例的构建,及其流程提供的基本服务。下面测试会用到该抽象类。
自动执行
<serviceTask>元素,可以实现自动活动,语法如下所示:
<serviceTask id="serviceTaskId" name="serviceTaskName"
activiti:class="org.shirdrn.workflow.activiti.gateway.ServiceTaskClass"/>
其中,activiti:class属性为该结点对应的处理类,该类要求实现org.activiti.engine.delegate.JavaDelegate接口,该接口定义如下所示:
package org.activiti.engine.delegate;

public interface JavaDelegate {
  
  void execute(DelegateExecution execution) throws Exception;

}

execute方法的参数DelegateExecution execution可以在流程中各个结点之间传递流程变量。
下面给出一个具体的例子:
自动执行的流程,如图所示:



对应的流程定义文件为GatewayTest.testAutomaticForkJoin.bpmn20.xml,如下所示:
<?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="http://www.activiti.org/test">
  <process id="AutomaticParalellBasedForkJoin" name="AutomaticParalellBasedForkJoin">
    <startEvent id="startevent7" name="Start"></startEvent>
    <parallelGateway id="parallelgateway12" name="Fork"></parallelGateway>
    <serviceTask id="servicetask3" name="Task 1" activiti:class="org.shirdrn.workflow.activiti.gateway.ServiceTask1"></serviceTask>
    <serviceTask id="servicetask4" name="Task 2" activiti:class="org.shirdrn.workflow.activiti.gateway.ServiceTask2"></serviceTask>
    <serviceTask id="servicetask5" name="Task 3" activiti:class="org.shirdrn.workflow.activiti.gateway.ServiceTask3"></serviceTask>
    <parallelGateway id="parallelgateway13" name="First Join"></parallelGateway>
    <serviceTask id="servicetask6" name="Task 4" activiti:class="org.shirdrn.workflow.activiti.gateway.ServiceTask4"></serviceTask>
    <parallelGateway id="parallelgateway14"></parallelGateway>
    <endEvent id="endevent7" name="End"></endEvent>
    <sequenceFlow id="flow45" name="" sourceRef="startevent7" targetRef="parallelgateway12"></sequenceFlow>
    <sequenceFlow id="flow46" name="" sourceRef="parallelgateway12" targetRef="servicetask3"></sequenceFlow>
    <sequenceFlow id="flow47" name="" sourceRef="parallelgateway12" targetRef="servicetask4"></sequenceFlow>
    <sequenceFlow id="flow48" name="" sourceRef="parallelgateway12" targetRef="servicetask5"></sequenceFlow>
    <sequenceFlow id="flow49" name="" sourceRef="servicetask3" targetRef="parallelgateway13"></sequenceFlow>
    <sequenceFlow id="flow50" name="" sourceRef="servicetask4" targetRef="parallelgateway13"></sequenceFlow>
    <sequenceFlow id="flow51" name="" sourceRef="servicetask5" targetRef="parallelgateway14"></sequenceFlow>
    <sequenceFlow id="flow52" name="" sourceRef="parallelgateway13" targetRef="servicetask6"></sequenceFlow>
    <sequenceFlow id="flow53" name="" sourceRef="servicetask6" targetRef="parallelgateway14"></sequenceFlow>
    <sequenceFlow id="flow54" name="" sourceRef="parallelgateway14" targetRef="endevent7"></sequenceFlow>
  </process>
</definitions>


上述流程定义中,一共定义了4个ServiceTask,模拟实现代码如下所示
Task1:
package org.shirdrn.workflow.activiti.gateway;

import java.util.logging.Logger;

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;

public class ServiceTask1 implements JavaDelegate {

	private final Logger log = Logger.getLogger(ServiceTask1.class.getName());

	@Override
	public void execute(DelegateExecution execution) throws Exception {
		Thread.sleep(10000);
		log.info("variavles=" + execution.getVariables());
		execution.setVariable("task1", "I am task 1");
		log.info("I am task 1.");		
	}
}


Task2:
package org.shirdrn.workflow.activiti.gateway;

import java.util.logging.Logger;

public class ServiceTask2 implements JavaDelegate {

	private final Logger log = Logger.getLogger(ServiceTask2.class.getName());

	@Override
	public void execute(DelegateExecution execution) throws Exception {
		Thread.sleep(10000);
		log.info("variavles=" + execution.getVariables());
		execution.setVariable("task2", "I am task 2");
		log.info("I am task 2.");
	}
}


Task3:
package org.shirdrn.workflow.activiti.gateway;

import java.util.logging.Logger;

public class ServiceTask3 implements JavaDelegate {

	private final Logger log = Logger.getLogger(ServiceTask3.class.getName());

	@Override
	public void execute(DelegateExecution execution) throws Exception {
		Thread.sleep(10000);
		log.info("variavles=" + execution.getVariables());
		execution.setVariable("task3", "I am task 3");
		log.info("I am task 3.");		
	}
}


Task4:
package org.shirdrn.workflow.activiti.gateway;

import java.util.logging.Logger;

public class ServiceTask4 implements JavaDelegate {

	private final Logger log = Logger.getLogger(ServiceTask4.class.getName());

	@Override
	public void execute(DelegateExecution execution) throws Exception {
		Thread.sleep(10000);
		log.info("variavles=" + execution.getVariables());
		execution.setVariable("task4", "I am task 4");
		log.info("I am task 4.");	
	}
}


测试代码,如下所示:
package org.shirdrn.workflow.activiti.gateway;

import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.test.Deployment;
import org.shirdrn.workflow.activiti.AbstractTest;

public class AutomaticParallelGatewayTest extends AbstractTest {

	private String deploymentId;
	
	@Override
	protected void initialize() throws Exception {
		deploymentId = repositoryService.createDeployment()
			.addClasspathResource("diagrams/GatewayTest.testAutomaticForkJoin.bpmn20.xml")
			.deploy().getId();
	}

	@Override
	protected void destroy() throws Exception {
		repositoryService.deleteDeployment(deploymentId, true);
	}
	
	@Deployment
	public void testForkJoin() {
		ProcessInstance pi = runtimeService.startProcessInstanceByKey("AutomaticParalellBasedForkJoin");
		assertEquals(true, pi.isEnded());
	}
}


只需要启动一个流程实例,它会自动执行到结束。这种情况下,你不需要关注流程的执行进度,而只需要把精力集中在每个结点的处理逻辑(通常是简单或者复杂的商业逻辑)上,运行结果如下所示:
Sep 21, 2011 10:41:04 AM com.workflow.activiti.gateway.ServiceTask1 execute
INFO: variavles={}
Sep 21, 2011 10:41:04 AM com.workflow.activiti.gateway.ServiceTask1 execute
INFO: I am task 1.
Sep 21, 2011 10:41:14 AM com.workflow.activiti.gateway.ServiceTask2 execute
INFO: variavles={task1=I am task 1}
Sep 21, 2011 10:41:14 AM com.workflow.activiti.gateway.ServiceTask2 execute
INFO: I am task 2.
Sep 21, 2011 10:41:24 AM com.workflow.activiti.gateway.ServiceTask4 execute
INFO: variavles={task1=I am task 1, task2=I am task 2}
Sep 21, 2011 10:41:24 AM com.workflow.activiti.gateway.ServiceTask4 execute
INFO: I am task 4.
Sep 21, 2011 10:41:34 AM com.workflow.activiti.gateway.ServiceTask3 execute
INFO: variavles={task1=I am task 1, task2=I am task 2, task4=I am task 4}
Sep 21, 2011 10:41:34 AM com.workflow.activiti.gateway.ServiceTask3 execute
INFO: I am task 3.


===================================
手工触发执行
通过<receiveTask>和<userTask>元素都可以实现流程的手工触发执行。
基于<receiveTask>
实现的流程,如图所示:



对应的流程定义文件Task.ReceiveTask.bpmn20.xml,如下所示:
<?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="http://www.activiti.org/test">
  <process id="MyReceiveTask" name="MyReceiveTask">
    <startEvent id="startevent4" name="Start"></startEvent>
    <receiveTask id="receivetask1" name="Check bank">
      <extensionElements>
        <activiti:executionListener event="start" class="org.shirdrn.workflow.activiti.task.CheckBankReceiveTask"></activiti:executionListener>
      </extensionElements>
    </receiveTask>
    <receiveTask id="receivetask2" name="Check merchant">
      <extensionElements>
        <activiti:executionListener event="start" class="org.shirdrn.workflow.activiti.task.CheckMerchantReceiveTask"></activiti:executionListener>
      </extensionElements>
    </receiveTask>
    <endEvent id="endevent5" name="End"></endEvent>
    <sequenceFlow id="flow16" name="" sourceRef="startevent4" targetRef="receivetask1"></sequenceFlow>
    <sequenceFlow id="flow17" name="" sourceRef="receivetask1" targetRef="receivetask2"></sequenceFlow>
    <sequenceFlow id="flow18" name="" sourceRef="receivetask2" targetRef="endevent5"></sequenceFlow>
  </process>
</definitions>


上述流程定义中,对应的两个处理类,代码分别如下所示:
package org.shirdrn.workflow.activiti.task;

import java.util.HashMap;
import java.util.logging.Logger;

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;

public class CheckBankReceiveTask implements JavaDelegate {

	private final Logger log = Logger.getLogger(CheckBankReceiveTask.class.getName());

	@SuppressWarnings("unchecked")
	@Override
	public void execute(DelegateExecution execution) throws Exception {
		log.info("i am CheckBankReceiveTask.");
		System.out.println("in : " + execution.getVariables());
		((HashMap<String, Object>)execution.getVariables().get("in")).put("next", "CheckBankTask");
		((HashMap<String, Object>)execution.getVariables().get("out")).put("reponse", "subprocess:CheckBankReceiveTask->CheckMerchantReceiveTask");		
	}
}


package org.shirdrn.workflow.activiti.task;

import java.util.HashMap;
import java.util.logging.Logger;

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;

public class CheckMerchantReceiveTask implements JavaDelegate {

	private final Logger log = Logger.getLogger(CheckMerchantReceiveTask.class.getName());
	
	@SuppressWarnings("unchecked")
	@Override
	public void execute(DelegateExecution execution) throws Exception {
		log.info("i am CheckMerchantReceiveTask.");
		System.out.println("in : " + execution.getVariables());
		((HashMap<String, Object>)execution.getVariables().get("in")).put("previous", "CheckMerchantReceiveTask");
	}
}


上面还用到一个org.shirdrn.workflow.activiti.subprocess.Merchant类,该类必须支持序列化,如下所示:
package org.shirdrn.workflow.activiti.subprocess;

import java.io.Serializable;

public class Merchant implements Serializable {
	private static final long serialVersionUID = 1L;
	public Merchant(String merchantId, int priority, short serviceType, short status) {
		super();
		this.merchantId = merchantId;
		this.priority = priority;
		this.serviceType = serviceType;
		this.status = status;
	}
	public Merchant(String merchantId) {
		this(merchantId, -1, (short)0, (short)0);
	}
	private String merchantId;
	private int priority = -1;
	private short serviceType = 0;
	private short status = 0;
	public String getMerchantId() {
		return merchantId;
	}
	public void setMerchantId(String merchantId) {
		this.merchantId = merchantId;
	}
	public int getPriority() {
		return priority;
	}
	public void setPriority(int priority) {
		this.priority = priority;
	}
	public short getServiceType() {
		return serviceType;
	}
	public void setServiceType(short serviceType) {
		this.serviceType = serviceType;
	}
	public short getStatus() {
		return status;
	}
	public void setStatus(short status) {
		this.status = status;
	}
	@Override
	public String toString() {
		return "Merchant[" + merchantId + "]";
	}
}


测试用例,代码如下所示:
package org.shirdrn.workflow.activiti.task;

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

import org.activiti.engine.repository.Deployment;
import org.activiti.engine.runtime.Execution;
import org.activiti.engine.runtime.ProcessInstance;
import org.shirdrn.workflow.activiti.AbstractTest;
import org.shirdrn.workflow.activiti.subprocess.Merchant;

public class MyReceiveTaskTest extends AbstractTest {

	@Override
	protected void initialize() throws Exception {
		Deployment deployment = repositoryService
		.createDeployment()
		.addClasspathResource(
				"diagrams/Task.ReceiveTask.bpmn20.xml")
		.deploy();	
		deploymentId = deployment.getId();
	}

	@Override
	protected void destroy() throws Exception {
		repositoryService.deleteDeployment(deploymentId, true);	
	}
	
	public void testSubProcess() {
		// prepare data packet
		Map<String, Object> variables = new HashMap<String, Object>();
		Map<String, Object> subVariables = new HashMap<String, Object>();
		variables.put("maxTransCount", 1000000);
		variables.put("merchant", new Merchant("ICBC"));
		variables.put("protocol", "UM32");
		variables.put("repository", "10.10.38.99:/home/shirdrn/repository");
		variables.put("in", subVariables);
		variables.put("out", new HashMap<String, Object>());
		
		// start process instance
		ProcessInstance pi = runtimeService.startProcessInstanceByKey("MyReceiveTask", variables);
		List<Execution> executions = runtimeService.createExecutionQuery().list();
		assertEquals(1, executions.size());
		
		Execution execution = runtimeService.createExecutionQuery().singleResult();
		runtimeService.setVariable(execution.getId(), "type", "receiveTask");
		runtimeService.signal(execution.getId());
		assertEquals(1, executions.size());
		
		execution = runtimeService.createExecutionQuery().list().get(0);
		assertNotNull(execution);
		runtimeService.setVariable(execution.getId(), "oper", "shirdrn");
		runtimeService.signal(execution.getId());
	}
}

运行结果如下所示:
2011-3-23 12:51:35 org.shirdrn.workflow.activiti.task.CheckBankReceiveTask execute
信息: i am CheckBankReceiveTask.
in : {protocol=UM32, repository=10.10.38.99:/home/shirdrn/repository, merchant=Merchant[ICBC], maxTransCount=1000000, in={}, out={}}
2011-3-23 12:51:35 org.shirdrn.workflow.activiti.task.CheckMerchantReceiveTask execute
信息: i am CheckMerchantReceiveTask.
in : {protocol=UM32, repository=10.10.38.99:/home/shirdrn/repository, merchant=Merchant[ICBC], maxTransCount=1000000, type=receiveTask, in={}, out={}}


基于<userTask>
实现的流程,如图所示:


对应的流程定义文件,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions"
	xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn"
	targetNamespace="Umpay">
	<process id="ParalellBasedForkJoin">
		<startEvent id="theStart" />
		<sequenceFlow id="flow1" sourceRef="theStart" targetRef="fork" />
		<parallelGateway id="fork" name="Fork" />
		<sequenceFlow sourceRef="fork" targetRef="task1" />
		<sequenceFlow sourceRef="fork" targetRef="task2" />
		<sequenceFlow sourceRef="fork" targetRef="task3" />
		<userTask id="task1" name="Task 1">
			<extensionElements>
				<activiti:taskListener event="complete"
					class="org.shirdrn.workflow.activiti.gateway.Task1Listener" />
			</extensionElements>
		</userTask>
		<sequenceFlow sourceRef="task1" targetRef="firstJoin" />
		<userTask id="task2" name="Task 2">
			<extensionElements>
				<activiti:taskListener event="complete"
					class="org.shirdrn.workflow.activiti.gateway.Task2Listener" />
			</extensionElements>
		</userTask>
		<sequenceFlow sourceRef="task2" targetRef="firstJoin" />
		<userTask id="task3" name="Task 3">
			<extensionElements>
				<activiti:taskListener event="complete"
					class="org.shirdrn.workflow.activiti.gateway.Task3Listener" />
			</extensionElements>
		</userTask>
		<sequenceFlow sourceRef="task3" targetRef="secondJoin" />
		<parallelGateway id="firstJoin" name="First Join" />
		<sequenceFlow sourceRef="firstJoin" targetRef="task4" />
		<userTask id="task4" name="Task 4">
			<extensionElements>
				<activiti:taskListener event="complete"
					class="org.shirdrn.workflow.activiti.gateway.Task4Listener" />
			</extensionElements>
		</userTask>
		<sequenceFlow sourceRef="task4" targetRef="secondJoin" />
		<parallelGateway id="secondJoin" />
		<sequenceFlow sourceRef="secondJoin" targetRef="theEnd" />
		<endEvent id="theEnd" />
	</process>
</definitions>

我们看一下上述定义中,如下配置片段:
<userTask id="task1" name="Task 1">
			<extensionElements>
				<activiti:taskListener event="complete"
					class="org.shirdrn.workflow.activiti.gateway.Task1Listener" />
			</extensionElements>
		</userTask>

<activiti:taskListener>元素的event属性,它一共包含三种事件:"create"、"assignment"、"complete",分别表示结点执行处理逻辑的时机为:在处理类实例化时、在结点处理逻辑被指派时、在结点处理逻辑执行完成时,可以根据自己的需要进行指定。
上述流程定义中,4个任务结点对应的处理类,代码分别如下所示:
package org.shirdrn.workflow.activiti.gateway;

import java.util.logging.Logger;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.impl.pvm.delegate.TaskListener;

public class Task1Listener implements TaskListener {

	private final Logger log = Logger.getLogger(Task1Listener.class.getName());
	
	@Override
	public void notify(DelegateTask delegateTask) {
		try {
			Thread.sleep(10000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		log.info("I am task 1.");
	}
}


package org.shirdrn.workflow.activiti.gateway;

import java.util.logging.Logger;

public class Task2Listener implements TaskListener {

	private final Logger log = Logger.getLogger(Task2Listener.class.getName());
	
	@Override
	public void notify(DelegateTask delegateTask) {
		try {
			Thread.sleep(10000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		log.info("I am task 2.");
	}
}


package org.shirdrn.workflow.activiti.gateway;

import java.util.logging.Logger;

public class Task3Listener implements TaskListener {

	private final Logger log = Logger.getLogger(Task3Listener.class.getName());
	
	@Override
	public void notify(DelegateTask delegateTask) {
		try {
			Thread.sleep(5000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		log.info("I am task 3.");
	}
}


引用
package org.shirdrn.workflow.activiti.gateway;

import java.util.logging.Logger;

public class Task4Listener implements TaskListener {

private final Logger log = Logger.getLogger(Task4Listener.class.getName());

@Override
public void notify(DelegateTask delegateTask) {
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
log.info("I am task 4.");
}
}


测试用例,代码如下所示:
引用
package org.shirdrn.workflow.activiti.gateway;

import java.util.Date;
import java.util.List;

import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.activiti.engine.task.TaskQuery;
import org.activiti.engine.test.Deployment;
import org.shirdrn.workflow.activiti.AbstractTest;

public class ParallelGatewayTest extends AbstractTest {

private String deploymentId;
private Date start = null;
private Date end = null;

@Override
protected void initialize() throws Exception {
deploymentId = repositoryService.createDeployment()
.addClasspathResource("diagrams/GatewayTest.testForkJoin.bpmn20.xml")
.deploy().getId();
}

@Override
protected void destroy() throws Exception {
repositoryService.deleteDeployment(deploymentId, true);
}

@Deployment
public void testUnbalancedForkJoin() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("ParalellBasedForkJoin");
TaskQuery query = taskService.createTaskQuery().processInstanceId(pi.getId()).orderByTaskName().asc();

List<Task> tasks = query.list();
assertEquals(3, tasks.size());
start = new Date();
for(Task task : tasks) {
taskService.complete(task.getId());
end = new Date();
System.out.println("" + (end.getTime()-start.getTime()) + "ms.");
}

tasks = query.list();
assertEquals(1, tasks.size());
for(Task task : tasks) {
taskService.complete(task.getId());
end = new Date();
System.out.println("" + (end.getTime()-start.getTime()) + "ms.");
}
end = new Date();
System.out.println("" + (end.getTime()-start.getTime()) + "ms.");
}
}


运行结果如下所示:​
2011-3-23 12:50:09 org.shirdrn.workflow.activiti.gateway.Task1Listener notify
信息: I am task 1.
10031ms.
2011-3-23 12:50:19 org.shirdrn.workflow.activiti.gateway.Task2Listener notify
信息: I am task 2.
20078ms.
2011-3-23 12:50:24 org.shirdrn.workflow.activiti.gateway.Task3Listener notify
信息: I am task 3.
25093ms.
2011-3-23 12:50:29 org.shirdrn.workflow.activiti.gateway.Task4Listener notify
信息: I am task 4.
30172ms.
30172ms.
  • 大小: 13.7 KB
  • 大小: 5.3 KB
分享到:
评论
1 楼 cnzebra 2011-11-11  
能把你整合的代码给我参考一下吗???zebra_ch@163.com

相关推荐

    Activiti5.6 用户手册

    Activiti5.6 用户手册

    activiti5.6一个小例子

    5. 表单(Form):与任务相关的用户界面,用于输入或展示数据。 三、实例解析 在"myactiviti"目录下,我们通常会看到以下关键文件: - myprocess.bpmn20.xml:流程定义文件,包含了流程图的所有信息。 - ...

    activiti 5.6 5.8源代码

    Activiti 是一个开源的工作流和业务流程管理(BPM)引擎,它被广泛用于企业级应用中,以实现流程自动化和提升工作效率。标题提到的是 Activiti 的两个版本,5.6 和 5.8,这表明我们将探讨这两个版本的源代码。 在 ...

    activiti5.6帮助文档

    activiti5.6,想对activiti有所提高,进一步了解的朋友必备,对初学者也是必备文档

    工作流Activiti的学习总结Activiti5.6和Spring3.03整合

    总结起来,Activiti 5.6与Spring 3.03的整合提供了一种高效的方式来建模和执行业务流程,如模拟程序员的面试过程。通过XML配置,我们可以定义复杂的流程逻辑,并结合Spring的特性进行灵活的控制和管理。这种整合使得...

    Activiti 学习笔记六:流程执行历史记录

    Activiti 是一个开源的工作流和业务自动化引擎,广泛应用于企业级应用中,提供流程定义、执行、监控等全面的功能。本学习笔记将聚焦于流程执行的历史记录,这是理解流程运行情况、追踪问题以及优化流程的关键。 一...

    开源工作流框架activiti5.6

    Alfresco软件在2010年5月17日宣布Activiti业务流程管理(BPM)开源项目的正式启动,其首席架构师由业务流程管理BPM的专家 Tom Baeyens担任。 Activiti项目是一项新的基于Apache许可的开源BPM平台,从基础开始构建,...

    activiti权威指南

    这是一本深入讲解Activiti的书,这是一本干货书,不仅有源码的讲解,还有基于源码讲解基础之上的实战讲解,这是一本诚意十足的书,这是一本深入讲解Activiti内核的书,这是一本真正企业级实战的书。 Activiti权威...

    activiti in action meap版 全本

    activiti in action meap版 全本

    Activiti 学习笔记十:开始活动节点(判断流程是否结束及查询历史)

    总结,Activiti 的开始活动节点是流程的起点,而流程是否结束则需要通过查询流程实例和历史流程实例的状态来判断。理解并熟练掌握这些概念和操作,将有助于我们在实际项目中更有效地管理和优化业务流程。通过 ...

    activiti流程图查看demo

    Activiti 是一个开源的工作流和业务自动化引擎,它支持企业级的业务流程管理(BPM)系统和模型驱动的应用程序。这个"activiti流程图查看demo"是一个示例项目,旨在帮助用户理解如何在Activiti中查看和操作流程图。在...

    activiti-engine-5.6 与 spring集成

    1. **Activiti Engine**: Activiti Engine 是 Activiti 的核心组件,负责执行流程定义,管理流程实例,以及处理与流程相关的各种任务。它提供了一个API,开发者可以通过这个API来启动流程实例,查询任务,完成任务等...

    Activiti 学习笔记五:流程变量

    Activiti 是一个开源的工作流引擎,它用于自动化业务流程。在 Activiti 中,流程变量是流程实例中的数据载体,它们可以被流程中的不同任务、事件或服务调用所使用。理解并熟练操作流程变量是深入学习 Activiti 的...

    简单的activiti请假流程

    Activiti 是一个开源的工作流和业务自动化引擎,它被广泛应用于企业级应用中,用于处理业务流程和工作流。这个“简单的activiti请假流程”项目是针对初学者或希望了解Activiti基本操作的一个实例,旨在展示如何在...

    Activiti工作流笔记.chm

    5.6:ProcessDefinition 14 5.7:ProcessInstance 14 5.8:Execution 14 6:HelloWorld程序(模拟流程的执行) 16 6.1:流程图: 16 6.2:部署流程定义 16 6.3:启动流程实例 17 6.4:查看我的个人任务 17 6.5:完成...

    使用activiti工作流引擎显示流程图时高亮显示流程图中已执行节点和已执行路径方法源代码

    在企业级应用中,工作流管理系统(Workflow Management System, WMS)是不可或缺的一部分,它能够自动化业务流程,提高效率。Activiti 是一个流行的开源工作流引擎,它基于模型驱动的架构,提供了一套完整的工具来...

    Activiti7(流程引擎)简单笔记,附带作者执行的Demo代码文件

    Activiti7是一款强大的开源工作流引擎,用于在Java应用程序中实现业务流程自动化。它基于模型驱动的架构,允许开发者通过BPMN 2.0标准来设计、部署和执行流程。这个“Activiti7(流程引擎)简单笔记”很可能是作者在...

    Activiti 学习笔记四:流程实例、任务的执行

    Activiti 是一个开源的工作流和业务自动化引擎,广泛应用于企业级应用中,提供流程定义、流程实例管理、任务处理等功能。本学习笔记将深入探讨流程实例和任务执行这两个关键概念。 流程实例是 Activiti 中的一个...

    工作流activiti学习代码

    工作流Activiti是一种开源的工作流引擎,用于在企业应用程序中实现业务流程自动化。它由Alfresco Software开发,旨在提供灵活、可扩展且易于使用的流程管理解决方案。在本"工作流Activiti学习代码"资源中,我们将...

    最简单的含单元测试的spring boot+activiti集成demo

    Activiti是一款开源的工作流和业务流程管理(BPM)系统,它可以嵌入到Java应用程序中,提供业务流程自动化的能力。Activiti使用BPMN 2.0标准,支持图形化流程设计,使业务人员和开发人员都能理解并操作。它提供了...

Global site tag (gtag.js) - Google Analytics