예제 #1
0
        public virtual void testScriptInClasspathAsBean()
        {
            IDictionary <string, object> variables = new Dictionary <string, object>();

            variables["scriptResourceBean"] = new ScriptResourceBean();
            IProcessInstance processInstance = runtimeService.StartProcessInstanceByKey("process", variables);

            string greeting = (string)runtimeService.GetVariable(processInstance.Id, "greeting");

            Assert.NotNull(greeting);
            Assert.AreEqual("Greetings camunda BPM speaking", greeting);
        }
예제 #2
0
        public virtual void testSourceAsExpressionAsBean()
        {
            deployProcess(PYTHON, "#{scriptResourceBean.GetSource()}");

            IDictionary <string, object> variables = new Dictionary <string, object>();

            variables["scriptResourceBean"] = new ScriptResourceBean();
            IProcessInstance pi = runtimeService.StartProcessInstanceByKey("testProcess", variables);

            string variableValue = (string)runtimeService.GetVariable(pi.Id, "foo");

            Assert.AreEqual("bar", variableValue);
        }