public virtual void attachState(MigratingScopeInstance owningInstance) { ExecutionEntity representativeExecution = owningInstance.resolveRepresentativeExecution(); representativeExecution.addExternalTask(externalTask); externalTask.Execution = representativeExecution; }
public WalkConditionAnonymousInnerClass2(AbstractInstantiationCmd outerInstance, ProcessDefinitionImpl processDefinition, ActivityExecutionTreeMapping mapping, ExecutionEntity ancestorScopeExecution, PvmScope ancestorScope) { this.outerInstance = outerInstance; this.processDefinition = processDefinition; this.mapping = mapping; this.ancestorScopeExecution = ancestorScopeExecution; this.ancestorScope = ancestorScope; }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Deployment public void testExecutionExternalTask() public virtual void testExecutionExternalTask() { runtimeService.startProcessInstanceByKey("oneExternalTaskProcess"); ExecutionEntity execution = (ExecutionEntity)runtimeService.createExecutionQuery().activityId("externalTask").singleResult(); assertEquals(BitMaskUtil.getMaskForBit(ExecutionEntity.EXTERNAL_TASKS_BIT), execution.CachedEntityStateRaw); }
public virtual void execute(JobHandlerConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, string tenantId) { if (exceptionsRemaining.decrementAndGet() >= 0) { throw new Exception("exception remaining: " + exceptionsRemaining); } LOG.info("no more exceptions to throw."); }
protected internal virtual void CheckDeleteProcessInstance(ExecutionEntity execution, CommandContext commandContext) { foreach (var checker in commandContext.ProcessEngineConfiguration.CommandCheckers) { checker.CheckDeleteProcessInstance(execution); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Deployment public void testProcessInstanceTasks() public virtual void testProcessInstanceTasks() { runtimeService.startProcessInstanceByKey("testProcess"); ExecutionEntity processInstance = (ExecutionEntity)runtimeService.createProcessInstanceQuery().singleResult(); assertEquals(BitMaskUtil.getMaskForBit(ExecutionEntity.TASKS_STATE_BIT), processInstance.CachedEntityStateRaw); }
public virtual void deleteExecution(ExecutionEntity execution) { DbEntityManager.delete(execution); if (execution.ProcessInstanceExecution) { deleteAuthorizations(Resources.PROCESS_INSTANCE, execution.ProcessInstanceId); } }
protected internal virtual void AddEventToScopeExecution(ExecutionEntity sourceScope, VariableEvent @event) { // ignore events of variables that are not set in an execution ExecutionEntity sourceExecution = sourceScope; ExecutionEntity scopeExecution = (ExecutionEntity)(sourceExecution.IsScope ? sourceExecution : sourceExecution.Parent); scopeExecution.DelayEvent((ExecutionEntity)TargetScope, @event); }
public virtual void Execute(IJobHandlerConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, string tenantId) { var cmd = GetCommand((JobDefinitionSuspensionStateConfiguration)configuration); cmd.DisableLogUserOperation(); cmd.Execute(commandContext); }
/// <summary> /// 添加一个执行器到队列queuedInvocations并执行 /// </summary> /// <param name="executionOperation">执行器</param> /// <param name="execution"></param> /// <param name="performAsync">是否异步</param> public virtual void PerformOperation(IAtomicOperation executionOperation, ExecutionEntity execution, bool performAsync) { AtomicOperationInvocation invocation = new AtomicOperationInvocation(executionOperation, execution, performAsync); queuedInvocations.Enqueue(invocation);//.Insert(0, invocation); PerformNext(); }
public virtual void DebugNoTargetProcessApplicationFound(ExecutionEntity execution, ProcessApplicationManager processApplicationManager) { LogDebug("023", "no target process application found for Execution[{0}], ProcessDefinition[{1}], Deployment[{2}] Registrations[{3}]", execution.Id, execution.ProcessDefinitionId, execution.ProcessDefinition.DeploymentId, processApplicationManager.RegistrationSummary); }
protected internal override long?GetProcessDefinitionPriority(ExecutionEntity execution, IJobDeclaration jobDeclaration) { var processDefinition = jobDeclaration.ProcessDefinition; return(GetProcessDefinedPriority(processDefinition, BpmnParse.PropertynameJobPriority, execution, DescribeContext(jobDeclaration, execution))); }
public static CorrelationHandlerResult MatchedExecution(ExecutionEntity executionEntity) { var messageCorrelationResult = new CorrelationHandlerResult(); messageCorrelationResult.resultType = MessageCorrelationResultType.Execution; messageCorrelationResult.executionEntity = executionEntity; return(messageCorrelationResult); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Deployment public void testProcessInstanceEventSubscriptions() public virtual void testProcessInstanceEventSubscriptions() { runtimeService.startProcessInstanceByKey("testProcess"); ExecutionEntity processInstance = (ExecutionEntity)runtimeService.createProcessInstanceQuery().singleResult(); assertEquals(BitMaskUtil.getMaskForBit(ExecutionEntity.EVENT_SUBSCRIPTIONS_STATE_BIT), processInstance.CachedEntityStateRaw); }
public HistoryEventCreatorAnonymousInnerClass(DefaultFormHandler outerInstance, ExecutionEntity executionEntity, string taskId, string stringValue) { this._outerInstance = outerInstance; this._executionEntity = executionEntity; this._taskId = taskId; this._stringValue = stringValue; }
protected internal virtual void InitTaskInstanceEvent(HistoricTaskInstanceEventEntity evt, TaskEntity taskEntity, IHistoryEventType eventType) { string processDefinitionKey = null; ProcessDefinitionEntity definition = taskEntity.ProcessDefinition; if (definition != null) { processDefinitionKey = definition.Key; } string processDefinitionId = taskEntity.ProcessDefinitionId; string processInstanceId = taskEntity.ProcessInstanceId; string executionId = taskEntity.ExecutionId; string caseDefinitionKey = null; //CaseDefinitionEntity caseDefinition = taskEntity.CaseDefinition; //if (caseDefinition != null) //{ // caseDefinitionKey = caseDefinition.Key; //} string caseDefinitionId = taskEntity.CaseDefinitionId; string caseExecutionId = taskEntity.CaseExecutionId; string caseInstanceId = taskEntity.CaseInstanceId; string tenantId = taskEntity.TenantId; evt.Id = taskEntity.Id; evt.EventType = eventType.EventName; evt.TaskId = taskEntity.Id; evt.ProcessDefinitionKey = processDefinitionKey; evt.ProcessDefinitionId = processDefinitionId; evt.ProcessInstanceId = processInstanceId; evt.ExecutionId = executionId; evt.CaseDefinitionKey = caseDefinitionKey; evt.CaseDefinitionId = caseDefinitionId; evt.CaseExecutionId = caseExecutionId; evt.CaseInstanceId = caseInstanceId; evt.Assignee = taskEntity.Assignee; evt.Description = taskEntity.Description; evt.DueDate = taskEntity.DueDate; evt.FollowUpDate = taskEntity.FollowUpDate; evt.Name = taskEntity.Name; evt.Owner = taskEntity.Owner; evt.ParentTaskId = taskEntity.ParentTaskId; evt.Priority = taskEntity.Priority; evt.TaskDefinitionKey = taskEntity.TaskDefinitionKey; evt.TenantId = tenantId; ExecutionEntity execution = taskEntity.GetExecution(); if (execution != null) { evt.ActivityInstanceId = execution.ActivityInstanceId; } }
protected internal virtual void InitializeConfiguration(ExecutionEntity context, TimerEntity job) { var businessCalendar = Context.ProcessEngineConfiguration.BusinessCalendarManager.GetBusinessCalendar(Type.GetDescription()); if (Description == null) { throw new ProcessEngineException("Timer '" + context.ActivityId + "' was not configured with a valid duration/time"); } string dueDateString = null; //throw new NotImplementedException(); DateTime?duedate = null; // ACT-1415: timer-declaration on start-event may contain expressions NOT // evaluating variables but other context, evaluating should happen nevertheless IVariableScope scopeForExpression = context; if (scopeForExpression == null) { scopeForExpression = StartProcessVariableScope.SharedInstance; } var dueDateValue = Description.GetValue(scopeForExpression); if (dueDateValue is string) { dueDateString = (string)dueDateValue; } else if (dueDateValue is DateTime) { duedate = (DateTime)dueDateValue; } else { throw new ProcessEngineException("Timer '" + context.ActivityId + "' was not configured with a valid duration/time, either hand in a java.Util.Date or a String in format 'yyyy-MM-dd'T'hh:mm:ss'"); } //throw new NotImplementedException(); if (duedate == null) { duedate = businessCalendar.ResolveDuedate(dueDateString); } job.Duedate = (DateTime)duedate; if (Type == TimerDeclarationType.Cycle && !ReferenceEquals(jobHandlerType, TimerCatchIntermediateEventJobHandler.TYPE)) { // See ACT-1427: A boundary timer with a cancelActivity='true', doesn't need to repeat itself if (!IsInterruptingTimer) { var prepared = PrepareRepeat(dueDateString); job.Repeat = prepared; } } }
public void Execute(IJobHandlerConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, string tenantId) { var conf = (HistoryCleanupJobHandlerConfiguration)configuration; //find JobEntity JobEntity jobEntity = commandContext.JobManager.FindJobByHandlerType(Type); bool rescheduled = false; if (conf.ImmediatelyDue || (HistoryCleanupHelper.IsBatchWindowConfigured(commandContext) && HistoryCleanupHelper.IsWithinBatchWindow(ClockUtil.CurrentTime, commandContext))) { //find data to delete HistoryCleanupBatch nextBatch = HistoryCleanupHelper.GetNextBatch(commandContext); if (nextBatch.Size() >= GetBatchSizeThreshold(commandContext)) { //delete bunch of data nextBatch.PerformCleanup(); //ReSchedule now commandContext.JobManager.ReSchedule(jobEntity, ClockUtil.CurrentTime); rescheduled = true; CancelCountEmptyRuns(conf, jobEntity); } else { //still have something to delete if (nextBatch.Size() > 0) { nextBatch.PerformCleanup(); } //not enough data for cleanup was found if (HistoryCleanupHelper.IsWithinBatchWindow(ClockUtil.CurrentTime, commandContext)) { //ReSchedule after some delay DateTime nextRunDate = conf.GetNextRunWithDelay(ClockUtil.CurrentTime); if (HistoryCleanupHelper.IsWithinBatchWindow(nextRunDate, commandContext)) { commandContext.JobManager.ReSchedule(jobEntity, nextRunDate); rescheduled = true; IncrementCountEmptyRuns(conf, jobEntity); } } } } if (!rescheduled) { if (HistoryCleanupHelper.IsBatchWindowConfigured(commandContext)) { ReScheduleRegularCall(commandContext, jobEntity); } else { //nothing more to do, suspend the job SuspendJob(jobEntity); } CancelCountEmptyRuns(conf, jobEntity); } }
public virtual void submit(MigratingEventScopeInstance compensationInstance) { ExecutionEntity scopeExecution = compensationInstance.resolveRepresentativeExecution(); if (scopeExecution != null) { compensationInstances[scopeExecution.Id] = compensationInstance; } }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: protected void leaveExecution(org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution execution, final org.camunda.bpm.engine.impl.pvm.PvmActivity currentActivity, org.camunda.bpm.engine.impl.bpmn.parser.EscalationEventDefinition escalationEventDefinition) protected internal virtual void leaveExecution(ActivityExecution execution, PvmActivity currentActivity, EscalationEventDefinition escalationEventDefinition) { // execution tree could have been expanded by triggering a non-interrupting event ExecutionEntity replacingExecution = ((ExecutionEntity)execution).ReplacedBy; ExecutionEntity leavingExecution = (ExecutionEntity)(replacingExecution != null ? replacingExecution : execution); leave(leavingExecution); }
/// <summary> /// When executing an async job for an activity wrapped in an miBody, set the execution to the /// miBody except the wrapped activity is marked as async. /// /// Background: in <= 7.2 async jobs were created for the inner activity, although the /// semantics are that they are executed before the miBody is entered /// </summary> public static void repairMultiInstanceAsyncJob(ExecutionEntity execution) { ActivityImpl activity = execution.getActivity(); if (!isAsync(activity) && isActivityWrappedInMultiInstanceBody(activity)) { execution.setActivity((ActivityImpl)activity.FlowScope); } }
public virtual void checkReadProcessInstance(string processInstanceId) { ExecutionEntity execution = findExecutionById(processInstanceId); if (execution != null) { checkReadProcessInstance(execution); } }
public virtual void checkUpdateProcessInstanceSuspensionStateById(string processInstanceId) { ExecutionEntity execution = findExecutionById(processInstanceId); if (execution != null) { checkUpdateProcessInstanceSuspensionState(execution); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void notify(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void notify(DelegateExecution execution) { ExecutionEntity executionEntity = (ExecutionEntity)execution; long sequenceCounter = executionEntity.SequenceCounter; string activityId = executionEntity.ActivityId; activityExecutionOrder.Add(new ActivitySequenceCounterMap(this, activityId, sequenceCounter)); }
// helper /////////////////////////////////////////////////////////// protected internal virtual void createDefaultAuthorizations(ExecutionEntity execution) { if (execution.ProcessInstanceExecution && AuthorizationEnabled) { ResourceAuthorizationProvider provider = ResourceAuthorizationProvider; AuthorizationEntity[] authorizations = provider.newProcessInstance(execution); saveDefaultAuthorizations(authorizations); } }
protected internal virtual void checkExecutionMessageCorrelationResult(MessageCorrelationResult result, ProcessInstance processInstance, string activityId) { assertNotNull(result); assertEquals(MessageCorrelationResultType.Execution, result.ResultType); assertEquals(processInstance.Id, result.Execution.ProcessInstanceId); ExecutionEntity entity = (ExecutionEntity)result.Execution; assertEquals(activityId, entity.ActivityId); }
private void persistVariable(string variableName, object scopedObject) { ProcessInstance processInstance = Context.ExecutionContext.ProcessInstance; ExecutionEntity executionEntity = (ExecutionEntity)processInstance; //JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method: Assert.isTrue(scopedObject is Serializable, "the scopedObject is not " + typeof(Serializable).FullName + "!"); executionEntity.setVariable(variableName, scopedObject); }
public virtual void Execute(IJobHandlerConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, string tenantId) { if (Interlocked.Decrement(ref exceptionsRemaining) >= 0) { throw new System.Exception("exception remaining: " + ExceptionsRemaining); } Debug.WriteLine("no more exceptions to throw."); }
public virtual void CancelTimers(ExecutionEntity execution) { IList <TimerEntity> timers = context.Impl.Context.CommandContext.JobManager.FindTimersByExecutionId(execution.Id); foreach (TimerEntity timer in timers) { timer.Delete(); } }
public CallableAnonymousInnerClass(AbstractDeleteProcessInstanceCmd outerInstance, CommandContext commandContext, string deleteReason, bool skipCustomListeners, bool skipIoMappings, ExecutionEntity superExecution) { this.outerInstance = outerInstance; this.commandContext = commandContext; this.deleteReason = deleteReason; this.skipCustomListeners = skipCustomListeners; this.skipIoMappings = skipIoMappings; this.superExecution = superExecution; }