Search in sources :

Example 61 with Expression

use of org.activiti.engine.delegate.Expression in project Activiti by Activiti.

the class IntermediateCatchSignalEventActivityBehavior method execute.

public void execute(DelegateExecution execution) {
    CommandContext commandContext = Context.getCommandContext();
    ExecutionEntity executionEntity = (ExecutionEntity) execution;
    String signalName = null;
    if (StringUtils.isNotEmpty(signalEventDefinition.getSignalRef())) {
        signalName = signalEventDefinition.getSignalRef();
    } else {
        Expression signalExpression = commandContext.getProcessEngineConfiguration().getExpressionManager().createExpression(signalEventDefinition.getSignalExpression());
        signalName = signalExpression.getValue(execution).toString();
    }
    commandContext.getEventSubscriptionEntityManager().insertSignalEvent(signalName, signal, executionEntity);
}
Also used : CommandContext(org.activiti.engine.impl.interceptor.CommandContext) ExecutionEntity(org.activiti.engine.impl.persistence.entity.ExecutionEntity) Expression(org.activiti.engine.delegate.Expression)

Aggregations

Expression (org.activiti.engine.delegate.Expression)61 ActivitiException (org.activiti.engine.ActivitiException)17 DelegateExecution (org.activiti.engine.delegate.DelegateExecution)13 AbstractServiceTest (org.finra.herd.service.AbstractServiceTest)12 Test (org.junit.Test)12 Test (org.junit.jupiter.api.Test)12 ExpressionManager (org.activiti.engine.impl.el.ExpressionManager)11 ExecutionEntity (org.activiti.engine.impl.persistence.entity.ExecutionEntity)8 Condition (org.activiti.engine.impl.Condition)6 Date (java.util.Date)5 ActivitiIllegalArgumentException (org.activiti.engine.ActivitiIllegalArgumentException)5 BusinessCalendar (org.activiti.engine.impl.calendar.BusinessCalendar)5 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)4 ProcessEngineConfigurationImpl (org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl)4 CommandContext (org.activiti.engine.impl.interceptor.CommandContext)4 JsonNode (com.fasterxml.jackson.databind.JsonNode)3 ArrayList (java.util.ArrayList)3 VariableScope (org.activiti.engine.delegate.VariableScope)3 CycleBusinessCalendar (org.activiti.engine.impl.calendar.CycleBusinessCalendar)3 DueDateBusinessCalendar (org.activiti.engine.impl.calendar.DueDateBusinessCalendar)3