1 Reply Latest reply on Apr 19, 2010 9:51 PM by HuiSheng Xu

    retrive process variables at runtime

    Jose Miguel Loor Apprentice



      I start a process with variables like this


      Map<String, Object> variables = new HashMap<String, Object>();
      variables.put("logNumber", logNumber);


      ProcessInstance processInstance = ProcessEngine.getExecutionService().startProcessInstanceByKey("myProcess", variables,businessKey);


      after that, at some other point of my application i want to find if there is any execution that is running and has a specific value in some of the variables; ritght now i have this:


      List<ProcessInstance> instances = ProcessEngineProxy.getExecutionService().createProcessInstanceQuery().processDefinitionId("myProcess").notSuspended().list();
      if ((instances != null) && (!instances.isEmpty())) {
           for (ProcessInstance processInstance : instances) {


      but i am at a lost here; how do i retrieve the variables from each processInstance object ?? there seems to be no method to recover that map


      please help, i am really new to this jbpm stuff