use of org.camunda.bpm.engine.delegate.Expression in project camunda-bpm-platform by camunda.
the class ItemHandler method initializeCaseControlRule.
protected CaseControlRule initializeCaseControlRule(ConditionExpression condition, CmmnHandlerContext context) {
Expression expression = null;
if (condition != null) {
String rule = condition.getText();
if (rule != null && !rule.isEmpty()) {
ExpressionManager expressionManager = context.getExpressionManager();
expression = expressionManager.createExpression(rule);
}
}
return new CaseControlRuleImpl(expression);
}
use of org.camunda.bpm.engine.delegate.Expression in project camunda-bpm-platform by camunda.
the class ItemHandler method initializeVariableListener.
protected CaseVariableListener initializeVariableListener(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context, CamundaVariableListener listener) {
Collection<CamundaField> fields = listener.getCamundaFields();
List<FieldDeclaration> fieldDeclarations = initializeFieldDeclarations(element, activity, context, fields);
ExpressionManager expressionManager = context.getExpressionManager();
String className = listener.getCamundaClass();
String expression = listener.getCamundaExpression();
String delegateExpression = listener.getCamundaDelegateExpression();
CamundaScript scriptElement = listener.getCamundaScript();
CaseVariableListener variableListener = null;
if (className != null) {
variableListener = new ClassDelegateCaseVariableListener(className, fieldDeclarations);
} else if (expression != null) {
Expression expressionExp = expressionManager.createExpression(expression);
variableListener = new ExpressionCaseVariableListener(expressionExp);
} else if (delegateExpression != null) {
Expression delegateExp = expressionManager.createExpression(delegateExpression);
variableListener = new DelegateExpressionCaseVariableListener(delegateExp, fieldDeclarations);
} else if (scriptElement != null) {
ExecutableScript executableScript = initializeScript(element, activity, context, scriptElement);
if (executableScript != null) {
variableListener = new ScriptCaseVariableListener(executableScript);
}
}
return variableListener;
}
use of org.camunda.bpm.engine.delegate.Expression in project camunda-bpm-platform by camunda.
the class ItemHandler method initializeCaseExecutionListener.
protected CaseExecutionListener initializeCaseExecutionListener(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context, CamundaCaseExecutionListener listener) {
Collection<CamundaField> fields = listener.getCamundaFields();
List<FieldDeclaration> fieldDeclarations = initializeFieldDeclarations(element, activity, context, fields);
ExpressionManager expressionManager = context.getExpressionManager();
CaseExecutionListener caseExecutionListener = null;
String className = listener.getCamundaClass();
String expression = listener.getCamundaExpression();
String delegateExpression = listener.getCamundaDelegateExpression();
CamundaScript scriptElement = listener.getCamundaScript();
if (className != null) {
caseExecutionListener = new ClassDelegateCaseExecutionListener(className, fieldDeclarations);
} else if (expression != null) {
Expression expressionExp = expressionManager.createExpression(expression);
caseExecutionListener = new ExpressionCaseExecutionListener(expressionExp);
} else if (delegateExpression != null) {
Expression delegateExp = expressionManager.createExpression(delegateExpression);
caseExecutionListener = new DelegateExpressionCaseExecutionListener(delegateExp, fieldDeclarations);
} else if (scriptElement != null) {
ExecutableScript executableScript = initializeScript(element, activity, context, scriptElement);
if (executableScript != null) {
caseExecutionListener = new ScriptCaseExecutionListener(executableScript);
}
}
return caseExecutionListener;
}
use of org.camunda.bpm.engine.delegate.Expression in project camunda-bpm-platform by camunda.
the class HumanTaskItemHandler method initializeTaskDefinitionCandidateUsers.
protected void initializeTaskDefinitionCandidateUsers(CmmnElement element, TaskDefinition taskDefinition, CmmnHandlerContext context) {
HumanTask definition = getDefinition(element);
ExpressionManager expressionManager = context.getExpressionManager();
List<String> candidateUsers = definition.getCamundaCandidateUsersList();
for (String candidateUser : candidateUsers) {
Expression candidateUserExpression = expressionManager.createExpression(candidateUser);
taskDefinition.addCandidateUserIdExpression(candidateUserExpression);
}
}
use of org.camunda.bpm.engine.delegate.Expression in project camunda-bpm-platform by camunda.
the class HumanTaskItemHandler method initializeTaskDefinitionCandidateGroups.
protected void initializeTaskDefinitionCandidateGroups(CmmnElement element, TaskDefinition taskDefinition, CmmnHandlerContext context) {
HumanTask definition = getDefinition(element);
ExpressionManager expressionManager = context.getExpressionManager();
List<String> candidateGroups = definition.getCamundaCandidateGroupsList();
for (String candidateGroup : candidateGroups) {
Expression candidateGroupExpression = expressionManager.createExpression(candidateGroup);
taskDefinition.addCandidateGroupIdExpression(candidateGroupExpression);
}
}
Aggregations