Example #1
0
        public virtual void Complete(IDictionary <string, object> variables)
        {
            EnsureActive();

            ExecutionEntity associatedExecution = GetExecution();

            if (variables != null)
            {
                associatedExecution.Variables = variables;
            }

            DeleteFromExecutionAndRuntimeTable();

            ProduceHistoricExternalTaskSuccessfulEvent();

            associatedExecution.Signal(null, null);
        }
Example #2
0
        public virtual object Execute(CommandContext commandContext)
        {
            EnsureUtil.EnsureNotNull(typeof(BadUserRequestException), "executionId is null", "executionId", ExecutionId);

            ExecutionEntity execution = commandContext.ExecutionManager.FindExecutionById(ExecutionId);

            EnsureUtil.EnsureNotNull(typeof(BadUserRequestException), "execution " + ExecutionId + " doesn't exist", "execution", execution);

            foreach (ICommandChecker checker in commandContext.ProcessEngineConfiguration.CommandCheckers)
            {
                checker.CheckUpdateProcessInstance(execution);
            }

            if (ProcessVariables != null)
            {
                execution.Variables = ProcessVariables;
            }

            execution.Signal(SignalName, SignalData);
            return(null);
        }
Example #3
0
        public override void Execute(IJobHandlerConfiguration _configuration, ExecutionEntity execution,
                                     CommandContext commandContext, string tenantId)
        {
            TimerJobConfiguration configuration    = _configuration as TimerJobConfiguration;
            var          activityId                = configuration.TimerElementKey;
            ActivityImpl intermediateEventActivity = execution.GetProcessDefinition().FindActivity(activityId) as ActivityImpl;

            EnsureUtil.EnsureNotNull(
                "Error while firing timer: intermediate event activity " + configuration + " not found",
                "intermediateEventActivity", intermediateEventActivity);

            try
            {
                if (activityId.Equals(execution.ActivityId))
                {
                    // Regular Intermediate timer catch
                    execution.Signal("signal", null);
                }
            }
            catch (System.Exception e)
            {
                throw new ProcessEngineException("exception during timer execution: " + e.Message, e);
            }
        }