cancel
Showing results for 
Search instead for 
Did you mean: 

DelegateExecution

wslade
Champ in-the-making
Champ in-the-making
I have implemented a JavaDelegate and have found that the DelegateExecution interface just doesnt give me enough information from what I know is available through the implementation.

In particular I would like:

public String getProcessDefinitionId()
public String getParent()
2 REPLIES 2

frederikherema1
Star Contributor
Star Contributor
That seems like a valid addition to the DelegateExecution interface. I'll make sure they're added to the 5.10. In the mean time, I guess there is no other option than casting to the implementation-class…

luka
Champ in-the-making
Champ in-the-making
Is it possible to query the RuntimeService and RepositoryService, as an alternative, to obtain the information currently not exposed through the DelegateExecution interface? One problem I have encountered is that retrieving the process instance via the listed services will not work unless the BMPN flow has previously passed through a step that caused the process instance information to be persisted. Are there any alternatives, as I would like to avoid casting the interface to its implementation class?

Please note the fields I am after are the following:
- ProcessDefinitionName
- ProcessDefinitionId

Looking at the DelegateExecution interface under the 5.10 tag (http://svn.codehaus.org/activiti/activiti/tags/activiti-5.10/modules/activiti-engine/src/main/java/o...), it would seem the ProcessDefinitionId will be exposed, but the comments are a little confusing.
  /**
   * The process definition key for the process instance this execution is associated with.
   */
  String getProcessDefinitionId();
Will the function reveal the process definition key or id?

Thanks,
Luka