use of org.camunda.bpm.engine.impl.el.ExpressionManager in project camunda-bpm-platform by camunda.
the class HumanTaskItemHandler method initializeTaskListener.
protected TaskListener initializeTaskListener(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context, CamundaTaskListener listener) {
Collection<CamundaField> fields = listener.getCamundaFields();
List<FieldDeclaration> fieldDeclarations = initializeFieldDeclarations(element, activity, context, fields);
ExpressionManager expressionManager = context.getExpressionManager();
TaskListener taskListener = null;
String className = listener.getCamundaClass();
String expression = listener.getCamundaExpression();
String delegateExpression = listener.getCamundaDelegateExpression();
CamundaScript scriptElement = listener.getCamundaScript();
if (className != null) {
taskListener = new ClassDelegateTaskListener(className, fieldDeclarations);
} else if (expression != null) {
Expression expressionExp = expressionManager.createExpression(expression);
taskListener = new ExpressionTaskListener(expressionExp);
} else if (delegateExpression != null) {
Expression delegateExp = expressionManager.createExpression(delegateExpression);
taskListener = new DelegateExpressionTaskListener(delegateExp, fieldDeclarations);
} else if (scriptElement != null) {
ExecutableScript executableScript = initializeScript(element, activity, context, scriptElement);
if (executableScript != null) {
taskListener = new ScriptTaskListener(executableScript);
}
}
return taskListener;
}
use of org.camunda.bpm.engine.impl.el.ExpressionManager in project camunda-bpm-platform by camunda.
the class HumanTaskItemHandler method initializeTaskDefinitionAssignee.
protected void initializeTaskDefinitionAssignee(CmmnElement element, TaskDefinition taskDefinition, CmmnHandlerContext context) {
HumanTask definition = getDefinition(element);
Role performer = definition.getPerformer();
String assignee = null;
if (performer != null) {
assignee = performer.getName();
} else {
assignee = definition.getCamundaAssignee();
}
if (assignee != null) {
ExpressionManager expressionManager = context.getExpressionManager();
Expression assigneeExpression = expressionManager.createExpression(assignee);
taskDefinition.setAssigneeExpression(assigneeExpression);
}
}
use of org.camunda.bpm.engine.impl.el.ExpressionManager in project camunda-bpm-platform by camunda.
the class HumanTaskItemHandler method initializeTaskDefinitionFollowUpDate.
protected void initializeTaskDefinitionFollowUpDate(CmmnElement element, TaskDefinition taskDefinition, CmmnHandlerContext context) {
HumanTask definition = getDefinition(element);
String followUpDate = definition.getCamundaFollowUpDate();
if (followUpDate != null) {
ExpressionManager expressionManager = context.getExpressionManager();
Expression followUpDateExpression = expressionManager.createExpression(followUpDate);
taskDefinition.setFollowUpDateExpression(followUpDateExpression);
}
}
use of org.camunda.bpm.engine.impl.el.ExpressionManager in project camunda-bpm-platform by camunda.
the class CallingTaskItemHandler method initializeDefinitionKey.
protected void initializeDefinitionKey(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context, BaseCallableElement callableElement) {
ExpressionManager expressionManager = context.getExpressionManager();
String definitionKey = getDefinitionKey(element, activity, context);
ParameterValueProvider definitionKeyProvider = createParameterValueProvider(definitionKey, expressionManager);
callableElement.setDefinitionKeyValueProvider(definitionKeyProvider);
}
use of org.camunda.bpm.engine.impl.el.ExpressionManager in project camunda-bpm-platform by camunda.
the class DefaultFormHandler method parseConfiguration.
public void parseConfiguration(Element activityElement, DeploymentEntity deployment, ProcessDefinitionEntity processDefinition, BpmnParse bpmnParse) {
this.deploymentId = deployment.getId();
ExpressionManager expressionManager = Context.getProcessEngineConfiguration().getExpressionManager();
Element extensionElement = activityElement.element("extensionElements");
if (extensionElement != null) {
// provide support for deprecated form properties
parseFormProperties(bpmnParse, expressionManager, extensionElement);
// provide support for new form field metadata
parseFormData(bpmnParse, expressionManager, extensionElement);
}
}
Aggregations