liyuan 2 жил өмнө
parent
commit
1584951add

+ 3 - 3
ibps-bpmn-root/modules/bpmn-biz/src/main/java/com/lc/ibps/bpmn/listener/TaskCompleteEventListener.java

@@ -616,9 +616,8 @@ public class TaskCompleteEventListener implements ApplicationListener<TaskComple
 		bpmTaskDomain.delete(taskId);
 	}
 	private void updateSubject(BpmDelegateTask delegateTask, TaskFinishCmd cmd) {
-
-		String procInstId=String.valueOf(delegateTask.getVariable(BpmConstants.PROCESS_INST_ID));
-		BpmInstPo instance= bpmInstRepository.get(procInstId);
+		String procInstId = delegateTask.getVariableString(BpmConstants.PROCESS_INST_ID);
+		BpmInstPo instance = bpmInstRepository.get(procInstId);
 
 		ProcInstCmd procInstCmd = new IbpsProcInstCmd() ;
 		procInstCmd.setBusData(cmd.getBusData());
@@ -626,6 +625,7 @@ public class TaskCompleteEventListener implements ApplicationListener<TaskComple
 		procInstCmd.setBusinessKey(cmd.getBusinessKey());
 		((IbpsProcInstCmd) procInstCmd).setVariables(cmd.getVariables());
 		bpmProcInstService.saveSubject(instance,procInstCmd);
+		delegateTask.setVariable(BpmConstants.BPM_TASK + BpmConstants.SUBJECT,instance.getSubject());
 	}
 
 }

+ 4 - 2
ibps-bpmn-root/modules/bpmn-biz/src/main/java/com/lc/ibps/bpmn/listener/TaskCreateEventListener.java

@@ -75,8 +75,10 @@ public class TaskCreateEventListener implements ApplicationListener<TaskCreateEv
 	@Override
 	public void onApplicationEvent(TaskCreateEvent event){
 		BpmDelegateTask delegateTask = (BpmDelegateTask)event.getSource();
-		
-		String subject =delegateTask.getVariableString(BpmConstants.SUBJECT);
+
+		String subject = delegateTask.hasVariable(BpmConstants.BPM_TASK + BpmConstants.SUBJECT)
+				? delegateTask.getVariableString(BpmConstants.BPM_TASK + BpmConstants.SUBJECT)
+				: delegateTask.getVariableString(BpmConstants.SUBJECT);
 		String instId = delegateTask.getVariableString(BpmConstants.PROCESS_INST_ID);
 		String userId = delegateTask.getVariableString(BpmConstants.CUR_USER);
 		String nodeId = delegateTask.getTaskDefinitionKey();