Ejemplo n.º 1
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));
     }
 }
Ejemplo n.º 2
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));
     }
 }
Ejemplo n.º 3
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;
            }
        }