cancel
Showing results for 
Search instead for 
Did you mean: 

How to update BusinessKey via ExecutionEntity

xuemzhan
Champ in-the-making
Champ in-the-making
Hi Exports,

Here is my code trying to update BusinessKey when the process instance was started.

<blockcode>
@Override
public void setBusinessKey(ProcessInstance instance, String businessKey) {
   try {
      ExecutionEntity entity = (ExecutionEntity)instance;
      if (entity != null) {
         entity.updateProcessBusinessKey(businessKey);
      }
   } catch (Exception e) {
      SystemLog.debug("An exception : " + e.getMessage());
   }
}
</blockcode>

I found that there is no "CommandContext" returned in the updateProcessBusinessKey method. 
1 REPLY 1

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

use org.activiti.engine.RuntimeService#updateBusinessKey
Regards
Martin