Esempio n. 1
0
        public virtual void signalExecution(ExecutionTriggerDto triggerDto)
        {
            RuntimeService runtimeService = engine.RuntimeService;

            try
            {
                VariableMap variables = VariableValueDto.toMap(triggerDto.Variables, engine, objectMapper);
                runtimeService.signal(executionId, variables);
            }
            catch (RestException e)
            {
                string errorMessage = string.Format("Cannot signal execution {0}: {1}", executionId, e.Message);
                throw new InvalidRequestException(e.Status, e, errorMessage);
            }
            catch (AuthorizationException e)
            {
                throw e;
            }
            catch (ProcessEngineException e)
            {
                throw new RestException(Status.INTERNAL_SERVER_ERROR, e, "Cannot signal execution " + executionId + ": " + e.Message);
            }
        }
Esempio n. 2
0
        public virtual void triggerEvent(ExecutionTriggerDto triggerDto)
        {
            RuntimeService runtimeService = engine.RuntimeService;


            try
            {
                VariableMap variables = VariableValueDto.toMap(triggerDto.Variables, engine, objectMapper);
                runtimeService.messageEventReceived(messageName, executionId, variables);
            }
            catch (AuthorizationException e)
            {
                throw e;
            }
            catch (ProcessEngineException e)
            {
                throw new RestException(Status.INTERNAL_SERVER_ERROR, e, string.Format("Cannot trigger message {0} for execution {1}: {2}", messageName, executionId, e.Message));
            }
            catch (RestException e)
            {
                string errorMessage = string.Format("Cannot trigger message {0} for execution {1}: {2}", messageName, executionId, e.Message);
                throw new InvalidRequestException(e.Status, e, errorMessage);
            }
        }