本文整理汇总了Java中org.activiti.engine.impl.pvm.ProcessDefinitionBuilder类的典型用法代码示例。如果您正苦于以下问题:Java ProcessDefinitionBuilder类的具体用法?Java ProcessDefinitionBuilder怎么用?Java ProcessDefinitionBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProcessDefinitionBuilder类属于org.activiti.engine.impl.pvm包,在下文中一共展示了ProcessDefinitionBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testPvmAutomatic
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
public void testPvmAutomatic() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("a")
.initial()
.behavior(new Automatic())
.transition("b")
.endActivity()
.createActivity("b")
.behavior(new Automatic())
.transition("c")
.endActivity()
.createActivity("c")
.behavior(new WaitState())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
assertNotNull(processInstance.findExecution("c"));
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:22,代码来源:PvmTest.java
示例2: testParallelEnd
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
/**
* +----+ +--->|end1| | +----+ | +-----+ +----+ |start|-->|fork| +-----+ +----+ | | +----+ +--->|end2| +----+
*/
public void testParallelEnd() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.transition("fork")
.endActivity()
.createActivity("fork")
.behavior(new ParallelGateway())
.transition("end1")
.transition("end2")
.endActivity()
.createActivity("end1")
.behavior(new End())
.endActivity()
.createActivity("end2")
.behavior(new End())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
assertTrue(processInstance.isEnded());
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:29,代码来源:PvmParallelEndTest.java
示例3: testStartEnd
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
/**
* +-------+ +-----+ | start |-->| end | +-------+ +-----+
*/
public void testStartEnd() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.transition("end")
.endActivity()
.createActivity("end")
.behavior(new End())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
assertEquals(new ArrayList<String>(), processInstance.findActiveActivityIds());
assertTrue(processInstance.isEnded());
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:22,代码来源:PvmBasicLinearExecutionTest.java
示例4: testSingleAutomatic
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
/**
* +-----+ +-----+ +-------+ | one |-->| two |-->| three | +-----+ +-----+ +-------+
*/
public void testSingleAutomatic() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("one")
.initial()
.behavior(new Automatic())
.transition("two")
.endActivity()
.createActivity("two")
.behavior(new Automatic())
.transition("three")
.endActivity()
.createActivity("three")
.behavior(new End())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
assertEquals(new ArrayList<String>(), processInstance.findActiveActivityIds());
assertTrue(processInstance.isEnded());
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:26,代码来源:PvmBasicLinearExecutionTest.java
示例5: testEmbeddedSubProcessWithoutEndEvents
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
/**
* +------------------------------+ | embedded subprocess | +-----+ | +-----------+ | |start|-->| |startInside| | +-----+ | +-----------+ | +------------------------------+
*/
public void testEmbeddedSubProcessWithoutEndEvents() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.transition("embeddedsubprocess")
.endActivity()
.createActivity("embeddedsubprocess")
.scope()
.behavior(new EmbeddedSubProcess())
.createActivity("startInside")
.behavior(new Automatic())
.endActivity()
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
assertTrue(processInstance.isEnded());
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:25,代码来源:PvmEmbeddedSubProcessTest.java
示例6: testEmbeddedSubProcessNoEnd
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
/**
* +------------------------------+ | embedded subprocess | +-----+ | +-----------+ +---------+ | |start|-->| |startInside|-->|endInside| | +-----+ | +-----------+ +---------+ |
* +------------------------------+
*/
public void testEmbeddedSubProcessNoEnd() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.transition("embeddedsubprocess")
.endActivity()
.createActivity("embeddedsubprocess")
.scope()
.behavior(new EmbeddedSubProcess())
.createActivity("startInside")
.behavior(new Automatic())
.transition("endInside")
.endActivity()
.createActivity("endInside")
.behavior(new End())
.endActivity()
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
assertTrue(processInstance.isEnded());
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:30,代码来源:PvmEmbeddedSubProcessTest.java
示例7: pvmSignalTask
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
@Test
public void pvmSignalTask() {
// 创建流程定义构造器
ProcessDefinitionBuilder builder = new ProcessDefinitionBuilder();
builder.createActivity("start") // 设置活动的名称
.initial() // 标记为起始节点
.behavior(new Automatic()) // 活动处理器
.transition("userTask") // 下一个执行的活动
.endActivity(); // 结束当前活动
// 创建用户任务
builder.createActivity("userTask").behavior(new WaitState())
.transition("end").endActivity();
// 创建结束节点
builder.createActivity("end").behavior(new Automatic()).endActivity();
// 构建PVM流程定义
PvmProcessDefinition pvmProcessDefinition = builder.buildProcessDefinition();
// 创建PVM流程实例
PvmProcessInstance processInstance = pvmProcessDefinition.createProcessInstance();
// 启动流程
processInstance.start();
// 触发等待的活动(userTask)
//processInstance.signal("userTask", null);
}
开发者ID:shawn-gogh,项目名称:myjavacode,代码行数:27,代码来源:PvmTest.java
示例8: testPvmAutomatic
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
public void testPvmAutomatic() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("a")
.initial()
.behavior(new Automatic())
.transition("b")
.endActivity()
.createActivity("b")
.behavior(new Automatic())
.transition("c")
.endActivity()
.createActivity("c")
.behavior(new WaitState())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
assertNotNull(processInstance.findExecution("c"));
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:22,代码来源:PvmTest.java
示例9: testParallelEnd
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
/**
* +----+
* +--->|end1|
* | +----+
* |
* +-----+ +----+
* |start|-->|fork|
* +-----+ +----+
* |
* | +----+
* +--->|end2|
* +----+
*/
public void testParallelEnd() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.transition("fork")
.endActivity()
.createActivity("fork")
.behavior(new ParallelGateway())
.transition("end1")
.transition("end2")
.endActivity()
.createActivity("end1")
.behavior(new End())
.endActivity()
.createActivity("end2")
.behavior(new End())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
assertTrue(processInstance.isEnded());
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:39,代码来源:PvmParallelEndTest.java
示例10: testStartEnd
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
/**
* +-------+ +-----+
* | start |-->| end |
* +-------+ +-----+
*/
public void testStartEnd() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.transition("end")
.endActivity()
.createActivity("end")
.behavior(new End())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
assertEquals(new ArrayList<String>(), processInstance.findActiveActivityIds());
assertTrue(processInstance.isEnded());
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:24,代码来源:PvmBasicLinearExecutionTest.java
示例11: testSingleAutomatic
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
/**
* +-----+ +-----+ +-------+
* | one |-->| two |-->| three |
* +-----+ +-----+ +-------+
*/
public void testSingleAutomatic() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("one")
.initial()
.behavior(new Automatic())
.transition("two")
.endActivity()
.createActivity("two")
.behavior(new Automatic())
.transition("three")
.endActivity()
.createActivity("three")
.behavior(new End())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
assertEquals(new ArrayList<String>(), processInstance.findActiveActivityIds());
assertTrue(processInstance.isEnded());
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:28,代码来源:PvmBasicLinearExecutionTest.java
示例12: testEmbeddedSubProcessWithoutEndEvents
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
/**
* +------------------------------+
* | embedded subprocess |
* +-----+ | +-----------+ |
* |start|-->| |startInside| |
* +-----+ | +-----------+ |
* +------------------------------+
*/
public void testEmbeddedSubProcessWithoutEndEvents() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.transition("embeddedsubprocess")
.endActivity()
.createActivity("embeddedsubprocess")
.scope()
.behavior(new EmbeddedSubProcess())
.createActivity("startInside")
.behavior(new Automatic())
.endActivity()
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
assertTrue(processInstance.isEnded());
}
开发者ID:iotsap,项目名称:FiWare-Template-Handler,代码行数:30,代码来源:PvmEmbeddedSubProcessTest.java
示例13: testEmbeddedSubProcessNoEnd
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
/**
* +------------------------------+
* | embedded subprocess |
* +-----+ | +-----------+ +---------+ |
* |start|-->| |startInside|-->|endInside| |
* +-----+ | +-----------+ +---------+ |
* +------------------------------+
*/
public void testEmbeddedSubProcessNoEnd() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.transition("embeddedsubprocess")
.endActivity()
.createActivity("embeddedsubprocess")
.scope()
.behavior(new EmbeddedSubProcess())
.createActivity("startInside")
.behavior(new Automatic())
.transition("endInside")
.endActivity()
.createActivity("endInside")
.behavior(new End())
.endActivity()
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
assertTrue(processInstance.isEnded());
}
开发者ID:iotsap,项目名称:FiWare-Template-Handler,代码行数:34,代码来源:PvmEmbeddedSubProcessTest.java
示例14: testPvmWaitState
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
public void testPvmWaitState() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("a")
.initial()
.behavior(new WaitState())
.transition("b")
.endActivity()
.createActivity("b")
.behavior(new WaitState())
.transition("c")
.endActivity()
.createActivity("c")
.behavior(new WaitState())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
PvmExecution activityInstance = processInstance.findExecution("a");
assertNotNull(activityInstance);
activityInstance.signal(null, null);
activityInstance = processInstance.findExecution("b");
assertNotNull(activityInstance);
activityInstance.signal(null, null);
activityInstance = processInstance.findExecution("c");
assertNotNull(activityInstance);
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:33,代码来源:PvmTest.java
示例15: testPvmDecision
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
public void testPvmDecision() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.transition("checkCredit")
.endActivity()
.createActivity("checkCredit")
.behavior(new Decision())
.transition("askDaughterOut", "wow")
.transition("takeToGolf", "nice")
.transition("ignore", "default")
.endActivity()
.createActivity("takeToGolf")
.behavior(new WaitState())
.endActivity()
.createActivity("askDaughterOut")
.behavior(new WaitState())
.endActivity()
.createActivity("ignore")
.behavior(new WaitState())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.setVariable("creditRating", "Aaa-");
processInstance.start();
assertNotNull(processInstance.findExecution("takeToGolf"));
processInstance = processDefinition.createProcessInstance();
processInstance.setVariable("creditRating", "AAA+");
processInstance.start();
assertNotNull(processInstance.findExecution("askDaughterOut"));
processInstance = processDefinition.createProcessInstance();
processInstance.setVariable("creditRating", "bb-");
processInstance.start();
assertNotNull(processInstance.findExecution("ignore"));
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:40,代码来源:PvmTest.java
示例16: testWaitStateScope
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
/**
* +-----+ +----------+ +---+ |start|-->|scopedWait|-->|end| +-----+ +----------+ +---+
*/
public void testWaitStateScope() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.transition("scopedWait")
.endActivity()
.createActivity("scopedWait")
.scope()
.behavior(new WaitState())
.transition("end")
.endActivity()
.createActivity("end")
.behavior(new End())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
PvmExecution execution = processInstance.findExecution("scopedWait");
assertNotNull(execution);
execution.signal(null, null);
assertEquals(new ArrayList<String>(), processInstance.findActiveActivityIds());
assertTrue(processInstance.isEnded());
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:32,代码来源:PvmScopeWaitStateTest.java
示例17: testNestedScope
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
/**
* +--------------+ | outerScope | +-----+ | +----------+ | +---+ |start|--->|scopedWait|--->|end| +-----+ | +----------+ | +---+ +--------------+
*/
public void testNestedScope() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.transition("scopedWait")
.endActivity()
.createActivity("outerScope")
.scope()
.createActivity("scopedWait")
.scope()
.behavior(new WaitState())
.transition("end")
.endActivity()
.endActivity()
.createActivity("end")
.behavior(new End())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
PvmExecution activityInstance = processInstance.findExecution("scopedWait");
assertNotNull(activityInstance);
activityInstance.signal(null, null);
assertEquals(new ArrayList<String>(), processInstance.findActiveActivityIds());
assertTrue(processInstance.isEnded());
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:35,代码来源:PvmScopeWaitStateTest.java
示例18: testSimpleProcessInstanceEnd
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
public void testSimpleProcessInstanceEnd() {
EventCollector eventCollector = new EventCollector();
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.executionListener(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_START, eventCollector)
.executionListener(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_END, eventCollector)
.createActivity("start")
.initial()
.behavior(new Automatic())
.transition("wait")
.endActivity()
.createActivity("wait")
.behavior(new WaitState())
.executionListener(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_START, eventCollector)
.executionListener(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_END, eventCollector)
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
System.err.println(eventCollector);
processInstance.deleteCascade("test");
System.err.println();
System.err.println(eventCollector);
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:29,代码来源:PvmProcessInstanceEndTest.java
示例19: testSingleWaitState
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
/**
* +-----+ +-----+ +-------+ | one |-->| two |-->| three | +-----+ +-----+ +-------+
*/
public void testSingleWaitState() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("one")
.initial()
.behavior(new Automatic())
.transition("two")
.endActivity()
.createActivity("two")
.behavior(new WaitState())
.transition("three")
.endActivity()
.createActivity("three")
.behavior(new End())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
PvmExecution activityInstance = processInstance.findExecution("two");
assertNotNull(activityInstance);
activityInstance.signal(null, null);
assertEquals(new ArrayList<String>(), processInstance.findActiveActivityIds());
assertTrue(processInstance.isEnded());
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:31,代码来源:PvmBasicLinearExecutionTest.java
示例20: testWhileLoop
import org.activiti.engine.impl.pvm.ProcessDefinitionBuilder; //导入依赖的package包/类
/**
* +----------------------------+ v | +-------+ +------+ +-----+ +-----+ +-------+ | start |-->| loop |-->| one |-->| two |--> | three | +-------+ +------+ +-----+ +-----+ +-------+ | | +-----+
* +-->| end | +-----+
*/
public void testWhileLoop() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.transition("loop")
.endActivity()
.createActivity("loop")
.behavior(new While("count", 0, 500))
.transition("one", "more")
.transition("end", "done")
.endActivity()
.createActivity("one")
.behavior(new Automatic())
.transition("two")
.endActivity()
.createActivity("two")
.behavior(new Automatic())
.transition("three")
.endActivity()
.createActivity("three")
.behavior(new Automatic())
.transition("loop")
.endActivity()
.createActivity("end")
.behavior(new End())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
assertEquals(new ArrayList<String>(), processInstance.findActiveActivityIds());
assertTrue(processInstance.isEnded());
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:40,代码来源:PvmBasicLinearExecutionTest.java
注:本文中的org.activiti.engine.impl.pvm.ProcessDefinitionBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论