Jaber C. Mourad [
http://community.jboss.org/people/newbeewan] replied to the discussion
"Variables from ended process ..."
To view the discussion, visit:
http://community.jboss.org/message/548548#548548
--------------------------------------------------------------
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
[
http://community.jboss.org/message/548548#548548]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]