Create a process instance with results
Prerequisites
- Run the Zeebe Broker with endpoint 
localhost:26500(default). - Run the deploy a process example. Deploy 
demoProcessSingleTask.bpmninstead ofdemoProcess.bpmn. 
ProcessInstanceWithResultCreator.java
final ProcessInstanceResult processInstanceResult =
    client
        .newCreateInstanceCommand()
        .bpmnProcessId(bpmnProcessId)
        .latestVersion()
        .withResult() // to await the completion of process execution and return result
        .send()
        .join();
System.out.println(
    "Process instance created with key: "
        + processInstanceResult.getProcessInstanceKey()
        + " and completed with results: "
        + processInstanceResult.getVariables());