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


Java CaseExecutionListener类代码示例

本文整理汇总了Java中org.camunda.bpm.engine.delegate.CaseExecutionListener的典型用法代码示例。如果您正苦于以下问题:Java CaseExecutionListener类的具体用法?Java CaseExecutionListener怎么用?Java CaseExecutionListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: notify

import org.camunda.bpm.engine.delegate.CaseExecutionListener; //导入依赖的package包/类
public void notify(DelegateCaseExecution caseExecution) throws Exception {
  // Note: we can't cache the result of the expression, because the
  // caseExecution can change: eg. delegateExpression='${mySpringBeanFactory.randomSpringBean()}'
  Object delegate = expression.getValue(caseExecution);
  applyFieldDeclaration(fieldDeclarations, delegate);

  if (delegate instanceof CaseExecutionListener) {
    CaseExecutionListener listenerInstance = (CaseExecutionListener) delegate;
    Context
      .getProcessEngineConfiguration()
      .getDelegateInterceptor()
      .handleInvocation(new CaseExecutionListenerInvocation(listenerInstance, caseExecution));
  } else {
    throw new ProcessEngineException("Delegate expression " + expression
            + " did not resolve to an implementation of " + CaseExecutionListener.class);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:DelegateExpressionCaseExecutionListener.java

示例2: initializeCaseExecutionListeners

import org.camunda.bpm.engine.delegate.CaseExecutionListener; //导入依赖的package包/类
protected void initializeCaseExecutionListeners(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context) {
  PlanItemDefinition definition = getDefinition(element);

  List<CamundaCaseExecutionListener> listeners = queryExtensionElementsByClass(definition, CamundaCaseExecutionListener.class);

  for (CamundaCaseExecutionListener listener : listeners) {
    CaseExecutionListener caseExecutionListener = initializeCaseExecutionListener(element, activity, context, listener);

    String eventName = listener.getCamundaEvent();
    if(eventName != null) {
      activity.addListener(eventName, caseExecutionListener);

    } else {
      for (String event : getStandardEvents(element)) {
        activity.addListener(event, caseExecutionListener);
      }
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:ItemHandler.java

示例3: testDoesNotImplementCaseExecutionListenerInterfaceByClass

import org.camunda.bpm.engine.delegate.CaseExecutionListener; //导入依赖的package包/类
@Deployment(resources = {"org/camunda/bpm/engine/test/cmmn/listener/CaseInstanceListenerTest.testDoesNotImplementCaseExecutionListenerInterfaceByClass.cmmn"})
public void testDoesNotImplementCaseExecutionListenerInterfaceByClass() {
  // given


  try {
    // when
    caseService
      .withCaseDefinitionByKey("case")
      .create();
  } catch (Exception e) {
    // then
    String message = e.getMessage();
    assertTextPresent("ENGINE-05016 Class 'org.camunda.bpm.engine.test.cmmn.listener.NotCaseExecutionListener' doesn't implement '"+CaseExecutionListener.class.getName() + "'", message);
  }

}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:CaseInstanceListenerTest.java

示例4: testDoesNotImplementCaseExecutionListenerInterfaceByDelegateExpression

import org.camunda.bpm.engine.delegate.CaseExecutionListener; //导入依赖的package包/类
@Deployment(resources = {"org/camunda/bpm/engine/test/cmmn/listener/CaseInstanceListenerTest.testDoesNotImplementCaseExecutionListenerInterfaceByDelegateExpression.cmmn"})
public void testDoesNotImplementCaseExecutionListenerInterfaceByDelegateExpression() {
  // given

  try {
    // when
    caseService
      .withCaseDefinitionByKey("case")
      .setVariable("myListener", new NotCaseExecutionListener())
      .create();
  } catch (Exception e) {
    // then
    String message = e.getMessage();
    assertTextPresent("Delegate expression ${myListener} did not resolve to an implementation of interface "+CaseExecutionListener.class.getName(), message);
  }

}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:CaseInstanceListenerTest.java

示例5: testDoesNotImplementCaseExecutionListenerInterfaceByClass

import org.camunda.bpm.engine.delegate.CaseExecutionListener; //导入依赖的package包/类
@Deployment(resources = {"org/camunda/bpm/engine/test/cmmn/listener/CaseExecutionListenerTest.testDoesNotImplementCaseExecutionListenerInterfaceByClass.cmmn"})
public void testDoesNotImplementCaseExecutionListenerInterfaceByClass() {
  // given


  try {
    // when
    caseService
      .withCaseDefinitionByKey("case")
      .create();
  } catch (Exception e) {
    // then
    String message = e.getMessage();
    assertTextPresent("ENGINE-05016 Class 'org.camunda.bpm.engine.test.cmmn.listener.NotCaseExecutionListener' doesn't implement '" + CaseExecutionListener.class.getName() + "'", message);
  }

}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:CaseExecutionListenerTest.java

示例6: testDoesNotImplementCaseExecutionListenerInterfaceByDelegateExpression

import org.camunda.bpm.engine.delegate.CaseExecutionListener; //导入依赖的package包/类
@Deployment(resources = {"org/camunda/bpm/engine/test/cmmn/listener/CaseExecutionListenerTest.testDoesNotImplementCaseExecutionListenerInterfaceByDelegateExpression.cmmn"})
public void testDoesNotImplementCaseExecutionListenerInterfaceByDelegateExpression() {
  // given

  try {
    // when
    caseService
      .withCaseDefinitionByKey("case")
      .setVariable("myListener", new NotCaseExecutionListener())
      .create();
  } catch (Exception e) {
    // then
    String message = e.getMessage();
    assertTextPresent("Delegate expression ${myListener} did not resolve to an implementation of interface "+CaseExecutionListener.class.getName(), message);
  }

}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:CaseExecutionListenerTest.java

示例7: testRepetitionRuleStandardEvents

import org.camunda.bpm.engine.delegate.CaseExecutionListener; //导入依赖的package包/类
@Test
public void testRepetitionRuleStandardEvents() {
  // given
  ItemControl itemControl = createElement(planItem, "ItemControl_1", ItemControl.class);
  RepetitionRule repetitionRule = createElement(itemControl, "RepititionRule_1", RepetitionRule.class);
  ConditionExpression expression = createElement(repetitionRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(planItem, context);

  // then
  List<String> events = newActivity.getProperties().get(CmmnProperties.REPEAT_ON_STANDARD_EVENTS);
  assertNotNull(events);
  assertEquals(2, events.size());
  assertTrue(events.contains(CaseExecutionListener.COMPLETE));
  assertTrue(events.contains(CaseExecutionListener.TERMINATE));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:21,代码来源:CaseTaskPlanItemHandlerTest.java

示例8: testRepetitionRuleStandardEventsByDefaultPlanItemControl

import org.camunda.bpm.engine.delegate.CaseExecutionListener; //导入依赖的package包/类
@Test
public void testRepetitionRuleStandardEventsByDefaultPlanItemControl() {
  // given
  PlanItemControl defaultControl = createElement(caseTask, "DefaultControl_1", DefaultControl.class);
  RepetitionRule repetitionRule = createElement(defaultControl, "RepititionRule_1", RepetitionRule.class);
  ConditionExpression expression = createElement(repetitionRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(planItem, context);

  // then
  List<String> events = newActivity.getProperties().get(CmmnProperties.REPEAT_ON_STANDARD_EVENTS);
  assertNotNull(events);
  assertEquals(2, events.size());
  assertTrue(events.contains(CaseExecutionListener.COMPLETE));
  assertTrue(events.contains(CaseExecutionListener.TERMINATE));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:21,代码来源:CaseTaskPlanItemHandlerTest.java

示例9: testRepetitionRuleCustomStandardEvents

import org.camunda.bpm.engine.delegate.CaseExecutionListener; //导入依赖的package包/类
@Test
public void testRepetitionRuleCustomStandardEvents() {
  // given
  ItemControl itemControl = createElement(planItem, "ItemControl_1", ItemControl.class);
  RepetitionRule repetitionRule = createElement(itemControl, "RepititionRule_1", RepetitionRule.class);
  ConditionExpression expression = createElement(repetitionRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  repetitionRule.setCamundaRepeatOnStandardEvent(CaseExecutionListener.DISABLE);

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(planItem, context);

  // then
  List<String> events = newActivity.getProperties().get(CmmnProperties.REPEAT_ON_STANDARD_EVENTS);
  assertNotNull(events);
  assertEquals(1, events.size());
  assertTrue(events.contains(CaseExecutionListener.DISABLE));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:22,代码来源:CaseTaskPlanItemHandlerTest.java

示例10: testRepetitionRuleCustomStandardEventsByDefaultPlanItemControl

import org.camunda.bpm.engine.delegate.CaseExecutionListener; //导入依赖的package包/类
@Test
public void testRepetitionRuleCustomStandardEventsByDefaultPlanItemControl() {
  // given
  PlanItemControl defaultControl = createElement(caseTask, "DefaultControl_1", DefaultControl.class);
  RepetitionRule repetitionRule = createElement(defaultControl, "RepititionRule_1", RepetitionRule.class);
  ConditionExpression expression = createElement(repetitionRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  repetitionRule.setCamundaRepeatOnStandardEvent(CaseExecutionListener.DISABLE);

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(planItem, context);

  // then
  List<String> events = newActivity.getProperties().get(CmmnProperties.REPEAT_ON_STANDARD_EVENTS);
  assertNotNull(events);
  assertEquals(1, events.size());
  assertTrue(events.contains(CaseExecutionListener.DISABLE));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:22,代码来源:CaseTaskPlanItemHandlerTest.java

示例11: testRepetitionRuleStandardEventsByDefaultPlanItemControl

import org.camunda.bpm.engine.delegate.CaseExecutionListener; //导入依赖的package包/类
@Test
public void testRepetitionRuleStandardEventsByDefaultPlanItemControl() {
  // given
  PlanItemControl defaultControl = createElement(humanTask, "DefaultControl_1", DefaultControl.class);
  RepetitionRule repetitionRule = createElement(defaultControl, "RepititionRule_1", RepetitionRule.class);
  ConditionExpression expression = createElement(repetitionRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(planItem, context);

  // then
  List<String> events = newActivity.getProperties().get(CmmnProperties.REPEAT_ON_STANDARD_EVENTS);
  assertNotNull(events);
  assertEquals(2, events.size());
  assertTrue(events.contains(CaseExecutionListener.COMPLETE));
  assertTrue(events.contains(CaseExecutionListener.TERMINATE));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:21,代码来源:HumanTaskPlanItemHandlerTest.java

示例12: testRepetitionRuleCustomStandardEventsByDefaultPlanItemControl

import org.camunda.bpm.engine.delegate.CaseExecutionListener; //导入依赖的package包/类
@Test
public void testRepetitionRuleCustomStandardEventsByDefaultPlanItemControl() {
  // given
  PlanItemControl defaultControl = createElement(humanTask, "DefaultControl_1", DefaultControl.class);
  RepetitionRule repetitionRule = createElement(defaultControl, "RepititionRule_1", RepetitionRule.class);
  ConditionExpression expression = createElement(repetitionRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  repetitionRule.setCamundaRepeatOnStandardEvent(CaseExecutionListener.DISABLE);

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(planItem, context);

  // then
  List<String> events = newActivity.getProperties().get(CmmnProperties.REPEAT_ON_STANDARD_EVENTS);
  assertNotNull(events);
  assertEquals(1, events.size());
  assertTrue(events.contains(CaseExecutionListener.DISABLE));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:22,代码来源:HumanTaskPlanItemHandlerTest.java

示例13: testRepetitionRuleStandardEventsByDefaultPlanItemControl

import org.camunda.bpm.engine.delegate.CaseExecutionListener; //导入依赖的package包/类
@Test
public void testRepetitionRuleStandardEventsByDefaultPlanItemControl() {
  // given
  PlanItemControl defaultControl = createElement(stage, "DefaultControl_1", DefaultControl.class);
  RepetitionRule repetitionRule = createElement(defaultControl, "RepititionRule_1", RepetitionRule.class);
  ConditionExpression expression = createElement(repetitionRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(planItem, context);

  // then
  List<String> events = newActivity.getProperties().get(CmmnProperties.REPEAT_ON_STANDARD_EVENTS);
  assertNotNull(events);
  assertEquals(2, events.size());
  assertTrue(events.contains(CaseExecutionListener.COMPLETE));
  assertTrue(events.contains(CaseExecutionListener.TERMINATE));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:21,代码来源:StagePlanItemHandlerTest.java

示例14: testRepetitionRuleCustomStandardEventsByDefaultPlanItemControl

import org.camunda.bpm.engine.delegate.CaseExecutionListener; //导入依赖的package包/类
@Test
public void testRepetitionRuleCustomStandardEventsByDefaultPlanItemControl() {
  // given
  PlanItemControl defaultControl = createElement(stage, "DefaultControl_1", DefaultControl.class);
  RepetitionRule repetitionRule = createElement(defaultControl, "RepititionRule_1", RepetitionRule.class);
  ConditionExpression expression = createElement(repetitionRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  repetitionRule.setCamundaRepeatOnStandardEvent(CaseExecutionListener.DISABLE);

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(planItem, context);

  // then
  List<String> events = newActivity.getProperties().get(CmmnProperties.REPEAT_ON_STANDARD_EVENTS);
  assertNotNull(events);
  assertEquals(1, events.size());
  assertTrue(events.contains(CaseExecutionListener.DISABLE));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:22,代码来源:StagePlanItemHandlerTest.java

示例15: testRepetitionRuleStandardEventsByDefaultPlanItemControl

import org.camunda.bpm.engine.delegate.CaseExecutionListener; //导入依赖的package包/类
@Test
public void testRepetitionRuleStandardEventsByDefaultPlanItemControl() {
  // given
  PlanItemControl defaultControl = createElement(decisionTask, "DefaultControl_1", DefaultControl.class);
  RepetitionRule repetitionRule = createElement(defaultControl, "RepititionRule_1", RepetitionRule.class);
  ConditionExpression expression = createElement(repetitionRule, "Expression_1", ConditionExpression.class);
  expression.setText("${true}");

  Cmmn.validateModel(modelInstance);

  // when
  CmmnActivity newActivity = handler.handleElement(planItem, context);

  // then
  List<String> events = newActivity.getProperties().get(CmmnProperties.REPEAT_ON_STANDARD_EVENTS);
  assertNotNull(events);
  assertEquals(2, events.size());
  assertTrue(events.contains(CaseExecutionListener.COMPLETE));
  assertTrue(events.contains(CaseExecutionListener.TERMINATE));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:21,代码来源:DecisionTaskPlanItemHandlerTest.java


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