Exemple #1
0
        public virtual FormProperty createFormProperty(ExecutionEntity execution)
        {
            FormPropertyImpl formProperty = new FormPropertyImpl(this);
            object           modelValue   = null;

            if (execution != null)
            {
                if (!string.ReferenceEquals(variableName, null) || variableExpression == null)
                {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final String varName = variableName != null ? variableName : id;
                    string varName = !string.ReferenceEquals(variableName, null) ? variableName : id;
                    if (execution.hasVariable(varName))
                    {
                        modelValue = execution.getVariable(varName);
                    }
                    else if (defaultExpression != null)
                    {
                        modelValue = defaultExpression.getValue(execution);
                    }
                }
                else
                {
                    modelValue = variableExpression.getValue(execution);
                }
            }
            else
            {
                // Execution is null, the form-property is used in a start-form. Default value
                // should be available (ACT-1028) even though no execution is available.
                if (defaultExpression != null)
                {
                    modelValue = defaultExpression.getValue(StartProcessVariableScope.SharedInstance);
                }
            }

            if (modelValue is string)
            {
                formProperty.Value = (string)modelValue;
            }
            else if (type != null)
            {
                string formValue = type.convertModelValueToFormValue(modelValue);
                formProperty.Value = formValue;
            }
            else if (modelValue != null)
            {
                formProperty.Value = modelValue.ToString();
            }

            return(formProperty);
        }
Exemple #2
0
        public virtual void notify(DelegateTask delegateTask)
        {
            delegateTask.Execution.setVariable("greeting", "Hello from " + greeter.getValue(delegateTask.Execution));
            delegateTask.Execution.setVariable("shortName", shortName.getValue(delegateTask.Execution));

            delegateTask.setVariableLocal("myTaskVariable", "test");
        }
Exemple #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void notify(org.camunda.bpm.engine.delegate.DelegateCaseVariableInstance variableInstance) throws Exception
        public virtual void notify(DelegateCaseVariableInstance variableInstance)
        {
            DelegateCaseVariableInstanceImpl variableInstanceImpl = (DelegateCaseVariableInstanceImpl)variableInstance;

            // Return value of expression is ignored
            expression.getValue(variableInstanceImpl.ScopeExecution);
        }
Exemple #4
0
 protected internal virtual string getStringFromField(Expression expression, DelegateExecution execution)
 {
     if (expression != null)
     {
         object value = expression.getValue(execution);
         if (value != null)
         {
             return(value.ToString());
         }
     }
     return(null);
 }
Exemple #5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void execute(org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution execution) throws Exception
        public virtual void execute(ActivityExecution execution)
        {
            string variableName = (string)counterName.getValue(execution);
            object variable     = execution.getVariable(variableName);

            if (variable == null)
            {
                execution.setVariable(variableName, (int?)1);
            }
            else
            {
                execution.setVariable(variableName, ((int?)variable) + 1);
            }
        }
Exemple #6
0
        public virtual bool evaluate(CmmnActivityExecution execution)
        {
            if (expression == null)
            {
                return(true);
            }

            object result = expression.getValue(execution);

            ensureNotNull("rule expression returns null", "result", result);

            if (!(result is bool?))
            {
                throw LOG.ruleExpressionNotBooleanException(result);
            }

            return((bool?)result.Value);
        }
Exemple #7
0
        public virtual TaskFormData createTaskForm(TaskEntity task)
        {
            TaskFormDataImpl taskFormData = new TaskFormDataImpl();

            Expression formKey = task.TaskDefinition.FormKey;

            if (formKey != null)
            {
                object formValue = formKey.getValue(task);
                if (formValue != null)
                {
                    taskFormData.FormKey = formValue.ToString();
                }
            }

            taskFormData.DeploymentId = deploymentId;
            taskFormData.Task         = task;
            initializeFormProperties(taskFormData, task.getExecution());
            initializeFormFields(taskFormData, task.getExecution());
            return(taskFormData);
        }
Exemple #8
0
 public virtual void notify(DelegateTask delegateTask)
 {
     expression.getValue(delegateTask);
 }
Exemple #9
0
//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)
        {
            execution.setVariable("var", fixedValue.getValue(execution).ToString() + dynamicValue.getValue(execution).ToString());
        }
Exemple #10
0
        public virtual void execute(DelegateExecution execution)
        {
            object result = expression.getValue(execution);

            execution.setVariable("result", result);
        }
Exemple #11
0
//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)
        {
            // Return value of expression is ignored
            expression.getValue(execution);
        }
Exemple #12
0
 protected internal virtual string evaluateExpression(VariableScope variableScope)
 {
     return((string)scriptExpression.getValue(variableScope));
 }
Exemple #13
0
//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)
        {
            string variableName = (string)varName.getValue(execution);

            execution.setVariable(variableName, "Event: " + execution.EventName);
        }
Exemple #14
0
 public virtual void execute(DelegateExecution execution)
 {
     execution.setVariable("var", ((string)text.getValue(execution)).ToUpper());
 }