当前位置: 首页>>代码示例>>Java>>正文


Java PvmProcessInstance.findExecution方法代码示例

本文整理汇总了Java中org.activiti.engine.impl.pvm.PvmProcessInstance.findExecution方法的典型用法代码示例。如果您正苦于以下问题:Java PvmProcessInstance.findExecution方法的具体用法?Java PvmProcessInstance.findExecution怎么用?Java PvmProcessInstance.findExecution使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.activiti.engine.impl.pvm.PvmProcessInstance的用法示例。


在下文中一共展示了PvmProcessInstance.findExecution方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testPvmWaitState

import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的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

示例2: 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());
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:32,代码来源:PvmScopeWaitStateTest.java

示例3: testNestedScope

import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的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

示例4: testSingleWaitState

import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的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

示例5: testVariables

import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的package包/类
public void testVariables() {
    PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
            .createActivity("a")
            .initial()
            .behavior(new WaitState())
            .endActivity()
            .buildProcessDefinition();

    PvmProcessInstance processInstance = processDefinition.createProcessInstance();
    processInstance.setVariable("amount", 500L);
    processInstance.setVariable("msg", "hello world");
    processInstance.start();

    assertEquals(500L, processInstance.getVariable("amount"));
    assertEquals("hello world", processInstance.getVariable("msg"));

    PvmExecution activityInstance = processInstance.findExecution("a");
    assertEquals(500L, activityInstance.getVariable("amount"));
    assertEquals("hello world", activityInstance.getVariable("msg"));

    Map<String, Object> expectedVariables = new HashMap<String, Object>();
    expectedVariables.put("amount", 500L);
    expectedVariables.put("msg", "hello world");

    assertEquals(expectedVariables, activityInstance.getVariables());
    assertEquals(expectedVariables, processInstance.getVariables());
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:28,代码来源:PvmVariablesTest.java

示例6: testPvmWaitState

import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的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:logicalhacking,项目名称:SecureBPMN,代码行数:33,代码来源:PvmTest.java

示例7: 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());
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:34,代码来源:PvmScopeWaitStateTest.java

示例8: testNestedScope

import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的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:logicalhacking,项目名称:SecureBPMN,代码行数:40,代码来源:PvmScopeWaitStateTest.java

示例9: testSingleWaitState

import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的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:logicalhacking,项目名称:SecureBPMN,代码行数:33,代码来源:PvmBasicLinearExecutionTest.java

示例10: testVariables

import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的package包/类
@Test
public void testVariables() {
  PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
    .createActivity("a")
      .initial()
      .behavior(new WaitState())
    .endActivity()
  .buildProcessDefinition();
    
  PvmProcessInstance processInstance = processDefinition.createProcessInstance();
  processInstance.setVariable("amount", 500L);
  processInstance.setVariable("msg", "hello world");
  processInstance.start();

  assertEquals(500L, processInstance.getVariable("amount"));
  assertEquals("hello world", processInstance.getVariable("msg"));

  PvmExecution activityInstance = processInstance.findExecution("a");
  assertEquals(500L, activityInstance.getVariable("amount"));
  assertEquals("hello world", activityInstance.getVariable("msg"));
  
  Map<String, Object> expectedVariables = new HashMap<String, Object>();
  expectedVariables.put("amount", 500L);
  expectedVariables.put("msg", "hello world");

  assertEquals(expectedVariables, activityInstance.getVariables());
  assertEquals(expectedVariables, processInstance.getVariables());
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:29,代码来源:PvmVariablesTest.java

示例11: testCombinationOfWaitStatesAndAutomatics

import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的package包/类
/**
 * +-----+ +-----+ +-------+ +------+ +------+ | one |-->| two |-->| three |-->| four |--> | five | +-----+ +-----+ +-------+ +------+ +------+
 */
public void testCombinationOfWaitStatesAndAutomatics() {
    PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
            .createActivity("start")
            .initial()
            .behavior(new Automatic())
            .transition("one")
            .endActivity()
            .createActivity("one")
            .behavior(new WaitState())
            .transition("two")
            .endActivity()
            .createActivity("two")
            .behavior(new WaitState())
            .transition("three")
            .endActivity()
            .createActivity("three")
            .behavior(new Automatic())
            .transition("four")
            .endActivity()
            .createActivity("four")
            .behavior(new Automatic())
            .transition("five")
            .endActivity()
            .createActivity("five")
            .behavior(new End())
            .endActivity()
            .buildProcessDefinition();

    PvmProcessInstance processInstance = processDefinition.createProcessInstance();
    processInstance.start();

    PvmExecution activityInstance = processInstance.findExecution("one");
    assertNotNull(activityInstance);
    activityInstance.signal(null, null);

    activityInstance = processInstance.findExecution("two");
    assertNotNull(activityInstance);
    activityInstance.signal(null, null);

    assertEquals(new ArrayList<String>(), processInstance.findActiveActivityIds());
    assertTrue(processInstance.isEnded());
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:46,代码来源:PvmBasicLinearExecutionTest.java

示例12: testNestedActivitiesEventsOnTransitionEvents

import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的package包/类
/**
 * +--------------+ |outerscope | | +----------+ | | |innerscope| | +-----+ | | +----+ | | +---+ |start|---->|wait|------>|end| +-----+ | | +----+ | | +---+ | +----------+ | +--------------+
 */
public void testNestedActivitiesEventsOnTransitionEvents() {
    EventCollector eventCollector = new EventCollector();

    PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder("events")
            .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())
            .executionListener(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_START, eventCollector)
            .executionListener(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_END, eventCollector)
            .startTransition("wait")
            .executionListener(eventCollector)
            .endTransition()
            .endActivity()
            .createActivity("outerscope")
            .executionListener(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_START, eventCollector)
            .executionListener(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_END, eventCollector)
            .createActivity("innerscope")
            .scope()
            .executionListener(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_START, eventCollector)
            .executionListener(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_END, eventCollector)
            .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)
            .transition("end")
            .endActivity()
            .endActivity()
            .endActivity()
            .createActivity("end")
            .behavior(new WaitState())
            .endActivity()
            .buildProcessDefinition();

    PvmProcessInstance processInstance = processDefinition.createProcessInstance();
    processInstance.start();

    List<String> expectedEvents = new ArrayList<String>();
    expectedEvents.add("start on ProcessDefinition(events)");
    expectedEvents.add("start on Activity(start)");
    expectedEvents.add("end on Activity(start)");
    expectedEvents.add("take on (start)-->(wait)");
    expectedEvents.add("start on Activity(outerscope)");
    expectedEvents.add("start on Activity(innerscope)");
    expectedEvents.add("start on Activity(wait)");

    assertEquals("expected " + expectedEvents + ", but was \n" + eventCollector + "\n", expectedEvents, eventCollector.events);

    PvmExecution execution = processInstance.findExecution("wait");
    execution.signal(null, null);

    expectedEvents.add("end on Activity(wait)");
    expectedEvents.add("end on Activity(innerscope)");
    expectedEvents.add("end on Activity(outerscope)");

    assertEquals("expected " + expectedEvents + ", but was \n" + eventCollector + "\n", expectedEvents, eventCollector.events);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:62,代码来源:PvmEventTest.java

示例13: testTransitionDestroysEventScope

import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的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

示例14: testMultipleConcurrentEndsInsideEmbeddedSubProcessWithWaitState

import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的package包/类
/**
 * +-------------------------------------------------+ | embeddedsubprocess +----------+ | | +---->|endInside1| | | | +----------+ | | | | +-----+ | +-----------+ +----+ +----+ +----------+ |
 * +---+ |start|-->| |startInside|-->|fork|-->|wait|-->|endInside2| |-->|end| +-----+ | +-----------+ +----+ +----+ +----------+ | +---+ | | | | | +----------+ | | +---->|endInside3| | |
 * +----------+ | +-------------------------------------------------+
 */
public void testMultipleConcurrentEndsInsideEmbeddedSubProcessWithWaitState() {
    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("fork")
            .endActivity()
            .createActivity("fork")
            .behavior(new ParallelGateway())
            .transition("endInside1")
            .transition("wait")
            .transition("endInside3")
            .endActivity()
            .createActivity("endInside1")
            .behavior(new End())
            .endActivity()
            .createActivity("wait")
            .behavior(new WaitState())
            .transition("endInside2")
            .endActivity()
            .createActivity("endInside2")
            .behavior(new End())
            .endActivity()
            .createActivity("endInside3")
            .behavior(new End())
            .endActivity()
            .transition("end")
            .endActivity()
            .createActivity("end")
            .behavior(new End())
            .endActivity()
            .buildProcessDefinition();

    PvmProcessInstance processInstance = processDefinition.createProcessInstance();
    processInstance.start();

    assertFalse(processInstance.isEnded());
    PvmExecution execution = processInstance.findExecution("wait");
    execution.signal(null, null);

    assertTrue(processInstance.isEnded());
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:55,代码来源:PvmEmbeddedSubProcessTest.java

示例15: testSimpleWaitStateConcurrency

import org.activiti.engine.impl.pvm.PvmProcessInstance; //导入方法依赖的package包/类
public void testSimpleWaitStateConcurrency() {
    PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
            .createActivity("start")
            .initial()
            .behavior(new Automatic())
            .transition("fork")
            .endActivity()
            .createActivity("fork")
            .behavior(new ParallelGateway())
            .transition("c1")
            .transition("c2")
            .endActivity()
            .createActivity("c1")
            .behavior(new WaitState())
            .transition("join")
            .endActivity()
            .createActivity("c2")
            .behavior(new WaitState())
            .transition("join")
            .endActivity()
            .createActivity("join")
            .behavior(new ParallelGateway())
            .transition("end")
            .endActivity()
            .createActivity("end")
            .behavior(new WaitState())
            .endActivity()
            .buildProcessDefinition();

    PvmProcessInstance processInstance = processDefinition.createProcessInstance();
    processInstance.start();

    PvmExecution activityInstanceC1 = processInstance.findExecution("c1");
    assertNotNull(activityInstanceC1);

    PvmExecution activityInstanceC2 = processInstance.findExecution("c2");
    assertNotNull(activityInstanceC2);

    activityInstanceC1.signal(null, null);
    activityInstanceC2.signal(null, null);

    List<String> activityNames = processInstance.findActiveActivityIds();
    List<String> expectedActivityNames = new ArrayList<String>();
    expectedActivityNames.add("end");

    assertEquals(expectedActivityNames, activityNames);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:48,代码来源:PvmParallelTest.java


注:本文中的org.activiti.engine.impl.pvm.PvmProcessInstance.findExecution方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。