final HistoryEventProducer eventFactory = configuration.getHistoryEventProducer();
final HistoryEventHandler eventHandler = configuration.getHistoryEventHandler();
// publish start event for sub process instance
HistoryEvent hpise = eventFactory.createProcessInstanceStartEvt(subProcessInstance);
eventHandler.handleEvent(hpise);
// publish update event for current activity instance (containing the id of the sub process)
HistoryEvent haie = eventFactory.createActivityInstanceUpdateEvt(this, null);
eventHandler.handleEvent(haie);
}