Community

Variables from ended process ...

reply from Jaber C. Mourad in jBPM - View the full discussion

Hi,

 

To get history variable i'm using that code using the processInstanceId :

      public Map<String, Object> getHistoryProcessInstanceVariable(String processInstanceId) {
            Set<String> variableNames = historyService.getVariableNames(historyProcessInstanceId);
            return historyService.getVariables(processInstanceId, variableNames);
      }

 

In my test :

HistoryProcessInstance historyProcessInstance = processInstanceService.getHistoryProcessInstanceById(processInstance.getId());
            assertEquals(historyProcessInstance.getState(), "ended" );
            Map<String, Object> historyVariables = processInstanceService.getHistoryProcessInstanceVariable(historyProcessInstance.getProcessInstanceId());
            assertNotNull(historyVariables);
            assertFalse(historyVariables.isEmpty());

 

In my service, to create my variables (I change the code to be sure that I'm using the processInstanceId) :

 

String processInstanceId = executionService.findProcessInstanceById(taskService.getTask(taskId).getExecutionId()).getId();
executionService.createVariables(processInstanceId, variables, true);

 

But nothing better :(

 

Any Idea ?

Reply to this message by going to Community

Start a new discussion in jBPM at Community