예제 #1
0
        public virtual void execute(TimerJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, string tenantId)
        {
            string       activityId = configuration.TimerElementKey;
            ActivityImpl intermediateEventActivity = execution.getProcessDefinition().findActivity(activityId);

            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);
                }
                else
                {
                    // Event based gateway
                    execution.executeEventHandlerActivity(intermediateEventActivity);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            catch (Exception e)
            {
                throw new ProcessEngineException("exception during timer execution: " + e.Message, e);
            }
        }
예제 #2
0
        public virtual void execute(TimerJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, string tenantId)
        {
            string       activityId = configuration.TimerElementKey;
            ActivityImpl eventSubprocessActivity = execution.getProcessDefinition().findActivity(activityId);

            if (eventSubprocessActivity != null)
            {
                execution.executeEventHandlerActivity(eventSubprocessActivity);
            }
            else
            {
                throw new ProcessEngineException("Error while triggering event subprocess using timer start event: cannot find activity with id '" + configuration + "'.");
            }
        }
예제 #3
0
        public virtual void execute(TimerJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, string tenantId)
        {
            DeploymentCache deploymentCache = Context.ProcessEngineConfiguration.DeploymentCache;

            string            definitionKey     = configuration.TimerElementKey;
            ProcessDefinition processDefinition = deploymentCache.findDeployedLatestProcessDefinitionByKeyAndTenantId(definitionKey, tenantId);

            try
            {
                startProcessInstance(commandContext, tenantId, processDefinition);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
예제 #4
0
            public virtual Void execute(CommandContext commandContext)
            {
                TimerEntity failedJob = (TimerEntity)commandContext.JobManager.findJobById(jobId);

                DateTime newDueDate = failedJob.calculateRepeat();

                if (newDueDate != null)
                {
                    failedJob.createNewTimerJob(newDueDate);

                    // update configuration of failed job
                    TimerJobConfiguration config = (TimerJobConfiguration)failedJob.JobHandlerConfiguration;
                    config.FollowUpJobCreated         = true;
                    failedJob.JobHandlerConfiguration = config;
                }

                return(null);
            }
예제 #5
0
        public virtual void execute(TimerJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, string tenantId)
        {
            string       activityId = configuration.TimerElementKey;
            ActivityImpl activity   = execution.getProcessDefinition().findActivity(activityId);

            ensureNotNull("Error while firing timer: boundary event activity " + configuration + " not found", "boundary event activity", activity);

            try
            {
                execution.executeEventHandlerActivity(activity);
            }
            catch (Exception e)
            {
                throw e;
            }
            catch (Exception e)
            {
                throw new ProcessEngineException("exception during timer execution: " + e.Message, e);
            }
        }
예제 #6
0
        public virtual IJobHandlerConfiguration NewConfiguration(string canonicalString)
        {
            var configParts = canonicalString.Split("\\" + JobHandlerConfigPropertyDelimiter, true);

            if (configParts.Length > 2)
            {
                throw new ProcessEngineException("Illegal timer job handler configuration: '" + canonicalString +
                                                 "': exprecting a one or two part configuration seperated by '" +
                                                 JobHandlerConfigPropertyDelimiter + "'.");
            }

            var configuration = new TimerJobConfiguration();

            configuration.timerElementKey = configParts[0];

            if (configParts.Length == 2)
            {
                configuration.followUpJobCreated =
                    JobHandlerConfigPropertyFollowUpJobCreated.Equals(configParts[1]);
            }

            return(configuration);
        }
예제 #7
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);
            }
        }
        public override void Execute(IJobHandlerConfiguration _configuration, ExecutionEntity execution,
                                     CommandContext commandContext, string tenantId)
        {
            TimerJobConfiguration configuration = _configuration as TimerJobConfiguration;
            var          activityId             = configuration.TimerElementKey;
            ActivityImpl activity = execution.GetProcessDefinition().FindActivity(activityId) as ActivityImpl;

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

            try
            {
                execution.ExecuteEventHandlerActivity(activity);
            }
            //catch (Exception e)
            //{
            //    throw e;
            //}
            catch (System.Exception e)
            {
                throw new ProcessEngineException("exception during timer execution: " + e.Message, e);
            }
        }