use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class TaskActivityBehavior method isBlocking.
protected boolean isBlocking(CmmnActivityExecution execution) {
CmmnActivity activity = execution.getActivity();
Object isBlockingProperty = activity.getProperty(PROPERTY_IS_BLOCKING);
if (isBlockingProperty != null && isBlockingProperty instanceof Boolean) {
return (Boolean) isBlockingProperty;
}
return false;
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class ProcessTaskPlanItemExecutionListenerHandlerTest method testCaseExecutionListener.
@Test
public void testCaseExecutionListener() {
// given:
testSpecification.addListenerToElement(modelInstance, processTask);
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
testSpecification.verify(activity);
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class SentryHandlerTest method testSentryWithOnPart.
@Test
public void testSentryWithOnPart() {
// given
CmmnActivity casePlanModelActivity = new CasePlanModelHandler().handleElement(casePlanModel, context);
context.setParent(casePlanModelActivity);
CmmnSentryDeclaration sentryDeclaration = sentryHandler.handleElement(sentry, context);
CmmnActivity source = taskItemHandler.handleElement(planItem, context);
// when
sentryHandler.initializeOnParts(sentry, context);
// then
assertNotNull(sentryDeclaration);
List<CmmnOnPartDeclaration> onParts = sentryDeclaration.getOnParts();
assertNotNull(onParts);
assertFalse(onParts.isEmpty());
assertEquals(1, onParts.size());
List<CmmnOnPartDeclaration> onPartsAssociatedWithSource = sentryDeclaration.getOnParts(source.getId());
assertNotNull(onPartsAssociatedWithSource);
assertFalse(onPartsAssociatedWithSource.isEmpty());
assertEquals(1, onParts.size());
CmmnOnPartDeclaration onPartDeclaration = onPartsAssociatedWithSource.get(0);
assertNotNull(onPartDeclaration);
// source
assertEquals(source, onPartDeclaration.getSource());
assertEquals(onPart.getSource().getId(), onPartDeclaration.getSource().getId());
// standardEvent
assertEquals(onPart.getStandardEvent().name(), onPartDeclaration.getStandardEvent());
// sentry
assertNull(onPartDeclaration.getSentry());
assertNull(sentryDeclaration.getIfPart());
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class SentryHandlerTest method testSentryWithOnPartReferencesSentry.
@Test
public void testSentryWithOnPartReferencesSentry() {
// given
Sentry exitSentry = createElement(casePlanModel, "anotherSentry", Sentry.class);
IfPart ifPart = createElement(exitSentry, "IfPart_1", IfPart.class);
ConditionExpression conditionExpression = createElement(ifPart, "con_1", ConditionExpression.class);
Body body = createElement(conditionExpression, null, Body.class);
body.setTextContent("${test}");
onPart.setSentry(exitSentry);
CmmnActivity casePlanModelActivity = new CasePlanModelHandler().handleElement(casePlanModel, context);
context.setParent(casePlanModelActivity);
CmmnSentryDeclaration sentryDeclaration = sentryHandler.handleElement(sentry, context);
CmmnSentryDeclaration exitSentryDeclaration = sentryHandler.handleElement(exitSentry, context);
CmmnActivity source = taskItemHandler.handleElement(planItem, context);
// when
sentryHandler.initializeOnParts(sentry, context);
// then
assertNotNull(sentryDeclaration);
List<CmmnOnPartDeclaration> onParts = sentryDeclaration.getOnParts();
assertNotNull(onParts);
assertFalse(onParts.isEmpty());
assertEquals(1, onParts.size());
List<CmmnOnPartDeclaration> onPartsAssociatedWithSource = sentryDeclaration.getOnParts(source.getId());
assertNotNull(onPartsAssociatedWithSource);
assertFalse(onPartsAssociatedWithSource.isEmpty());
assertEquals(1, onParts.size());
CmmnOnPartDeclaration onPartDeclaration = onPartsAssociatedWithSource.get(0);
assertNotNull(onPartDeclaration);
// source
assertEquals(source, onPartDeclaration.getSource());
assertEquals(onPart.getSource().getId(), onPartDeclaration.getSource().getId());
// standardEvent
assertEquals(onPart.getStandardEvent().name(), onPartDeclaration.getStandardEvent());
// sentry
assertNotNull(onPartDeclaration.getSentry());
assertEquals(exitSentryDeclaration, onPartDeclaration.getSentry());
assertNull(sentryDeclaration.getIfPart());
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class HumanTaskDicretionaryItemHandlerTest method testIsBlockingEqualsFalseProperty.
@Test
public void testIsBlockingEqualsFalseProperty() {
// given:
// a humanTask with isBlocking = false
humanTask.setIsBlocking(false);
// when
CmmnActivity activity = handler.handleElement(discretionaryItem, context);
// then
// According to the specification:
// When a HumanTask is not 'blocking'
// (isBlocking is 'false'), it can be
// considered a 'manual' Task, i.e.,
// the Case management system is not
// tracking the lifecycle of the HumanTask (instance).
assertNull(activity);
}
Aggregations