コード例 #1
0
        protected internal virtual void initializeDefinitionKey(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context, BaseCallableElement callableElement)
        {
            ExpressionManager      expressionManager     = context.ExpressionManager;
            string                 definitionKey         = getDefinitionKey(element, activity, context);
            ParameterValueProvider definitionKeyProvider = createParameterValueProvider(definitionKey, expressionManager);

            callableElement.DefinitionKeyValueProvider = definitionKeyProvider;
        }
コード例 #2
0
        protected internal virtual void initializeVersion(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context, BaseCallableElement callableElement)
        {
            ExpressionManager      expressionManager = context.ExpressionManager;
            string                 version           = getVersion(element, activity, context);
            ParameterValueProvider versionProvider   = createParameterValueProvider(version, expressionManager);

            callableElement.VersionValueProvider = versionProvider;
        }
コード例 #3
0
        protected internal virtual void initializeTenantId(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context, BaseCallableElement callableElement)
        {
            ParameterValueProvider tenantIdProvider;

            ExpressionManager expressionManager = context.ExpressionManager;
            string            tenantId          = getTenantId(element, activity, context);

            if (!string.ReferenceEquals(tenantId, null) && tenantId.Length > 0)
            {
                tenantIdProvider = createParameterValueProvider(tenantId, expressionManager);
            }
            else
            {
                tenantIdProvider = new DefaultCallableElementTenantIdProvider();
            }

            callableElement.TenantIdProvider = tenantIdProvider;
        }
コード例 #4
0
        public override void parseConfiguration(Element activityElement, DeploymentEntity deployment, ProcessDefinitionEntity processDefinition, BpmnParse bpmnParse)
        {
            base.parseConfiguration(activityElement, deployment, processDefinition, bpmnParse);

            ExpressionManager expressionManager = Context.ProcessEngineConfiguration.ExpressionManager;

            string formKeyAttribute = activityElement.attributeNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, "formKey");

            if (!string.ReferenceEquals(formKeyAttribute, null))
            {
                this.formKey = expressionManager.createExpression(formKeyAttribute);
            }

            if (formKey != null)
            {
                processDefinition.StartFormKey = true;
            }
        }
コード例 #5
0
 /// <summary>
 /// Creates a new <seealso cref="ExecutableScript"/> from a source. It excepts static and dynamic sources.
 /// Dynamic means that the source is an expression which will be evaluated during execution.
 /// </summary>
 /// <param name="language"> the language of the script </param>
 /// <param name="source"> the source code of the script or an expression which evaluates to the source code </param>
 /// <param name="expressionManager"> the expression manager to use to generate the expressions of dynamic scripts </param>
 /// <param name="scriptFactory"> the script factory used to create the script </param>
 /// <returns> the newly created script </returns>
 /// <exception cref="NotValidException"> if language is null or empty or source is null </exception>
 public static ExecutableScript getScriptFormSource(string language, string source, ExpressionManager expressionManager, ScriptFactory scriptFactory)
 {
     ensureNotEmpty(typeof(NotValidException), "Script language", language);
     ensureNotNull(typeof(NotValidException), "Script source", source);
     if (isDynamicScriptExpression(language, source))
     {
         Expression sourceExpression = expressionManager.createExpression(source);
         return(getScriptFromSourceExpression(language, sourceExpression, scriptFactory));
     }
     else
     {
         return(getScriptFromSource(language, source, scriptFactory));
     }
 }
コード例 #6
0
 /// <summary>
 /// Creates a new <seealso cref="ExecutableScript"/> from a source or resource. It excepts static and
 /// dynamic sources and resources. Dynamic means that the source or resource is an expression
 /// which will be evaluated during execution.
 /// </summary>
 /// <param name="language"> the language of the script </param>
 /// <param name="source"> the source code of the script or an expression which evaluates to the source code </param>
 /// <param name="resource"> the resource path of the script code or an expression which evaluates to the resource path </param>
 /// <param name="expressionManager"> the expression manager to use to generate the expressions of dynamic scripts </param>
 /// <param name="scriptFactory"> the script factory used to create the script </param>
 /// <returns> the newly created script </returns>
 /// <exception cref="NotValidException"> if language is null or empty or both of source and resource are invalid </exception>
 public static ExecutableScript getScript(string language, string source, string resource, ExpressionManager expressionManager, ScriptFactory scriptFactory)
 {
     ensureNotEmpty(typeof(NotValidException), "Script language", language);
     ensureAtLeastOneNotNull(typeof(NotValidException), "No script source or resource was given", source, resource);
     if (!string.ReferenceEquals(resource, null) && resource.Length > 0)
     {
         return(getScriptFromResource(language, resource, expressionManager, scriptFactory));
     }
     else
     {
         return(getScriptFormSource(language, source, expressionManager, scriptFactory));
     }
 }
コード例 #7
0
 /// <summary>
 /// Creates a new <seealso cref="ExecutableScript"/> from a source or resource. It excepts static and
 /// dynamic sources and resources. Dynamic means that the source or resource is an expression
 /// which will be evaluated during execution.
 /// </summary>
 /// <param name="language"> the language of the script </param>
 /// <param name="source"> the source code of the script or an expression which evaluates to the source code </param>
 /// <param name="resource"> the resource path of the script code or an expression which evaluates to the resource path </param>
 /// <param name="expressionManager"> the expression manager to use to generate the expressions of dynamic scripts </param>
 /// <returns> the newly created script </returns>
 /// <exception cref="NotValidException"> if language is null or empty or both of source and resource are null or empty </exception>
 public static ExecutableScript getScript(string language, string source, string resource, ExpressionManager expressionManager)
 {
     return(getScript(language, source, resource, expressionManager, ScriptFactory));
 }
コード例 #8
0
 protected internal virtual ParameterValueProvider createParameterValueProvider(string value, ExpressionManager expressionManager)
 {
     if (string.ReferenceEquals(value, null))
     {
         return(new NullValueProvider());
     }
     else if (isCompositeExpression(value, expressionManager))
     {
         Expression expression = expressionManager.createExpression(value);
         return(new ElValueProvider(expression));
     }
     else
     {
         return(new ConstantValueProvider(value));
     }
 }
コード例 #9
0
 public ProcessEngineElProvider(ExpressionManager expressionManager)
 {
     this.expressionManager = expressionManager;
 }