diff options
Diffstat (limited to 'bpmn/mso-infrastructure-bpmn/src/test')
-rw-r--r-- | bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java index 93f98a34a6..0161422b64 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java @@ -1534,6 +1534,18 @@ public abstract class WorkflowTest { } } + protected Object getVariableFromHistoryByProcessInstanceId(String processInstanceId, String variableName) { + try { + HistoricVariableInstance v = historyService.createHistoricVariableInstanceQuery() + .processInstanceId(processInstanceId).variableName(variableName).singleResult(); + return v == null ? null : v.getValue(); + } catch (Exception e) { + logger.debug("Error retrieving variable {} from historical process with processInstanceId {}: ", + variableName, processInstanceId, e); + return null; + } + } + /** * Gets a variable value from a process instance based on businessKey and process name. Must be used when multiple * instances exist with the same business key such as when business key is passed to subflows or shared across |