Пример #1
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.DelegateExecution execution) throws Exception
            public virtual void execute(DelegateExecution execution)
            {
                bool?transient1 = (bool?)execution.getVariable("transient1");
                bool?transient2 = (bool?)execution.getVariable("transient2");

                execution.setVariable(VARIABLE_NAME, Variables.integerValue(1, transient1));
                execution.setVariable(VARIABLE_NAME, Variables.integerValue(2, transient2));
            }
Пример #2
0
        public virtual void execute(DelegateExecution execution)
        {
            string value1 = (string)text1.getValue(execution);

//JAVA TO C# CONVERTER TODO TASK: There is no .NET StringBuilder equivalent to the Java 'reverse' method:
            execution.setVariable("var1", (new StringBuilder(value1)).reverse().ToString());

            string value2 = (string)text2.getValue(execution);

//JAVA TO C# CONVERTER TODO TASK: There is no .NET StringBuilder equivalent to the Java 'reverse' method:
            execution.setVariable("var2", (new StringBuilder(value2)).reverse().ToString());
        }
Пример #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception
        public virtual void execute(DelegateExecution execution)
        {
            if (execution.getVariable("listVar") != null)
            {
                execution.removeVariable("listVar");
                execution.setVariable("listVar", "stringValue");
            }
            else if (execution.getVariable("foo") != null)
            {
                execution.removeVariable("foo");
                execution.setVariable("foo", "secondValue");
            }
        }
Пример #4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception
            public virtual void execute(DelegateExecution execution)
            {
                Variable v = new Variable();

                execution.setVariable("variable", v);
                v.value = "delegate1";
            }
Пример #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.DelegateExecution execution) throws Exception
        public virtual void execute(DelegateExecution execution)
        {
            DateTime currentTime = (DateTime)execution.getVariable("currentTime");

            currentTime           = DateUtils.addSeconds(currentTime, 1);
            ClockUtil.CurrentTime = currentTime;
            execution.setVariable("currentTime", currentTime);
        }
Пример #6
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.DelegateExecution execution) throws Exception
        public virtual void execute(DelegateExecution execution)
        {
            if (!"23".Equals(execution.getVariable("serialnumber")))
            {
                throw new Exception("The provided router serial number is wrong. The correct serial number is 23 ;-)");
            }
            execution.setVariable("version", "2.0");
        }
Пример #7
0
 public virtual void execute(DelegateExecution execution)
 {
     if (!setterInvoked)
     {
         throw new Exception("Setter was not invoked");
     }
     execution.setVariable("setterVar", ((string)text.getValue(execution)).ToUpper());
 }
Пример #8
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception
        public virtual void execute(DelegateExecution execution)
        {
            int?count = (int?)execution.getVariable("count");

            count = count + 1;
            Console.WriteLine("Count = " + count);
            execution.setVariable("count", count);
        }
Пример #9
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception
        public virtual void execute(DelegateExecution 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);
        }
Пример #10
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.DelegateExecution execution) throws Exception
            public virtual void execute(DelegateExecution 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;

                assertEquals(0, delayedEvents.Count);
            }
Пример #11
0
        public virtual DateTime execute(DelegateExecution execution)
        {
            execution.setVariable("createDate", DateTime.Now);

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.util.Calendar calendar = java.util.Calendar.getInstance();
            DateTime calendar = new DateTime();

            calendar = new DateTime(DateTime.Now);
            calendar.AddDays(1);
            return(calendar);
        }
Пример #12
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception
        public virtual void execute(DelegateExecution 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.
        }
Пример #13
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception
        public virtual void execute(DelegateExecution execution)
        {
            SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss SSS");
            // We set the time to check of the updated time is picked up in the history
            DateTime updatedDate = sdf.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);

            DateTime theDate = sdf.parse("01/01/2001 01:23:45 678");

            execution.setVariable("fVariable", theDate);

            execution.setVariable("gVariable", new SerializableVariable("hello hello"));
            execution.setVariable("hVariable", ";-)".GetBytes());
        }
Пример #14
0
 private void insertVariable(string varName, object value)
 {
     execution.setVariable(varName + (new double?(GlobalRandom.NextDouble * 10)).intValue(), value);
 }
Пример #15
0
 public void testMethod(DelegateExecution execution, string str)
 {
     execution.setVariable("testVar", str);
 }
Пример #16
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.DelegateExecution execution) throws Exception
            public virtual void execute(DelegateExecution execution)
            {
                execution.setVariable(VARIABLE_NAME, Variables.integerValue(1, true));
            }
Пример #17
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override public void notify(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception
            public virtual void notify(DelegateExecution execution)
            {
                execution.setVariable("var", "foo");
            }
Пример #18
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.DelegateExecution execution) throws Exception
            public virtual void execute(DelegateExecution execution)
            {
                execution.setVariable("var", "test");
            }
Пример #19
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.DelegateExecution execution) throws Exception
            public virtual void execute(DelegateExecution execution)
            {
                execution.setVariable(VARIABLE_NAME, Variables.integerValue(1, true));
                execution.setVariable(VARIABLE_NAME, Variables.integerValue(OUTPUT_VALUE, true));
                execution.setVariable("transientVariableOutput", execution.getVariable(VARIABLE_NAME));
            }
Пример #20
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception
        public virtual void execute(DelegateExecution execution)
        {
            execution.setVariable("foo", "value");
            execution.removeVariable("foo");
            execution.setVariable("foo", "bar");
        }
Пример #21
0
 public virtual void testMethod(DelegateExecution delegateExecution)
 {
     delegateExecution.setVariable("testVar", "myValue");
 }