}
@Override
public WorkflowDeadline executeDeadlinePlugin(String processId, String activityId, WorkflowDeadline deadline, Date processStartedTime, Date activityAcceptedTime, Date activityActivatedTime) {
PluginManager pluginManager = (PluginManager) AppUtil.getApplicationContext().getBean("pluginManager");
PackageDefinitionDao packageDefinitionDao = (PackageDefinitionDao) AppUtil.getApplicationContext().getBean("packageDefinitionDao");
WorkflowManager workflowManager = (WorkflowManager) AppUtil.getApplicationContext().getBean("workflowManager");
Collection<Plugin> pluginList = pluginManager.list(DeadlinePlugin.class);
for (Plugin plugin : pluginList) {
DeadlinePlugin p = (DeadlinePlugin) plugin;
try {
AppDefinition appDef = null;
//get package definition by process id
WorkflowProcess process = workflowManager.getRunningProcessById(processId);
if (process != null) {
PackageDefinition packageDef = packageDefinitionDao.loadPackageDefinition(process.getPackageId(), Long.parseLong(process.getVersion()));
if (packageDef != null) {
appDef = packageDef.getAppDefinition();
}
}