當前位置: 首頁>>代碼示例>>Java>>正文


Java EventScopeCreatingSubprocess類代碼示例

本文整理匯總了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());

}
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:58,代碼來源:PvmEventScopesTest.java

示例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());

}
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:57,代碼來源:PvmEventScopesTest.java

示例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());
       
}
 
開發者ID:iotsap,項目名稱:FiWare-Template-Handler,代碼行數:66,代碼來源:PvmEventScopesTest.java

示例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());
  
}
 
開發者ID:iotsap,項目名稱:FiWare-Template-Handler,代碼行數:72,代碼來源:PvmEventScopesTest.java


注:本文中的org.activiti.engine.test.pvm.activities.EventScopeCreatingSubprocess類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。