Ejemplo n.º 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)
        {
            // first set variable to some string
            execution.SetVariable("VariableName", "test");

            // now set to serializable
            execution.SetVariable("VariableName", new SerializableVariable("foo"));
        }
Ejemplo n.º 2
0
 public void Execute(IBaseDelegateExecution execution)
 {
     if (instanceCount < 3)
     {
         execution.SetVariable(AbstractConditionalEventTestCase.VariableName, 1);
     }
     else
     {
         execution.SetVariable(AbstractConditionalEventTestCase.VariableName, instanceCount);
     }
 }
Ejemplo n.º 3
0
        public void Execute(IBaseDelegateExecution 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);
            }
        }
Ejemplo n.º 4
0
        public void Execute(IBaseDelegateExecution execution)
        {
            var v = new Variable();

            execution.SetVariable("variable", v);
            v.value = "delegate1";
        }
        public void Execute(IBaseDelegateExecution execution)
        {
            string value1 = (string)Text1.GetValue(execution);

            execution.SetVariable("var1", string.Join("", value1.Reverse()));

            string value2 = (string)Text2.GetValue(execution);

            execution.SetVariable("var2", string.Join("", value2.Reverse()));

            if (Text3 != null)
            {
                string value3 = (string)Text3.GetValue(execution);
                execution.SetVariable("var3", value3);
            }
        }
Ejemplo n.º 6
0
        public void Execute(IBaseDelegateExecution execution)
        {
            int? executionsBeforeError = (int?)execution.GetVariable("executionsBeforeError");
            int? executions            = (int?)execution.GetVariable("executions");
            bool?exceptionType         = (bool?)execution.GetVariable("exceptionType");

            if (executions == null)
            {
                executions = 0;
            }
            executions++;
            if (executionsBeforeError == null || executionsBeforeError < executions)
            {
                if (exceptionType.HasValue && exceptionType.Value)
                {
                    throw new MyBusinessException("This is a business exception, which can be caught by a BPMN Error Event.");
                }
                else
                {
                    throw new BpmnError("23", "This is a business fault, which can be caught by a BPMN Error Event.");
                }
            }
            else
            {
                execution.SetVariable("executions", executions);
            }
        }
Ejemplo n.º 7
0
        public void Execute(IBaseDelegateExecution execution)
        {
            string @var = (string)execution.GetVariable(VariableName);

            @var = @var.ToUpper();
            execution.SetVariable(VariableName, @var);
        }
Ejemplo n.º 8
0
 public void Execute(IBaseDelegateExecution execution)
 {
     if (!setterInvoked)
     {
         throw new System.Exception("Setter was not invoked");
     }
     execution.SetVariable("setterVar", ((string)_text.GetValue(execution)).ToUpper());
 }
Ejemplo n.º 9
0
        public void Execute(IBaseDelegateExecution execution)
        {
            int?Count = (int?)execution.GetVariable("Count");

            Count = Count + 1;
            Console.WriteLine("Count = " + Count);
            execution.SetVariable("Count", Count);
        }
        public void Execute(IBaseDelegateExecution execution)
        {
            DateTime currentTime = (DateTime)execution.GetVariable("currentTime");

            //currentTime = DateUtils.AddSeconds(currentTime, 1);
            currentTime           = currentTime.AddSeconds(1);
            ClockUtil.CurrentTime = currentTime;
            execution.SetVariable("currentTime", currentTime);
        }
//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)
        {
            IList <string> list = (IList <string>)execution.GetVariable("listVar");

            // replace the list by another object
            execution.SetVariable("listVar", new List <string>());

            // implicitly update the previous list, should update the variable value
            list.Add(NEW_ELEMENT);
        }
Ejemplo n.º 12
0
            public void Execute(IBaseDelegateExecution execution)
            {
                //given no conditional event exist

                //when variable is set
                execution.SetVariable("v", 1);

                //then no variable events should be delayed
                IList <DelayedVariableEvent> delayedEvents = ((ExecutionEntity)execution).DelayedEvents;

                Assert.AreEqual(0, delayedEvents.Count);
            }
//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)
        {
            IList <string> list = (IList <string>)execution.GetVariable("listVar");

            // implicitly update the previous list, should update the variable value
            list.Add(NEW_ELEMENT);

            // replace the list by another object
            execution.SetVariable("listVar", new List <string>());

            // note that this is the condensed form of more realistic scenarios like
            // an implicit update in task 1 and an explicit update in the following task 2,
            // both in the same transaction.
        }
Ejemplo n.º 14
0
        public virtual void Execute(IBaseDelegateExecution execution)
        {
            string aVariable = "aVariable";
            int?   newValue  = 1;

            object value = execution.GetVariable(aVariable);

            if (value != null)
            {
                newValue = (int?)value;
                newValue++;
            }

            execution.SetVariable(aVariable, newValue);
        }
Ejemplo n.º 15
0
        public virtual void Execute(IBaseDelegateExecution execution)
        {
            var result = (int?)execution.GetVariable("result");

            var item = (int?)execution.GetVariable("item");

            if (item != null)
            {
                result = result * item;
            }
            else
            {
                result = result * 2;
            }
            execution.SetVariable("result", result);
        }
Ejemplo n.º 16
0
        public virtual void Execute(IBaseDelegateExecution execution)
        {
            //string sdf = new string("dd/MM/yyyy hh:mm:ss SSS");
            // We set the time to check of the updated time is picked up in the history
            var updatedDate = DateTime.Parse("01/01/2001 01:23:46 000");

            ClockUtil.CurrentTime = updatedDate;


            execution.SetVariable("aVariable", "updated value");
            execution.SetVariable("bVariable", 123);
            execution.SetVariable("cVariable", 12345L);
            execution.SetVariable("dVariable", 1234.567);
            execution.SetVariable("eVariable", (short)12);

            var theDate = DateTime.Parse("01/01/2001 01:23:45 678");

            execution.SetVariable("fVariable", theDate);

            //execution.SetVariable("gVariable", new SerializableVariable("hello hello"));
            execution.SetVariable("hVariable", ";-)".GetBytes());
        }
Ejemplo n.º 17
0
        public void Execute(IBaseDelegateExecution execution)
        {
            var result = _expression.GetValue(execution);

            execution.SetVariable("result", result);
        }
Ejemplo n.º 18
0
 public void Execute(IBaseDelegateExecution execution)
 {
     execution.SetVariable("var", ((string)Text.GetValue(execution)).ToUpper());
 }
Ejemplo n.º 19
0
 public void Execute(IBaseDelegateExecution execution)
 {
     execution.SetVariable(AbstractConditionalEventTestCase.VariableName, 1);
 }
Ejemplo n.º 20
0
 public void Execute(IBaseDelegateExecution execution)
 {
     execution.SetVariable("businessKeySetOnExecution", execution.BusinessKey); //IProcessBusinessKey
 }
Ejemplo n.º 21
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override public void Execute(org.Camunda.bpm.Engine.Delegate.IDelegateExecution execution) throws Exception
        public void Execute(IBaseDelegateExecution execution)
        {
            execution.SetVariable("testVar", "testValue");
        }
Ejemplo n.º 22
0
 public virtual void Execute(IBaseDelegateExecution execution)
 {
     execution.SetVariable("zzz", 123456789L);
 }
Ejemplo n.º 23
0
 public void Execute(IBaseDelegateExecution execution)
 {
     execution.SetVariable("message", true);
 }
Ejemplo n.º 24
0
 public void Execute(IBaseDelegateExecution execution)
 {
     execution.SetVariable("targetOrderId", execution.GetVariableLocal("targetOrderId")); //,"SubProcess_1");
 }