Search in sources :

Example 6 with ExpressionManager

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;
}
Also used : CamundaField(org.camunda.bpm.model.cmmn.instance.camunda.CamundaField) ExpressionManager(org.camunda.bpm.engine.impl.el.ExpressionManager) DelegateExpressionTaskListener(org.camunda.bpm.engine.impl.task.listener.DelegateExpressionTaskListener) FieldDeclaration(org.camunda.bpm.engine.impl.bpmn.parser.FieldDeclaration) Expression(org.camunda.bpm.engine.delegate.Expression) ExpressionTaskListener(org.camunda.bpm.engine.impl.task.listener.ExpressionTaskListener) DelegateExpressionTaskListener(org.camunda.bpm.engine.impl.task.listener.DelegateExpressionTaskListener) CamundaTaskListener(org.camunda.bpm.model.cmmn.instance.camunda.CamundaTaskListener) ExpressionTaskListener(org.camunda.bpm.engine.impl.task.listener.ExpressionTaskListener) ClassDelegateTaskListener(org.camunda.bpm.engine.impl.task.listener.ClassDelegateTaskListener) TaskListener(org.camunda.bpm.engine.delegate.TaskListener) DelegateExpressionTaskListener(org.camunda.bpm.engine.impl.task.listener.DelegateExpressionTaskListener) ScriptTaskListener(org.camunda.bpm.engine.impl.task.listener.ScriptTaskListener) ExecutableScript(org.camunda.bpm.engine.impl.scripting.ExecutableScript) ClassDelegateTaskListener(org.camunda.bpm.engine.impl.task.listener.ClassDelegateTaskListener) ScriptTaskListener(org.camunda.bpm.engine.impl.task.listener.ScriptTaskListener) CamundaScript(org.camunda.bpm.model.cmmn.instance.camunda.CamundaScript)

Example 7 with ExpressionManager

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);
    }
}
Also used : Role(org.camunda.bpm.model.cmmn.instance.Role) ExpressionManager(org.camunda.bpm.engine.impl.el.ExpressionManager) Expression(org.camunda.bpm.engine.delegate.Expression) HumanTask(org.camunda.bpm.model.cmmn.instance.HumanTask)

Example 8 with ExpressionManager

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);
    }
}
Also used : ExpressionManager(org.camunda.bpm.engine.impl.el.ExpressionManager) Expression(org.camunda.bpm.engine.delegate.Expression) HumanTask(org.camunda.bpm.model.cmmn.instance.HumanTask)

Example 9 with ExpressionManager

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);
}
Also used : ExpressionManager(org.camunda.bpm.engine.impl.el.ExpressionManager) ParameterValueProvider(org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider)

Example 10 with ExpressionManager

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);
    }
}
Also used : ExpressionManager(org.camunda.bpm.engine.impl.el.ExpressionManager) Element(org.camunda.bpm.engine.impl.util.xml.Element)

Aggregations

ExpressionManager (org.camunda.bpm.engine.impl.el.ExpressionManager)27 Expression (org.camunda.bpm.engine.delegate.Expression)14 HumanTask (org.camunda.bpm.model.cmmn.instance.HumanTask)8 ParameterValueProvider (org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider)5 FieldDeclaration (org.camunda.bpm.engine.impl.bpmn.parser.FieldDeclaration)4 ConditionExpression (org.camunda.bpm.model.cmmn.instance.ConditionExpression)4 CamundaString (org.camunda.bpm.model.cmmn.instance.camunda.CamundaString)4 ExecutableScript (org.camunda.bpm.engine.impl.scripting.ExecutableScript)3 CamundaExpression (org.camunda.bpm.model.cmmn.instance.camunda.CamundaExpression)3 CamundaField (org.camunda.bpm.model.cmmn.instance.camunda.CamundaField)3 CamundaScript (org.camunda.bpm.model.cmmn.instance.camunda.CamundaScript)3 HumanTaskActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.HumanTaskActivityBehavior)2 CaseDefinitionEntity (org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity)2 CallableElementParameter (org.camunda.bpm.engine.impl.core.model.CallableElementParameter)2 TaskDefinition (org.camunda.bpm.engine.impl.task.TaskDefinition)2 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)1 CaseExecutionListener (org.camunda.bpm.engine.delegate.CaseExecutionListener)1 CaseVariableListener (org.camunda.bpm.engine.delegate.CaseVariableListener)1 TaskListener (org.camunda.bpm.engine.delegate.TaskListener)1 NotValidException (org.camunda.bpm.engine.exception.NotValidException)1