本文整理汇总了Java中org.activiti.engine.impl.pvm.PvmProcessInstance.start方法的典型用法代码示例。如果您正苦于以下问题:Java PvmProcessInstance.start方法的具体用法?Java PvmProcessInstance.start怎么用?Java PvmProcessInstance.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.impl.pvm.PvmProcessInstance
的用法示例。
在下文中一共展示了PvmProcessInstance.start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testParallelEnd
import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的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());
}
示例2: testStartEnd
import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的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());
}
示例3: testEmbeddedSubProcessNoEnd
import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的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());
}
示例4: pvmSignalTask
import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的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);
}
示例5: execute
import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的package包/类
public void execute(ActivityExecution execution) throws Exception {
ProcessDefinitionImpl processDefinition = Context
.getProcessEngineConfiguration()
.getDeploymentCache()
.findDeployedLatestProcessDefinitionByKey(processDefinitonKey);
PvmProcessInstance subProcessInstance = execution.createSubProcessInstance(processDefinition);
// copy process variables
for (AbstractDataAssociation dataInputAssociation : dataInputAssociations) {
Object value = null;
if (dataInputAssociation.getSourceExpression()!=null) {
value = dataInputAssociation.getSourceExpression().getValue(execution);
}
else {
value = execution.getVariable(dataInputAssociation.getSource());
}
subProcessInstance.setVariable(dataInputAssociation.getTarget(), value);
}
subProcessInstance.start();
}
示例6: testPvmAutomatic
import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的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"));
}
示例7: testParallelEnd
import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的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());
}
示例8: testStartEnd
import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的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());
}
示例9: testSingleAutomatic
import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的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());
}
示例10: testEmbeddedSubProcessNoEnd
import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的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());
}
示例11: testEmbeddedSubProcessWithoutEndEvents
import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的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());
}
示例12: testConcurrentPathsComingOutOfScope
import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的package包/类
/**
* +---------+ |scope | +--+ | +---->|c1| | | | +--+ | | | +-----+ | +----+ | +--+ |start|--->|fork|--->|c2| +-----+ | +----+ | +--+ | | | | | | +--+ | +---->|c3| | | +--+ +---------+
*/
public void testConcurrentPathsComingOutOfScope() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.transition("fork")
.endActivity()
.createActivity("scope")
.scope()
.createActivity("fork")
.behavior(new ParallelGateway())
.transition("c1")
.transition("c2")
.transition("c3")
.endActivity()
.endActivity()
.createActivity("c1")
.behavior(new WaitState())
.endActivity()
.createActivity("c2")
.behavior(new WaitState())
.endActivity()
.createActivity("c3")
.behavior(new WaitState())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
List<String> activeActivityIds = processInstance.findActiveActivityIds();
List<String> expectedActiveActivityIds = new ArrayList<String>();
expectedActiveActivityIds.add("c3");
expectedActiveActivityIds.add("c1");
expectedActiveActivityIds.add("c2");
assertEquals(expectedActiveActivityIds, activeActivityIds);
}
示例13: testWaitStateScope
import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的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());
}
示例14: testReusableSubProcess
import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的package包/类
public void testReusableSubProcess() {
PvmProcessDefinition subProcessDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.transition("subEnd")
.endActivity()
.createActivity("subEnd")
.behavior(new End())
.endActivity()
.buildProcessDefinition();
PvmProcessDefinition superProcessDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.transition("subprocess")
.endActivity()
.createActivity("subprocess")
.behavior(new ReusableSubProcess(subProcessDefinition))
.transition("superEnd")
.endActivity()
.createActivity("superEnd")
.behavior(new End())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = superProcessDefinition.createProcessInstance();
processInstance.start();
assertTrue(processInstance.isEnded());
}
示例15: execute
import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的package包/类
public void execute(DelegateExecution execution) {
ActivityExecution activityExecution = (ActivityExecution) execution;
PvmProcessInstance subProcessInstance = activityExecution.createSubProcessInstance(processDefinition);
// TODO set variables
subProcessInstance.start();
}