How to read a process variable from a process instance returned by remote call in BPM Suite 6?

Solution Unverified - Updated -

Environment

  • Red Hat JBoss BPM Suite (BPM Suite) 6.1.x

Issue

  • We are using RemoteRuntimeEngine to make a call to a process deployed in business central. How can read the process variables for the process invoked?
  • How to read a process variable from a process instance returned by remote call in BPM Suite 6?

Resolution

You could try it by using query API or AuditService. As you can see in the documentation, you can find variables by processId, by name, etc:

...
    AuditService audit = engine.getAuditService(); //get AuditLogService from RemoteRuntimeEngine
    List<VariableInstanceLog> varLog  = (List<VariableInstanceLog>) audit.findVariableInstances(processInstance.getId());

        for( VariableInstanceLog origVarLog : varLog ) { 
            System.out.println(origVarLog.getVariableId());
            System.out.println(origVarLog.getValue());
        }
...

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.