コード例 #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void execute(org.Camunda.bpm.Engine.Delegate.IDelegateExecution execution) throws Exception
        public virtual void Execute(IBaseDelegateExecution execution)
        {
            execution.SetVariableLocal("var", new SimpleSerializableBean());

            var variable = (SimpleSerializableBean)execution.GetVariable("var");

            variable.IntProperty = variable.IntProperty + 1;

            var shouldExplicitlyUpdateVariable = (bool)execution.GetVariable("shouldExplicitlyUpdateVariable");

            if (shouldExplicitlyUpdateVariable)
            {
                execution.SetVariableLocal("var", variable);
            }
        }
コード例 #2
0
        public void Execute(IBaseDelegateExecution execution)
        {
            ITask task = (execution as IDelegateExecution).ProcessEngineServices.TaskService.CreateTaskQuery(c => c.Name == AbstractConditionalEventTestCase.TaskWithCondition).First();

            ((TaskEntity)task).Execution.SetVariableLocal(AbstractConditionalEventTestCase.VariableName, 1);
            execution.SetVariableLocal(AbstractConditionalEventTestCase.VariableName + 1, 1);
        }
コード例 #3
0
            public void Execute(IBaseDelegateExecution execution)
            {
                serviceTaskInvokedCount++;

                // leave only 3 out of n subprocesses
                execution.SetVariableLocal("terminate", serviceTaskInvokedCount > 3);
            }
コード例 #4
0
        public void Execute(IBaseDelegateExecution execution)
        {
            string VariableName = (string)variable.GetValue(execution);
            var    tmp          = values.GetEnumerator();

            tmp.MoveNext();
            string value = tmp.Current;

            execution.SetVariableLocal(VariableName, value);

            values.Remove(value);
        }
コード例 #5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void execute(org.Camunda.bpm.Engine.Delegate.IDelegateExecution execution) throws Exception
        public virtual void Execute(IBaseDelegateExecution execution)
        {
            // validate integer variable
            int?expectedIntValue = 1234;

            Assert.AreEqual(expectedIntValue, execution.GetVariable("anIntegerVariable"));
            Assert.AreEqual(expectedIntValue, execution.GetVariableTyped <int>("anIntegerVariable")
                            /*.Value*/);
            Assert.AreEqual(ValueTypeFields.Integer, execution.GetVariableTyped <int>("anIntegerVariable")
                            /*.Type*/);
            Assert.IsNull(execution.GetVariableLocal("anIntegerVariable"));
            Assert.IsNull(execution.GetVariableLocalTyped <int>("anIntegerVariable"));

            // set an additional local variable
            execution.SetVariableLocal("aStringVariable", "aStringValue");

            var expectedStringValue = "aStringValue";

            Assert.AreEqual(expectedStringValue, execution.GetVariable("aStringVariable"));
            //Assert.AreEqual(expectedStringValue, execution.GetVariableTyped("aStringVariable")
            //    .Value);
            //Assert.AreEqual(ValueTypeFields.String, execution.GetVariableTyped("aStringVariable")
            //    .Type);
            //Assert.AreEqual(expectedStringValue, execution.GetVariableLocal("aStringVariable"));
            //Assert.AreEqual(expectedStringValue, execution.GetVariableLocalTyped("aStringVariable")
            //    .Value);
            //Assert.AreEqual(ValueTypeFields.String, execution.GetVariableLocalTyped("aStringVariable")
            //    .Type);

            //var objectValue = (SimpleSerializableBean) execution.GetVariable("anObjectValue");
            //Assert.NotNull(objectValue);
            //Assert.AreEqual(10, objectValue.IntProperty);
            //IObjectValue variableTyped = execution.GetVariableTyped("anObjectValue");
            //Assert.AreEqual(10, variableTyped.GetValue(typeof(SimpleSerializableBean))
            //    .IntProperty);
            //Assert.AreEqual(Variables.SerializationDataFormats.JAVA.Name, variableTyped.SerializationDataFormat);

            //objectValue = (SimpleSerializableBean) execution.GetVariable("anUntypedObjectValue");
            //Assert.NotNull(objectValue);
            //Assert.AreEqual(30, objectValue.IntProperty);
            //variableTyped = execution.GetVariableTyped("anUntypedObjectValue");
            //Assert.AreEqual(30, variableTyped.GetValue(typeof(SimpleSerializableBean))
            //    .IntProperty);
            //Assert.AreEqual(Context.ProcessEngineConfiguration.DefaultSerializationFormat,
            //    variableTyped.SerializationDataFormat);
        }
コード例 #6
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void execute(org.Camunda.bpm.Engine.Delegate.IDelegateExecution execution) throws Exception
        public virtual void Execute(IBaseDelegateExecution execution)
        {
            execution.SetVariableLocal("test", "test2");
        }