code: public String getProcessInstanceId() {
      Execution execution = associationManager.getExecution();
      return execution != null ? execution.getProcessInstanceId() : null;
    }
docs: Returns the id of the currently associated process instance or 'null'