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