use of org.camunda.bpm.model.cmmn.VariableTransition in project camunda-bpm-platform by camunda.
the class SentryHandler method initializeVariableOnPart.
protected void initializeVariableOnPart(CamundaVariableOnPart variableOnPart, CmmnSentryDeclaration sentryDeclaration, CmmnHandlerContext context) {
VariableTransition variableTransition;
try {
variableTransition = variableOnPart.getVariableEvent();
} catch (IllegalArgumentException illegalArgumentexception) {
throw LOG.nonMatchingVariableEvents(sentryDeclaration.getId());
} catch (NullPointerException nullPointerException) {
throw LOG.nonMatchingVariableEvents(sentryDeclaration.getId());
}
String variableName = variableOnPart.getVariableName();
String variableEventName = variableTransition.name();
if (variableName != null) {
if (!sentryDeclaration.hasVariableOnPart(variableEventName, variableName)) {
CmmnVariableOnPartDeclaration variableOnPartDeclaration = new CmmnVariableOnPartDeclaration();
variableOnPartDeclaration.setVariableEvent(variableEventName);
variableOnPartDeclaration.setVariableName(variableName);
sentryDeclaration.addVariableOnParts(variableOnPartDeclaration);
}
} else {
throw LOG.emptyVariableName(sentryDeclaration.getId());
}
}
Aggregations