Exemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected void performNotification(final org.camunda.bpm.engine.delegate.DelegateExecution execution, java.util.concurrent.Callable<Void> notification) throws Exception
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
        protected internal virtual void performNotification(DelegateExecution execution, Callable <Void> notification)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.application.ProcessApplicationReference processApp = org.camunda.bpm.engine.impl.context.ProcessApplicationContextUtil.getTargetProcessApplication((org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity) execution);
            ProcessApplicationReference processApp = ProcessApplicationContextUtil.getTargetProcessApplication((ExecutionEntity)execution);

            if (processApp == null)
            {
                // ignore silently
                LOG.noTargetProcessApplicationForExecution(execution);
            }
            else
            {
                if (ProcessApplicationContextUtil.requiresContextSwitch(processApp))
                {
                    // this should not be necessary since context switch is already performed by OperationContext and / or DelegateInterceptor
                    Context.executeWithinProcessApplication(notification, processApp, new InvocationContext(execution));
                }
                else
                {
                    // context switch already performed
                    notification.call();
                }
            }
        }
Exemplo n.º 2
0
                public ProcessApplicationReference execute(CommandContext commandContext)
                {
                    ProcessEngineConfigurationImpl configuration = commandContext.ProcessEngineConfiguration;
                    DeploymentCache deploymentCache = configuration.DeploymentCache;
                    DecisionRequirementsDefinitionEntity definition = deploymentCache.findDeployedDecisionRequirementsDefinitionById(definitionId);

                    return(ProcessApplicationContextUtil.getTargetProcessApplication(definition));
                }
Exemplo n.º 3
0
 protected internal virtual bool shouldPerformPaContextSwitch(DelegateExecution execution)
 {
     if (execution == null)
     {
         return(false);
     }
     else
     {
         ProcessApplicationReference targetPa = ProcessApplicationContextUtil.getTargetProcessApplication((ExecutionEntity)execution);
         return(targetPa != null && !targetPa.Equals(Context.CurrentProcessApplication));
     }
 }
Exemplo n.º 4
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: protected <T> T performContextSwitch(final java.util.concurrent.Callable<T> callable)
        protected internal virtual T performContextSwitch <T>(Callable <T> callable)
        {
            ProcessApplicationReference targetProcessApplication = ProcessApplicationContextUtil.getTargetProcessApplication(deploymentId);

            if (targetProcessApplication != null)
            {
                return(Context.executeWithinProcessApplication(new CallableAnonymousInnerClass(this, callable)
                                                               , targetProcessApplication));
            }
            else
            {
                return(doCall(callable));
            }
        }
Exemplo n.º 5
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public Object resolveDelegateClass(final org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution execution)
        public virtual object resolveDelegateClass(ActivityExecution execution)
        {
            ProcessApplicationReference targetProcessApplication = ProcessApplicationContextUtil.getTargetProcessApplication((ExecutionEntity)execution);

            if (ProcessApplicationContextUtil.requiresContextSwitch(targetProcessApplication))
            {
                return(Context.executeWithinProcessApplication(new CallableAnonymousInnerClass(this, execution)
                                                               , targetProcessApplication, new InvocationContext(execution)));
            }
            else
            {
                return(instantiateDelegateClass(execution));
            }
        }
Exemplo n.º 6
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override public void signal(final org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution execution, final String signalName, final Object signalData) throws Exception
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
        public virtual void signal(ActivityExecution execution, string signalName, object signalData)
        {
            ProcessApplicationReference targetProcessApplication = ProcessApplicationContextUtil.getTargetProcessApplication((ExecutionEntity)execution);

            if (ProcessApplicationContextUtil.requiresContextSwitch(targetProcessApplication))
            {
                Context.executeWithinProcessApplication(new CallableAnonymousInnerClass(this, execution, signalName, signalData)
                                                        , targetProcessApplication, new InvocationContext(execution));
            }
            else
            {
                doSignal(execution, signalName, signalData);
            }
        }
Exemplo n.º 7
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: @Override public boolean validate(final Object submittedValue, final FormFieldValidatorContext validatorContext)
        public virtual bool validate(object submittedValue, FormFieldValidatorContext validatorContext)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.engine.delegate.DelegateExecution execution = validatorContext.getExecution();
            DelegateExecution execution = validatorContext.Execution;

            if (shouldPerformPaContextSwitch(validatorContext.Execution))
            {
                ProcessApplicationReference processApplicationReference = ProcessApplicationContextUtil.getTargetProcessApplication((ExecutionEntity)execution);

                return(Context.executeWithinProcessApplication(new CallableAnonymousInnerClass(this, submittedValue, validatorContext)
                                                               , processApplicationReference, new InvocationContext(execution)));
            }
            else
            {
                return(doValidate(submittedValue, validatorContext));
            }
        }
Exemplo n.º 8
0
 protected internal virtual bool isSymptomOfContextSwitchFailure(Exception t, ExecutionEntity contextExecution)
 {
     // a context switch failure can occur, if the current engine has no PA registration for the deployment
     // subclasses may assert the actual throwable to narrow down the diagnose
     return(ProcessApplicationContextUtil.getTargetProcessApplication(contextExecution) == null);
 }
Exemplo n.º 9
0
 protected internal virtual ProcessApplicationReference getTargetProcessApplication(CaseExecutionEntity execution)
 {
     return(ProcessApplicationContextUtil.getTargetProcessApplication(execution));
 }