|
发表于 2017-11-17 16:13:17
|
显示全部楼层
通知的任务目前不能在onAfterFinish中获取到
可以在process的onBeforeAdance事件中如下操作:
- public static void noticeFlowProcessBeforeAdvance() {
- ProcessControl control = (ProcessControl)ContextHelper.getActionContext().getParameter("control");
- String uuid = UUID.randomUUID().toString().toUpperCase().replaceAll("-", "");
- for (ProcessControlItem item : control.getNotices()){
- item.getTask().setRelationValue("sESField08", uuid);
- }
- ContextHelper.getRequestContext().put("notice", uuid);
- }
复制代码
然后在onAdvanceAfter事件中用ksql到数据库中查找任务获取
- public static void noticeFlowProcessAfterAdvance() {
- String sESField08 = (String) ContextHelper.getRequestContext().get("notice");
- String task = "";
- String ksql = "Select task from SA_Task task where task.sESField08='"+sESField08+"'";
- Table table = KSQL.select(ksql, null, "/system/data", null);
- if(table.size()>0){
- Row row = table.iterator().next();
- task = row.getString("task");
- }
- System.out.println("==========task=========" + task);
- }
复制代码 |
|