}
}
private ProcessToolWidget getWidget(ProcessStateWidget w, ProcessStateConfiguration stateConfiguration, ProcessToolContext ctx,
String generatorKey, WidgetEventBus widgetEventBus) {
ProcessToolWidget processToolWidget;
try {
ProcessToolRegistry toolRegistry = VaadinUtility.getProcessToolContext(application.getContext()).getRegistry();
processToolWidget = w.getClassName() == null ? toolRegistry.makeWidget(w.getName()) : toolRegistry.makeWidget(w.getClassName());
processToolWidget.setContext(stateConfiguration, w, i18NSource, bpmSession, application,
bpmSession.getPermissionsForWidget(w, ctx), isOwner);
processToolWidget.setGeneratorKey(generatorKey);
processToolWidget.setWidgetEventBus(widgetEventBus);
if (processToolWidget instanceof ProcessToolDataWidget) {
((ProcessToolDataWidget) processToolWidget).loadData(task);
dataWidgets.add((ProcessToolDataWidget) processToolWidget);
}
}