本文整理匯總了Java中org.activiti.engine.test.pvm.activities.EventScopeCreatingSubprocess類的典型用法代碼示例。如果您正苦於以下問題:Java EventScopeCreatingSubprocess類的具體用法?Java EventScopeCreatingSubprocess怎麽用?Java EventScopeCreatingSubprocess使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
EventScopeCreatingSubprocess類屬於org.activiti.engine.test.pvm.activities包,在下文中一共展示了EventScopeCreatingSubprocess類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testActivityEndDestroysEventScopes
import org.activiti.engine.test.pvm.activities.EventScopeCreatingSubprocess; //導入依賴的package包/類
/**
*
* create evt scope --+ | v
*
* +------------------------------+ | embedded subprocess | +-----+ | +-----------+ +---------+ | +----+ +---+ |start|-->| |startInside|-->|endInside| |-->|wait|-->|end| +-----+ | +-----------+
* +---------+ | +----+ +---+ +------------------------------+
*
* ^ | destroy evt scope --+
*
*/
public void testActivityEndDestroysEventScopes() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.transition("embeddedsubprocess")
.endActivity()
.createActivity("embeddedsubprocess")
.scope()
.behavior(new EventScopeCreatingSubprocess())
.createActivity("startInside")
.behavior(new Automatic())
.transition("endInside")
.endActivity()
.createActivity("endInside")
.behavior(new Automatic())
.endActivity()
.transition("wait")
.endActivity()
.createActivity("wait")
.behavior(new WaitState())
.transition("end")
.endActivity()
.createActivity("end")
.behavior(new Automatic())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
boolean eventScopeFound = false;
List<ExecutionImpl> executions = ((ExecutionImpl) processInstance).getExecutions();
for (ExecutionImpl executionImpl : executions) {
if (executionImpl.isEventScope()) {
eventScopeFound = true;
break;
}
}
assertTrue(eventScopeFound);
processInstance.signal(null, null);
assertTrue(processInstance.isEnded());
}
示例2: testTransitionDestroysEventScope
import org.activiti.engine.test.pvm.activities.EventScopeCreatingSubprocess; //導入依賴的package包/類
/**
* +----------------------------------------------------------------------+ | embedded subprocess | | | | create evt scope --+ | | | | | v | | | | +--------------------------------+ | | | nested
* embedded subprocess | | +-----+ | +-----------+ | +-----------------+ | +----+ +---+ | +---+ |start|-->| |startInside|--> | |startNestedInside| |-->|wait|-->|end| |-->|end| +-----+ |
* +-----------+ | +-----------------+ | +----+ +---+ | +---+ | +--------------------------------+ | | | +----------------------------------------------------------------------+
*
* ^ | destroy evt scope --+
*/
public void testTransitionDestroysEventScope() {
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("nestedSubProcess")
.endActivity()
.createActivity("nestedSubProcess")
.scope()
.behavior(new EventScopeCreatingSubprocess())
.createActivity("startNestedInside")
.behavior(new Automatic())
.endActivity()
.transition("wait")
.endActivity()
.createActivity("wait")
.behavior(new WaitState())
.transition("endInside")
.endActivity()
.createActivity("endInside")
.behavior(new Automatic())
.endActivity()
.transition("end")
.endActivity()
.createActivity("end")
.behavior(new Automatic())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
List<String> expectedActiveActivityIds = new ArrayList<String>();
expectedActiveActivityIds.add("wait");
assertEquals(expectedActiveActivityIds, processInstance.findActiveActivityIds());
PvmExecution execution = processInstance.findExecution("wait");
execution.signal(null, null);
assertTrue(processInstance.isEnded());
}
示例3: testActivityEndDestroysEventScopes
import org.activiti.engine.test.pvm.activities.EventScopeCreatingSubprocess; //導入依賴的package包/類
/**
*
* create evt scope --+
* |
* v
*
* +------------------------------+
* | embedded subprocess |
* +-----+ | +-----------+ +---------+ | +----+ +---+
* |start|-->| |startInside|-->|endInside| |-->|wait|-->|end|
* +-----+ | +-----------+ +---------+ | +----+ +---+
* +------------------------------+
*
* ^
* |
* destroy evt scope --+
*
*/
public void testActivityEndDestroysEventScopes() {
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
.createActivity("start")
.initial()
.behavior(new Automatic())
.transition("embeddedsubprocess")
.endActivity()
.createActivity("embeddedsubprocess")
.scope()
.behavior(new EventScopeCreatingSubprocess())
.createActivity("startInside")
.behavior(new Automatic())
.transition("endInside")
.endActivity()
.createActivity("endInside")
.behavior(new Automatic())
.endActivity()
.transition("wait")
.endActivity()
.createActivity("wait")
.behavior(new WaitState())
.transition("end")
.endActivity()
.createActivity("end")
.behavior(new Automatic())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
boolean eventScopeFound = false;
List<ExecutionImpl> executions = ((ExecutionImpl)processInstance).getExecutions();
for (ExecutionImpl executionImpl : executions) {
if(executionImpl.isEventScope()) {
eventScopeFound = true;
break;
}
}
assertTrue(eventScopeFound);
processInstance.signal(null, null);
assertTrue(processInstance.isEnded());
}
示例4: testTransitionDestroysEventScope
import org.activiti.engine.test.pvm.activities.EventScopeCreatingSubprocess; //導入依賴的package包/類
/**
* +----------------------------------------------------------------------+
* | embedded subprocess |
* | |
* | create evt scope --+ |
* | | |
* | v |
* | |
* | +--------------------------------+ |
* | | nested embedded subprocess | |
* +-----+ | +-----------+ | +-----------------+ | +----+ +---+ | +---+
* |start|-->| |startInside|--> | |startNestedInside| |-->|wait|-->|end| |-->|end|
* +-----+ | +-----------+ | +-----------------+ | +----+ +---+ | +---+
* | +--------------------------------+ |
* | |
* +----------------------------------------------------------------------+
*
* ^
* |
* destroy evt scope --+
*/
public void testTransitionDestroysEventScope() {
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("nestedSubProcess")
.endActivity()
.createActivity("nestedSubProcess")
.scope()
.behavior(new EventScopeCreatingSubprocess())
.createActivity("startNestedInside")
.behavior(new Automatic())
.endActivity()
.transition("wait")
.endActivity()
.createActivity("wait")
.behavior(new WaitState())
.transition("endInside")
.endActivity()
.createActivity("endInside")
.behavior(new Automatic())
.endActivity()
.transition("end")
.endActivity()
.createActivity("end")
.behavior(new Automatic())
.endActivity()
.buildProcessDefinition();
PvmProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();
List<String> expectedActiveActivityIds = new ArrayList<String>();
expectedActiveActivityIds.add("wait");
assertEquals(expectedActiveActivityIds, processInstance.findActiveActivityIds());
PvmExecution execution = processInstance.findExecution("wait");
execution.signal(null, null);
assertTrue(processInstance.isEnded());
}