4 Replies Latest reply on Nov 11, 2014 5:51 AM by ivanice

    how do I to take the value of variable

    ivanice

      hi to All,

      I have a simple process formed by 3 script task and 2 user task,

      before beginning to start the user task I must know the value of the variables that they are inside the script task, how do I??

      the variables inside the script task are declared in the list of Variables of file.bpmn

      I have a simple main like this:

       

      public static void main(String[] args) throws InterruptedException {

              KieServices ks = KieServices.Factory.get();

              KieContainer kContainer = ks.getKieClasspathContainer();

              KieBase kbase = kContainer.getKieBase("kbase");

       

              RuntimeManager manager = createRuntimeManager(kbase);

              RuntimeEngine engine = manager.getRuntimeEngine(null);

              KieSession ksession = engine.getKieSession();

              TaskService taskService = engine.getTaskService();

       

              ksession.startProcess("com.sample.bpmn.hello");

            

              // here I must take the values of variables     

       

              // let john execute Task 1

              List<TaskSummary> list = taskService.getTasksAssignedAsPotentialOwner("john", "en-UK");

              TaskSummary task = list.get(0);

              System.out.println("John is executing task " + task.getName());

              taskService.start(task.getId(), "john");

              System.out.println("hhhhhh");

              taskService.complete(task.getId(), "john", null);