final ProcessToolContext processToolContextFromThread = ProcessToolContext.Util.getThreadProcessToolContext();
if(viewController.getCurrentViewId() != null && viewController.getCurrentViewId().equals(ProcessDataViewComponent.class.getName())
&& (task = (BpmTask)viewController.getCurrentViewData().get("task")) != null
&& getBpmSession().isProcessRunning(task.getProcessInstance().getInternalId(),processToolContextFromThread))
{
final ProcessDataPane pdp = pdvc != null && pdvc.getProcessDataPane() != null ? pdvc.getProcessDataPane() : null;
VaadinUtility.displayConfirmationWindow(
application,getI18NSource(),
i18NSource.getMessage("activity.close.process.confirmation.title"),
i18NSource.getMessage("activity.close.process.confirmation.question"),
new String[] {
"activity.close.process.confirmation.ok",
pdp != null && pdp.canSaveProcessData() ? "activity.close.process.confirmation.save" : null,
"activity.close.process.confirmation.cancel"
},
new EventHandler[] {
eventHandler,
pdp != null && pdp.canSaveProcessData() ? new EventHandler() {
@Override
public void onEvent() {
if (pdp.saveProcessDataButtonAction()) {
eventHandler.onEvent();
}
}
} : null,
null,