AnsweredAssumed Answered

ExecutionImpl.getId() always returns null

Question asked by romanoff on May 4, 2011
Latest reply on May 16, 2011 by romanoff

I'm playing a bit with the PVM APIs and have discovered that

PvmProcessDefinition processDefinition = ProcessDefinitionBuilder …;

ExecutionImpl processInstance =
     (ExecutionImpl) processDefinition.createProcessInstance();


would always print null.

This is due to the fact ExecutionImpl.getId() is defined to always return null and there is no setter method for defining your custom id. The comment says that subclasses may override, but ProcessDefinitionImpl.newProcessInstance() method is defined like this:
 protected InterpretableExecution newProcessInstance() {
    return new ExecutionImpl();
It means that it would always use the vanilla ExecutionImpl class for creation of instances.

Is it possible to set the id of the processInstance or to make PVM generate it for you? May be a setId() method could be added to the API?