/// <summary> /// Provide a context execution or resource definition in which context the invocation /// should be performed. If both parameters are null, the invocation is performed in the /// current context. /// </summary> /// <param name="contextExecution"> set to an execution </param> public DelegateInvocation(BaseDelegateExecution contextExecution, ResourceDefinitionEntity contextResource) { // This constructor forces sub classes to call it, thereby making it more visible // whether a context switch is going to be performed for them. this.contextExecution = contextExecution; this.contextResource = contextResource; }
protected internal virtual bool isCurrentContextExecution(BaseDelegateExecution execution) { //JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET: //ORIGINAL LINE: org.camunda.bpm.engine.impl.context.CoreExecutionContext<?> coreExecutionContext = org.camunda.bpm.engine.impl.context.Context.getCoreExecutionContext(); CoreExecutionContext <object> coreExecutionContext = Context.CoreExecutionContext; return(coreExecutionContext != null && coreExecutionContext.Execution == execution); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: protected void handleInvocationInContext(final DelegateInvocation invocation) throws Exception //JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: protected internal virtual void handleInvocationInContext(DelegateInvocation invocation) { CommandContext commandContext = Context.CommandContext; bool wasAuthorizationCheckEnabled = commandContext.AuthorizationCheckEnabled; bool wasUserOperationLogEnabled = commandContext.UserOperationLogEnabled; BaseDelegateExecution contextExecution = invocation.ContextExecution; ProcessEngineConfigurationImpl configuration = Context.ProcessEngineConfiguration; bool popExecutionContext = false; try { if (!configuration.AuthorizationEnabledForCustomCode) { // the custom code should be executed without authorization commandContext.disableAuthorizationCheck(); } try { commandContext.disableUserOperationLog(); try { if (contextExecution != null && !isCurrentContextExecution(contextExecution)) { popExecutionContext = setExecutionContext(contextExecution); } invocation.proceed(); } finally { if (popExecutionContext) { Context.removeExecutionContext(); } } } finally { if (wasUserOperationLogEnabled) { commandContext.enableUserOperationLog(); } } } finally { if (wasAuthorizationCheckEnabled) { commandContext.enableAuthorizationCheck(); } } }
/// <returns> true if the execution context is modified by this invocation </returns> protected internal virtual bool setExecutionContext(BaseDelegateExecution execution) { if (execution is ExecutionEntity) { Context.ExecutionContext = (ExecutionEntity)execution; return(true); } else if (execution is CaseExecutionEntity) { Context.ExecutionContext = (CaseExecutionEntity)execution; return(true); } return(false); }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: protected org.camunda.bpm.application.ProcessApplicationReference getProcessApplicationForInvocation(final DelegateInvocation invocation) protected internal virtual ProcessApplicationReference getProcessApplicationForInvocation(DelegateInvocation invocation) { BaseDelegateExecution contextExecution = invocation.ContextExecution; ResourceDefinitionEntity contextResource = invocation.ContextResource; if (contextExecution != null) { return(ProcessApplicationContextUtil.getTargetProcessApplication((CoreExecution)contextExecution)); } else if (contextResource != null) { return(ProcessApplicationContextUtil.getTargetProcessApplication(contextResource)); } else { return(null); } }
public TaskListenerInvocation(TaskListener taskListenerInstance, DelegateTask delegateTask, BaseDelegateExecution contextExecution) : base(contextExecution, null) { this.taskListenerInstance = taskListenerInstance; this.delegateTask = delegateTask; }
public ExpressionGetInvocation(ValueExpression valueExpression, ELContext elContext, BaseDelegateExecution contextExecution) : base(contextExecution, null) { this.valueExpression = valueExpression; this.elContext = elContext; }
public ScriptInvocation(ExecutableScript script, VariableScope scope, BaseDelegateExecution contextExecution) : base(contextExecution, null) { this.script = script; this.scope = scope; }
public InvocationContext(BaseDelegateExecution execution) { this.execution = execution; }
public virtual object getValue(VariableScope variableScope, BaseDelegateExecution contextExecution) { return(getValue(variableScope)); }
public CaseVariableListenerInvocation(CaseVariableListener variableListenerInstance, DelegateCaseVariableInstance variableInstance, BaseDelegateExecution contextExecution) : base(contextExecution, null) { this.variableListenerInstance = variableListenerInstance; this.variableInstance = variableInstance; }