Ver Fonte

修正上一处理人的问题

zhourui há 5 anos atrás
pai
commit
8568c6692b

+ 8 - 6
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionProcessing.java

@@ -134,12 +134,12 @@ class ActionProcessing extends BaseAction {
 
 	private void processing() throws Exception {
 		switch (type) {
-		case TYPE_APPENDTASK:
-			this.processingAppendTask();
-			break;
-		default:
-			this.processingTask();
-			break;
+			case TYPE_APPENDTASK:
+				this.processingAppendTask();
+				break;
+			default:
+				this.processingTask();
+				break;
 		}
 	}
 
@@ -189,6 +189,8 @@ class ActionProcessing extends BaseAction {
 		req.setIgnoreEmpowerIdentityList(wi.getIgnoreEmpowerIdentityList());
 		req.setType(ProcessingAttributes.TYPE_TASK);
 		req.setSeries(this.series);
+		req.setPerson(task.getPerson());
+		req.setIdentity(task.getIdentity());
 		WoId resp = ThisApplication.context().applications()
 				.putQuery(effectivePerson.getDebugger(), x_processplatform_service_processing.class,
 						Applications.joinQueryUri("work", task.getWork(), "processing"), req, task.getJob())

+ 22 - 0
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/ProcessingAttributes.java

@@ -29,6 +29,12 @@ public class ProcessingAttributes extends GsonPropertyObject {
 	@FieldDescribe("忽略授权的身份")
 	private List<String> ignoreEmpowerIdentityList = new ArrayList<>();
 
+	@FieldDescribe("当前处理人")
+	private String person;
+
+	@FieldDescribe("当前处理人身份")
+	private String identity;
+
 	public ProcessingAttributes() {
 		this.series = StringTools.uniqueToken();
 	}
@@ -144,4 +150,20 @@ public class ProcessingAttributes extends GsonPropertyObject {
 		this.ignoreEmpowerIdentityList = ignoreEmpowerIdentityList;
 	}
 
+	public String getPerson() {
+		return person;
+	}
+
+	public void setPerson(String person) {
+		this.person = person;
+	}
+
+	public String getIdentity() {
+		return identity;
+	}
+
+	public void setIdentity(String identity) {
+		this.identity = identity;
+	}
+
 }

+ 6 - 0
o2server/x_processplatform_core_express/src/main/java/com/x/processplatform/core/express/service/processing/jaxrs/task/WrapProcessing.java

@@ -9,6 +9,12 @@ public class WrapProcessing extends GsonPropertyObject {
 
 	public static final String PROCESSINGTYPE_RESET = "reset";
 
+	// @FieldDescribe("当前处理人")
+	// private String person;
+
+	// @FieldDescribe("当前处理身份")
+	// private String identity;
+
 	@FieldDescribe("流转类型.")
 	private String processingType;
 

+ 197 - 90
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionProcessing.java

@@ -7,8 +7,6 @@ import java.util.concurrent.Callable;
 import javax.script.CompiledScript;
 import javax.script.ScriptContext;
 
-import org.apache.commons.lang3.StringUtils;
-
 import com.google.gson.JsonElement;
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
@@ -24,7 +22,6 @@ import com.x.base.core.project.jaxrs.WoId;
 import com.x.base.core.project.logger.Logger;
 import com.x.base.core.project.logger.LoggerFactory;
 import com.x.base.core.project.tools.ListTools;
-import com.x.processplatform.core.entity.content.Data;
 import com.x.processplatform.core.entity.content.Task;
 import com.x.processplatform.core.entity.content.TaskCompleted;
 import com.x.processplatform.core.entity.content.Work;
@@ -39,6 +36,9 @@ import com.x.processplatform.service.processing.WorkDataHelper;
 import com.x.processplatform.service.processing.configurator.ProcessingConfigurator;
 import com.x.processplatform.service.processing.processor.AeiObjects;
 
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.commons.lang3.StringUtils;
+
 class ActionProcessing extends BaseAction {
 
 	@ActionLogger
@@ -58,111 +58,218 @@ class ActionProcessing extends BaseAction {
 			job = task.getJob();
 		}
 
-		Callable<ActionResult<Wo>> callable = new Callable<ActionResult<Wo>>() {
-			public ActionResult<Wo> call() throws Exception {
-				ActionResult<Wo> result = new ActionResult<>();
-				Wo wo = new Wo();
-				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-					Business business = new Business(emc);
-					/** 生成默认的Wi,用于生成默认的processType */
-					if (null == wi.getProcessingType()) {
-						wi.setProcessingType(TaskCompleted.PROCESSINGTYPE_TASK);
-					}
-					Task task = emc.find(id, Task.class);
-					if (null == task) {
-						throw new ExceptionEntityNotExist(id, Task.class);
-					}
-					Manual manual = null;
-					/* 执行办前脚本 */
-					if (Objects.equals(task.getActivityType(), ActivityType.manual)) {
-						manual = business.element().get(task.getActivity(), Manual.class);
-						if (null != manual) {
-							if (StringUtils.isNotEmpty(manual.getManualBeforeTaskScript())
-									|| StringUtils.isNotEmpty(manual.getManualBeforeTaskScriptText())) {
-								Work work = emc.find(task.getWork(), Work.class);
+		// Callable<ActionResult<Wo>> callable = new Callable<ActionResult<Wo>>() {
+		// public ActionResult<Wo> call() throws Exception {
+		// ActionResult<Wo> result = new ActionResult<>();
+		// Wo wo = new Wo();
+		// try (EntityManagerContainer emc =
+		// EntityManagerContainerFactory.instance().create()) {
+		// Business business = new Business(emc);
+		// /** 生成默认的Wi,用于生成默认的processType */
+		// if (null == wi.getProcessingType()) {
+		// wi.setProcessingType(TaskCompleted.PROCESSINGTYPE_TASK);
+		// }
+		// Task task = emc.find(id, Task.class);
+		// if (null == task) {
+		// throw new ExceptionEntityNotExist(id, Task.class);
+		// }
+		// Manual manual = null;
+		// /* 执行办前脚本 */
+		// if (Objects.equals(task.getActivityType(), ActivityType.manual)) {
+		// manual = business.element().get(task.getActivity(), Manual.class);
+		// if (null != manual) {
+		// if (StringUtils.isNotEmpty(manual.getManualBeforeTaskScript())
+		// || StringUtils.isNotEmpty(manual.getManualBeforeTaskScriptText())) {
+		// Work work = emc.find(task.getWork(), Work.class);
 
-								if (null != work) {
+		// if (null != work) {
 
-									AeiObjects aeiObjects = new AeiObjects(business, work, manual,
-											new ProcessingConfigurator(), new ProcessingAttributes());
+		// AeiObjects aeiObjects = new AeiObjects(business, work, manual,
+		// new ProcessingConfigurator(), new ProcessingAttributes());
 
-									ScriptContext scriptContext = aeiObjects.scriptContext();
+		// ScriptContext scriptContext = aeiObjects.scriptContext();
 
-									WorkDataHelper workDataHelper = new WorkDataHelper(
-											business.entityManagerContainer(), work);
+		// WorkDataHelper workDataHelper = new WorkDataHelper(
+		// business.entityManagerContainer(), work);
 
-									CompiledScript cs = null;
-									cs = business.element().getCompiledScript(task.getApplication(), manual,
-											Business.EVENT_MANUALBEFORETASK);
+		// CompiledScript cs = null;
+		// cs = business.element().getCompiledScript(task.getApplication(), manual,
+		// Business.EVENT_MANUALBEFORETASK);
 
-									cs.eval(scriptContext);
+		// cs.eval(scriptContext);
 
-									workDataHelper.update(aeiObjects.getData());
-									
-									emc.commit();
-								}
-							}
-						}
-					}
-					/* 将待办转为已办 */
-					emc.beginTransaction(TaskCompleted.class);
-					emc.beginTransaction(Task.class);
-					/* 将所有前面的已办lastest标记false */
-					emc.listEqualAndEqual(TaskCompleted.class, TaskCompleted.job_FIELDNAME, task.getJob(),
-							TaskCompleted.person_FIELDNAME, task.getPerson()).forEach(o -> {
-								o.setLatest(false);
-							});
-					Date now = new Date();
-					Long duration = Config.workTime().betweenMinutes(task.getStartTime(), now);
-					TaskCompleted taskCompleted = new TaskCompleted(task, wi.getProcessingType(), now, duration);
-					if (StringUtils.isEmpty(taskCompleted.getOpinion())) {
-						Process process = business.element().get(task.getProcess(), Process.class);
-						if ((null != process) && process.getRouteNameAsOpinion()) {
-							/* 先写入路由意见 */
-							taskCompleted.setOpinion(StringUtils.trimToEmpty(ListTools.parallel(task.getRouteNameList(),
-									task.getRouteName(), task.getRouteOpinionList())));
-							/* 如果路由的名称依然没有获取,那么强制设置为路由名称。 */
-							if (StringUtils.isEmpty(taskCompleted.getOpinion())) {
-								taskCompleted.setOpinion(task.getRouteName());
-							}
-						}
-					}
-					taskCompleted.onPersist();
-					emc.persist(taskCompleted, CheckPersistType.all);
-					emc.remove(task, CheckRemoveType.all);
-					emc.commit();
-					/* 待办执行后脚本,不能修改数据. */
-					if (null != manual) {
-						if (StringUtils.isNotEmpty(manual.getManualAfterTaskScript())
-								|| StringUtils.isNotEmpty(manual.getManualAfterTaskScriptText())) {
-							Work work = emc.find(task.getWork(), Work.class);
+		// workDataHelper.update(aeiObjects.getData());
 
-							if (null != work) {
+		// emc.commit();
+		// }
+		// }
+		// }
+		// }
+		// /* 将待办转为已办 */
+		// emc.beginTransaction(TaskCompleted.class);
+		// emc.beginTransaction(Task.class);
+		// /* 将所有前面的已办lastest标记false */
+		// emc.listEqualAndEqual(TaskCompleted.class, TaskCompleted.job_FIELDNAME,
+		// task.getJob(),
+		// TaskCompleted.person_FIELDNAME, task.getPerson()).forEach(o -> {
+		// o.setLatest(false);
+		// });
+		// Date now = new Date();
+		// Long duration = Config.workTime().betweenMinutes(task.getStartTime(), now);
+		// TaskCompleted taskCompleted = new TaskCompleted(task, wi.getProcessingType(),
+		// now, duration);
+		// if (StringUtils.isEmpty(taskCompleted.getOpinion())) {
+		// Process process = business.element().get(task.getProcess(), Process.class);
+		// if ((null != process) && process.getRouteNameAsOpinion()) {
+		// /* 先写入路由意见 */
+		// taskCompleted.setOpinion(StringUtils.trimToEmpty(ListTools.parallel(task.getRouteNameList(),
+		// task.getRouteName(), task.getRouteOpinionList())));
+		// /* 如果路由的名称依然没有获取,那么强制设置为路由名称。 */
+		// if (StringUtils.isEmpty(taskCompleted.getOpinion())) {
+		// taskCompleted.setOpinion(task.getRouteName());
+		// }
+		// }
+		// }
+		// taskCompleted.onPersist();
+		// emc.persist(taskCompleted, CheckPersistType.all);
+		// emc.remove(task, CheckRemoveType.all);
+		// emc.commit();
+		// /* 待办执行后脚本,不能修改数据. */
+		// if (null != manual) {
+		// if (StringUtils.isNotEmpty(manual.getManualAfterTaskScript())
+		// || StringUtils.isNotEmpty(manual.getManualAfterTaskScriptText())) {
+		// Work work = emc.find(task.getWork(), Work.class);
 
-								AeiObjects aeiObjects = new AeiObjects(business, work, manual,
-										new ProcessingConfigurator(), new ProcessingAttributes());
+		// if (null != work) {
 
-								ScriptContext scriptContext = aeiObjects.scriptContext();
+		// AeiObjects aeiObjects = new AeiObjects(business, work, manual,
+		// new ProcessingConfigurator(), new ProcessingAttributes());
 
-								CompiledScript cs = null;
-								cs = business.element().getCompiledScript(task.getApplication(), manual,
-										Business.EVENT_MANUALAFTERTASK);
+		// ScriptContext scriptContext = aeiObjects.scriptContext();
 
-								cs.eval(scriptContext);
+		// CompiledScript cs = null;
+		// cs = business.element().getCompiledScript(task.getApplication(), manual,
+		// Business.EVENT_MANUALAFTERTASK);
 
-							}
-						}
+		// cs.eval(scriptContext);
+
+		// }
+		// }
+		// }
+		// MessageFactory.task_to_taskCompleted(taskCompleted);
+		// wo.setId(taskCompleted.getId());
+		// }
+		// result.setData(wo);
+		// return result;
+		// }
+		// };
+
+		return ProcessPlatformExecutorFactory.get(job).submit(new CallableExecute(wi, id)).get();
+
+	}
+
+	private class CallableExecute implements Callable<ActionResult<Wo>> {
+
+		private Wi wi;
+
+		private String id;
+
+		private CallableExecute(Wi wi, String id) {
+			this.wi = wi;
+			this.id = id;
+		}
+
+		private void callManualBeforeTaskScript(Business business, Task task) throws Exception {
+			if (Objects.equals(task.getActivityType(), ActivityType.manual)) {
+				Manual manual = business.element().get(task.getActivity(), Manual.class);
+				if ((null != manual) && (StringUtils.isNotEmpty(manual.getManualBeforeTaskScript())
+						|| StringUtils.isNotEmpty(manual.getManualBeforeTaskScriptText()))) {
+					Work work = business.entityManagerContainer().find(task.getWork(), Work.class);
+					if (null != work) {
+						AeiObjects aeiObjects = new AeiObjects(business, work, manual, new ProcessingConfigurator(),
+								new ProcessingAttributes());
+						ScriptContext scriptContext = aeiObjects.scriptContext();
+						WorkDataHelper workDataHelper = new WorkDataHelper(business.entityManagerContainer(), work);
+						CompiledScript cs = null;
+						cs = business.element().getCompiledScript(task.getApplication(), manual,
+								Business.EVENT_MANUALBEFORETASK);
+						cs.eval(scriptContext);
+						workDataHelper.update(aeiObjects.getData());
+						business.entityManagerContainer().commit();
 					}
-					MessageFactory.task_to_taskCompleted(taskCompleted);
-					wo.setId(taskCompleted.getId());
 				}
-				result.setData(wo);
-				return result;
 			}
-		};
+		}
 
-		return ProcessPlatformExecutorFactory.get(job).submit(callable).get();
+		private void callManualAfterTaskScript(Business business, Task task) throws Exception {
+			if (Objects.equals(task.getActivityType(), ActivityType.manual)) {
+				Manual manual = business.element().get(task.getActivity(), Manual.class);
+				if ((null != manual) && (StringUtils.isNotEmpty(manual.getManualAfterTaskScript())
+						|| StringUtils.isNotEmpty(manual.getManualAfterTaskScriptText()))) {
+					Work work = business.entityManagerContainer().find(task.getWork(), Work.class);
+					if (null != work) {
+						AeiObjects aeiObjects = new AeiObjects(business, work, manual, new ProcessingConfigurator(),
+								new ProcessingAttributes());
+						ScriptContext scriptContext = aeiObjects.scriptContext();
+						CompiledScript cs = null;
+						cs = business.element().getCompiledScript(task.getApplication(), manual,
+								Business.EVENT_MANUALAFTERTASK);
+						cs.eval(scriptContext);
+					}
+				}
+			}
+		}
 
+		public ActionResult<Wo> call() throws Exception {
+			ActionResult<Wo> result = new ActionResult<>();
+			Wo wo = new Wo();
+			try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+				Business business = new Business(emc);
+				// 生成默认的Wi,用于生成默认的processType
+				if (null == wi.getProcessingType()) {
+					wi.setProcessingType(TaskCompleted.PROCESSINGTYPE_TASK);
+				}
+				Task task = emc.find(id, Task.class);
+				if (null == task) {
+					throw new ExceptionEntityNotExist(id, Task.class);
+				}
+				// 执行办前脚本
+				callManualBeforeTaskScript(business, task);
+				// 将待办转为已办
+				emc.beginTransaction(TaskCompleted.class);
+				emc.beginTransaction(Task.class);
+				// 将所有前面的已办lastest标记false
+				emc.listEqualAndEqual(TaskCompleted.class, TaskCompleted.job_FIELDNAME, task.getJob(),
+						TaskCompleted.person_FIELDNAME, task.getPerson()).forEach(o -> {
+							o.setLatest(false);
+						});
+				Date now = new Date();
+				Long duration = Config.workTime().betweenMinutes(task.getStartTime(), now);
+				TaskCompleted taskCompleted = new TaskCompleted(task, wi.getProcessingType(), now, duration);
+				if (StringUtils.isEmpty(taskCompleted.getOpinion())) {
+					Process process = business.element().get(task.getProcess(), Process.class);
+					if ((null != process) && BooleanUtils.isTrue(process.getRouteNameAsOpinion())) {
+						// 先写入路由意见
+						taskCompleted.setOpinion(StringUtils.trimToEmpty(ListTools.parallel(task.getRouteNameList(),
+								task.getRouteName(), task.getRouteOpinionList())));
+						// 如果路由的名称依然没有获取,那么强制设置为路由名称。
+						if (StringUtils.isEmpty(taskCompleted.getOpinion())) {
+							taskCompleted.setOpinion(task.getRouteName());
+						}
+					}
+				}
+				taskCompleted.onPersist();
+				emc.persist(taskCompleted, CheckPersistType.all);
+				emc.remove(task, CheckRemoveType.all);
+				emc.commit();
+				/* 待办执行后脚本,不能修改数据. */
+				callManualAfterTaskScript(business, task);
+				MessageFactory.task_to_taskCompleted(taskCompleted);
+				wo.setId(taskCompleted.getId());
+			}
+			result.setData(wo);
+			return result;
+		}
 	}
 
 	public static class Wo extends WoId {

+ 8 - 3
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionUpdatePrevTaskIdentity.java

@@ -6,6 +6,7 @@ import java.util.concurrent.Callable;
 import com.google.gson.JsonElement;
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.entity.JpaObject;
 import com.x.base.core.entity.annotation.CheckPersistType;
 import com.x.base.core.project.annotation.ActionLogger;
 import com.x.base.core.project.executor.ProcessPlatformExecutorFactory;
@@ -18,6 +19,8 @@ import com.x.base.core.project.tools.ListTools;
 import com.x.processplatform.core.entity.content.Task;
 import com.x.processplatform.core.express.service.processing.jaxrs.task.WrapUpdatePrevTaskIdentity;
 
+import org.apache.commons.collections4.ListUtils;
+
 class ActionUpdatePrevTaskIdentity extends BaseAction {
 
 	@ActionLogger
@@ -29,7 +32,7 @@ class ActionUpdatePrevTaskIdentity extends BaseAction {
 		bag.wi = this.convertToWrapIn(jsonElement, Wi.class);
 
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-			List<Task> os = emc.fetchIn(Task.class, ListTools.toList(Task.job_FIELDNAME), Task.id_FIELDNAME,
+			List<Task> os = emc.fetchIn(Task.class, ListTools.toList(Task.job_FIELDNAME), JpaObject.id_FIELDNAME,
 					bag.wi.getTaskList());
 			if (os.isEmpty()) {
 				Wo wo = new Wo();
@@ -43,10 +46,12 @@ class ActionUpdatePrevTaskIdentity extends BaseAction {
 			public ActionResult<Wo> call() throws Exception {
 				Wo wo = new Wo();
 				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
-					List<Task> os = emc.listIn(Task.class, Task.id_FIELDNAME, bag.wi.getTaskList());
+					List<Task> os = emc.listIn(Task.class, JpaObject.id_FIELDNAME, bag.wi.getTaskList());
 					emc.beginTransaction(Task.class);
 					for (Task o : os) {
-						o.getProperties().setPrevTaskIdentityList(bag.wi.getPrevTaskIdentityList());
+						o.getProperties().setPrevTaskIdentityList(
+								ListTools.trim(ListUtils.sum(o.getProperties().getPrevTaskIdentityList(),
+										bag.wi.getPrevTaskIdentityList()), true, true));
 						emc.check(o, CheckPersistType.all);
 						wo.getValueList().add(o.getId());
 					}

+ 32 - 12
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ActionProcessing.java

@@ -36,20 +36,40 @@ class ActionProcessing extends BaseAction {
 
 		}
 
-		Callable<ActionResult<Wo>> callable = new Callable<ActionResult<Wo>>() {
-			public ActionResult<Wo> call() throws Exception {
-				Processing processing = new Processing(wi);
-				processing.processing(id);
-				ActionResult<Wo> result = new ActionResult<>();
-				Wo wo = new Wo();
-				wo.setId(id);
-				result.setData(wo);
-				return result;
-			}
-		};
+		// Callable<ActionResult<Wo>> callable = new Callable<ActionResult<Wo>>() {
+		// public ActionResult<Wo> call() throws Exception {
+		// Processing processing = new Processing(wi);
+		// processing.processing(id);
+		// ActionResult<Wo> result = new ActionResult<>();
+		// Wo wo = new Wo();
+		// wo.setId(id);
+		// result.setData(wo);
+		// return result;
+		// }
+		// };
+
+		return ProcessPlatformExecutorFactory.get(job).submit(new CallableExecute(wi, id)).get();
+
+	}
 
-		return ProcessPlatformExecutorFactory.get(job).submit(callable).get();
+	private class CallableExecute implements Callable<ActionResult<Wo>> {
+		private Wi wi;
+		private String id;
 
+		private CallableExecute(Wi wi, String id) {
+			this.wi = wi;
+			this.id = id;
+		}
+
+		public ActionResult<Wo> call() throws Exception {
+			Processing processing = new Processing(wi);
+			processing.processing(id);
+			ActionResult<Wo> result = new ActionResult<>();
+			Wo wo = new Wo();
+			wo.setId(id);
+			result.setData(wo);
+			return result;
+		}
 	}
 
 	public static class Wi extends ProcessingAttributes {

+ 0 - 408
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/AbstractProcessorBack.java

@@ -1,408 +0,0 @@
-//package com.x.processplatform.service.processing.processor;
-//
-//import java.util.ArrayList;
-//import java.util.LinkedHashMap;
-//import java.util.List;
-//import java.util.Objects;
-//
-//import javax.script.CompiledScript;
-//import javax.script.ScriptContext;
-//
-//import org.apache.commons.lang3.BooleanUtils;
-//import org.apache.commons.lang3.StringUtils;
-//
-//import com.x.base.core.container.EntityManagerContainer;
-//import com.x.base.core.project.logger.Logger;
-//import com.x.base.core.project.logger.LoggerFactory;
-//import com.x.base.core.project.tools.ListTools;
-//import com.x.processplatform.core.entity.content.Read;
-//import com.x.processplatform.core.entity.content.Review;
-//import com.x.processplatform.core.entity.content.Work;
-//import com.x.processplatform.core.entity.element.Activity;
-//import com.x.processplatform.core.entity.element.ActivityType;
-//import com.x.processplatform.core.entity.element.Process;
-//import com.x.processplatform.core.entity.element.Route;
-//import com.x.processplatform.core.express.ProcessingAttributes;
-//import com.x.processplatform.service.processing.Business;
-//import com.x.processplatform.service.processing.SerialBuilder;
-//import com.x.processplatform.service.processing.ThisApplication;
-//import com.x.processplatform.service.processing.configurator.ProcessingConfigurator;
-//
-///***
-// * 
-// * 实现3个时间的基础功能
-// *
-// */
-//public abstract class AbstractProcessorBack extends AbstractBaseProcessor {
-//
-//	private static Logger logger = LoggerFactory.getLogger(AbstractProcessorBack.class);
-//
-//	protected AbstractProcessorBack(EntityManagerContainer entityManagerContainer) throws Exception {
-//		super(entityManagerContainer);
-//	}
-//
-//	public String arrive(String workId, ProcessingConfigurator processingConfigurator,
-//			ProcessingAttributes processingAttributes) {
-//		/* 返回值,如果返回值不为空,将继续循环 */
-//		try {
-//			Work work = this.entityManagerContainer().find(workId, Work.class);
-//			if (null == work) {
-//				throw new ExceptionWorkNotExist(workId);
-//			}
-//			ActivityType activityType = work.getDestinationActivityType();
-//			if (null == activityType) {
-//				throw new ExceptionEmptyActivityType(work.getTitle(), work.getId(), work.getDestinationActivityType());
-//			}
-//			Activity activity = this.business().element().get(work.getDestinationActivity(),
-//					ActivityType.getClassOfActivityType(activityType));
-//			if (null == activity) {
-//				throw new ExceptionActivityNotExist(work.getTitle(), work.getId(), work.getDestinationActivityType(),
-//						work.getDestinationActivity());
-//			}
-//			AeiObjects aeiObjects = new AeiObjects(this.business(), work, activity, processingConfigurator,
-//					processingAttributes);
-//			/* 清空可能的Manual活动预期人员 */
-//			this.arrive_cleanManualTaskIdentityList(aeiObjects);
-//			/* 清空可能的Manual活动授权信息 */
-//			this.arrive_cleanManualEmpowerMap(aeiObjects);
-//			/* 将强制路由标记进行修改 */
-//			work.setForceRouteArriveCurrentActivity(false);
-//			if (BooleanUtils.isTrue(work.getForceRoute())) {
-//				work.setForceRoute(false);
-//				work.setForceRouteArriveCurrentActivity(true);
-//			}
-//			/* 计算是否经过人工节点 */
-//			this.arrive_updateWorkThroughManual(aeiObjects);
-//			/* 清空BeforeExecuted活动执行一次事件 */
-//			work.setBeforeExecuted(false);
-//			aeiObjects.getUpdateWorks().add(work);
-//			this.callBeforeArriveScript(aeiObjects);
-//			this.arriveActivity(aeiObjects);
-//			/* 创建待阅和参阅 */
-//			aeiObjects.getCreateReads().addAll(this.concreteRead(aeiObjects));
-//			aeiObjects.getCreateReviews().addAll(this.concreteReview(aeiObjects));
-//			/*
-//			 * 主方法,进行业务运行
-//			 */
-//			work = this.arriveProcessing(aeiObjects);
-//			/*
-//			 * 主方法结束
-//			 */
-//			if (null == work) {
-//				throw new Exception("arrvie return empty, work{id:" + workId + "}.");
-//			}
-//			if (null != aeiObjects.getProcess()) {
-//				if (StringUtils.equalsIgnoreCase(aeiObjects.getProcess().getSerialActivity(),
-//						aeiObjects.getActivity().getId())
-//						&& (!StringUtils.equals(aeiObjects.getProcess().getSerialPhase(),
-//								Process.SERIALPHASE_INQUIRE))) {
-//					if (StringUtils.isEmpty(work.getSerial())) {
-//						SerialBuilder serialBuilder = new SerialBuilder(ThisApplication.context(),
-//								this.entityManagerContainer(), work.getProcess(), work.getId());
-//						String serial = serialBuilder.concrete(aeiObjects);
-//						work.setSerial(serial);
-//					}
-//				}
-//			}
-//			aeiObjects.commit();
-//			this.arriveCommitted(aeiObjects);
-//			/* 运行AfterArriveScript时间 */
-//			this.callAfterArriveScript(aeiObjects);
-//			return work.getId();
-//		} catch (Exception e) {
-//			logger.error(e);
-//			return null;
-//		}
-//	}
-//
-//	private void arrive_cleanManualTaskIdentityList(AeiObjects aeiObjects) throws Exception {
-//		aeiObjects.getWork().setManualTaskIdentityList(new ArrayList<String>());
-//	}
-//
-//	private void arrive_cleanManualEmpowerMap(AeiObjects aeiObjects) throws Exception {
-//		aeiObjects.getWork().getProperties().setManualEmpowerMap(new LinkedHashMap<String, String>());
-//	}
-//
-//	private void arrive_updateWorkThroughManual(AeiObjects aeiObjects) throws Exception {
-//		boolean value = aeiObjects.getWorkLogs().stream().filter(o -> {
-//			return Objects.equals(ActivityType.manual, o.getArrivedActivityType())
-//					&& BooleanUtils.isTrue(o.getConnected());
-//		}).count() > 0;
-//		aeiObjects.getWork().setWorkThroughManual(value);
-//	}
-//
-//	private void callBeforeArriveScript(AeiObjects aeiObjects) throws Exception {
-//		if (aeiObjects.getActivityProcessingConfigurator().getCallBeforeArriveScript()) {
-//			if (this.hasBeforeArriveScript(aeiObjects.getProcess(), aeiObjects.getActivity())) {
-//				ScriptContext scriptContext = aeiObjects.scriptContext();
-//				CompiledScript cs = null;
-//				if (this.hasBeforeArriveScript(aeiObjects.getProcess())) {
-//					cs = aeiObjects.business().element().getCompiledScript(aeiObjects.getApplication().getId(),
-//							aeiObjects.getProcess(), Business.EVENT_BEFOREARRIVE);
-//					cs.eval(scriptContext);
-//				}
-//				if (this.hasBeforeArriveScript(aeiObjects.getActivity())) {
-//					cs = aeiObjects.business().element().getCompiledScript(aeiObjects.getApplication().getId(),
-//							aeiObjects.getActivity(), Business.EVENT_BEFOREARRIVE);
-//					cs.eval(scriptContext);
-//				}
-//			}
-//		}
-//	}
-//
-//	private void callAfterArriveScript(AeiObjects aeiObjects) throws Exception {
-//		if (aeiObjects.getActivityProcessingConfigurator().getCallAfterArriveScript()) {
-//			if (this.hasAfterArriveScript(aeiObjects.getProcess(), aeiObjects.getActivity())) {
-//				ScriptContext scriptContext = aeiObjects.scriptContext();
-//				CompiledScript cs = null;
-//				if (this.hasAfterArriveScript(aeiObjects.getProcess())) {
-//					cs = aeiObjects.business().element().getCompiledScript(aeiObjects.getApplication().getId(),
-//							aeiObjects.getProcess(), Business.EVENT_AFTERARRIVE);
-//					cs.eval(scriptContext);
-//				}
-//				if (this.hasAfterArriveScript(aeiObjects.getActivity())) {
-//					cs = aeiObjects.business().element().getCompiledScript(aeiObjects.getApplication().getId(),
-//							aeiObjects.getActivity(), Business.EVENT_AFTERARRIVE);
-//					cs.eval(scriptContext);
-//				}
-//			}
-//		}
-//	}
-//
-//	private List<Read> concreteRead(AeiObjects aeiObjects) throws Exception {
-//		List<Read> list = new ArrayList<>();
-//		List<String> identities = TranslateReadIdentityTools.translate(aeiObjects);
-//		for (String identity : ListTools.trim(identities, true, true)) {
-//			String unit = this.business().organization().unit().getWithIdentity(identity);
-//			String person = this.business().organization().person().getWithIdentity(identity);
-//			Read read = new Read(aeiObjects.getWork(), identity, unit, person);
-//			list.add(read);
-//		}
-//		return list;
-//	}
-//
-//	private List<Review> concreteReview(AeiObjects aeiObjects) throws Exception {
-//		List<Review> list = new ArrayList<>();
-//		List<String> people = TranslateReviewPersonTools.translate(aeiObjects);
-//		for (String person : ListTools.trim(people, true, true)) {
-//			Review review = new Review(aeiObjects.getWork(), person);
-//			list.add(review);
-//		}
-//		return list;
-//	}
-//
-//	public List<String> execute(String workId, ProcessingConfigurator processingConfigurator,
-//			ProcessingAttributes processingAttributes) {
-//		List<String> results = new ArrayList<>();
-//		try {
-//			Work work = this.entityManagerContainer().find(workId, Work.class);
-//			if (null == work) {
-//				throw new ExceptionWorkNotExist(workId);
-//			}
-//			if (BooleanUtils.isTrue(work.getForceRoute())) {
-//				/** 如果是调度那么跳过运行 */
-//				results.add(work.getId());
-//				return results;
-//			}
-//			ActivityType activityType = work.getActivityType();
-//			if (null == activityType) {
-//				throw new ExceptionEmptyActivityType(work.getTitle(), work.getId(), work.getActivityType());
-//			}
-//			Activity activity = this.business().element().get(work.getActivity(),
-//					ActivityType.getClassOfActivityType(activityType));
-//			if (null == activity) {
-//				throw new ExceptionActivityNotExist(work.getTitle(), work.getId(), work.getActivityType(),
-//						work.getActivity());
-//			}
-//			AeiObjects aeiObjects = new AeiObjects(this.business(), work, activity, processingConfigurator,
-//					processingAttributes);
-//			aeiObjects.getUpdateWorks().add(work);
-//			/* 如果是调度路由,需要重新设置froceRoute */
-//			if (BooleanUtils.isNotTrue(work.getBeforeExecuted())) {
-//				/* 仅执行一次BeforeExecuteScript中的代码 */
-//				this.callBeforeExecuteScript(aeiObjects);
-//				work.setBeforeExecuted(true);
-//			}
-//			/* 运行业务方法 */
-//			List<Work> works = this.executeProcessing(aeiObjects);
-//
-//			if (ListTools.isNotEmpty(works)) {
-//				for (Work o : works) {
-//					results.add(o.getId());
-//				}
-//			}
-//			aeiObjects.commit();
-//			this.executeCommitted(aeiObjects);
-//			/** 发送在队列中的待办消息, 待办消息必须在数据提交后发送,否则会不到待办 */
-//			if (ListTools.isNotEmpty(works)) {
-//				/** 已经有返回的work将要离开当前环节,执行AfterExecuteScript中的代码 */
-//				this.callAfterExecuteScript(aeiObjects);
-//			}
-//		} catch (Exception e) {
-//			logger.error(e);
-//		}
-//		return results;
-//	}
-//
-//	private void callBeforeExecuteScript(AeiObjects aeiObjects) throws Exception {
-//		if (aeiObjects.getActivityProcessingConfigurator().getCallBeforeExecuteScript()) {
-//			if (this.hasBeforeExecuteScript(aeiObjects.getProcess(), aeiObjects.getActivity())) {
-//				ScriptContext scriptContext = aeiObjects.scriptContext();
-//				CompiledScript cs = null;
-//				if (this.hasBeforeExecuteScript(aeiObjects.getProcess())) {
-//					cs = aeiObjects.business().element().getCompiledScript(aeiObjects.getApplication().getId(),
-//							aeiObjects.getProcess(), Business.EVENT_BEFOREEXECUTE);
-//					cs.eval(scriptContext);
-//				}
-//				if (this.hasBeforeExecuteScript(aeiObjects.getActivity())) {
-//					cs = aeiObjects.business().element().getCompiledScript(aeiObjects.getApplication().getId(),
-//							aeiObjects.getActivity(), Business.EVENT_BEFOREEXECUTE);
-//					cs.eval(scriptContext);
-//				}
-//			}
-//		}
-//	}
-//
-//	private void callAfterExecuteScript(AeiObjects aeiObjects) throws Exception {
-//		if (aeiObjects.getActivityProcessingConfigurator().getCallAfterExecuteScript()) {
-//			if (this.hasAfterExecuteScript(aeiObjects.getProcess(), aeiObjects.getActivity())) {
-//				ScriptContext scriptContext = aeiObjects.scriptContext();
-//				CompiledScript cs = null;
-//				if (this.hasAfterExecuteScript(aeiObjects.getProcess())) {
-//					cs = aeiObjects.business().element().getCompiledScript(aeiObjects.getApplication().getId(),
-//							aeiObjects.getProcess(), Business.EVENT_AFTEREXECUTE);
-//					cs.eval(scriptContext);
-//				}
-//				if (this.hasAfterExecuteScript(aeiObjects.getActivity())) {
-//					cs = aeiObjects.business().element().getCompiledScript(aeiObjects.getApplication().getId(),
-//							aeiObjects.getActivity(), Business.EVENT_AFTEREXECUTE);
-//					cs.eval(scriptContext);
-//				}
-//			}
-//		}
-//	}
-//
-//	public List<String> inquire(String workId, ProcessingConfigurator processingConfigurator,
-//			ProcessingAttributes processingAttributes) {
-//		List<String> results = new ArrayList<>();
-//		try {
-//			Work work = this.entityManagerContainer().find(workId, Work.class);
-//			if (null == work) {
-//				throw new ExceptionWorkNotExist(workId);
-//			}
-//			ActivityType activityType = work.getActivityType();
-//			if (null == activityType) {
-//				throw new ExceptionEmptyActivityType(work.getTitle(), work.getId(), work.getActivityType());
-//			}
-//			Activity activity = this.business().element().get(work.getActivity(),
-//					ActivityType.getClassOfActivityType(activityType));
-//			if (null == activity) {
-//				throw new ExceptionActivityNotExist(work.getTitle(), work.getId(), work.getActivityType(),
-//						work.getActivity());
-//			}
-//			AeiObjects aeiObjects = new AeiObjects(this.business(), work, activity, processingConfigurator,
-//					processingAttributes);
-//			aeiObjects.getUpdateWorks().add(work);
-//			if (BooleanUtils.isTrue(work.getForceRoute())) {
-//				/** 如果是调度那么跳过运行 */
-//				results.add(work.getId());
-//				return results;
-//			}
-//			/* 运行查询路由前脚本 */
-//			this.callBeforeInquireScript(aeiObjects);
-//			/*
-//			 * 运行主方法
-//			 */
-//			List<Route> selectRoutes = this.inquireProcessing(aeiObjects);
-//			/*
-//			 * 主方法运行完成
-//			 */
-//			aeiObjects.addSelectRoutes(selectRoutes);
-//			if ((null == selectRoutes) || selectRoutes.isEmpty()) {
-//				throw new Exception("inquire return empty routes");
-//			}
-//			List<Work> works = new ArrayList<>();
-//			/** 运行查询路由后脚本 */
-//			work.setDestinationActivity(selectRoutes.get(0).getActivity());
-//			work.setDestinationActivityType(selectRoutes.get(0).getActivityType());
-//			work.setDestinationRoute(selectRoutes.get(0).getId());
-//			work.setDestinationRouteName(selectRoutes.get(0).getName());
-//			works.add(work);
-//			// }
-//			for (Work o : works) {
-//				results.add(o.getId());
-//			}
-//			if (null != aeiObjects.getProcess()) {
-//				if (StringUtils.equalsIgnoreCase(aeiObjects.getProcess().getSerialActivity(),
-//						aeiObjects.getActivity().getId())
-//						&& (StringUtils.equals(aeiObjects.getProcess().getSerialPhase(),
-//								Process.SERIALPHASE_INQUIRE))) {
-//					if (StringUtils.isEmpty(work.getSerial())) {
-//						SerialBuilder serialBuilder = new SerialBuilder(ThisApplication.context(),
-//								this.entityManagerContainer(), work.getProcess(), work.getId());
-//						String serial = serialBuilder.concrete(aeiObjects);
-//						work.setSerial(serial);
-//					}
-//				}
-//			}
-//			aeiObjects.commit();
-//			this.inquireCommitted(aeiObjects);
-//			/** 运行 AfterInquireScript事件 */
-//			this.callAfterInquireScript(aeiObjects);
-//		} catch (Exception e) {
-//			logger.error(e);
-//		}
-//		return results;
-//	}
-//
-//	private void callBeforeInquireScript(AeiObjects aeiObjects) throws Exception {
-//		if (aeiObjects.getActivityProcessingConfigurator().getCallBeforeInquireScript()) {
-//			if (this.hasBeforeInquireScript(aeiObjects.getProcess(), aeiObjects.getActivity())) {
-//				ScriptContext scriptContext = aeiObjects.scriptContext();
-//				CompiledScript cs = null;
-//				if (this.hasBeforeInquireScript(aeiObjects.getProcess())) {
-//					cs = aeiObjects.business().element().getCompiledScript(aeiObjects.getApplication().getId(),
-//							aeiObjects.getProcess(), Business.EVENT_BEFOREINQUIRE);
-//					cs.eval(scriptContext);
-//				}
-//				if (this.hasBeforeInquireScript(aeiObjects.getActivity())) {
-//					cs = aeiObjects.business().element().getCompiledScript(aeiObjects.getApplication().getId(),
-//							aeiObjects.getActivity(), Business.EVENT_BEFOREINQUIRE);
-//					cs.eval(scriptContext);
-//				}
-//			}
-//		}
-//	}
-//
-//	private void callAfterInquireScript(AeiObjects aeiObjects) throws Exception {
-//		if (aeiObjects.getActivityProcessingConfigurator().getCallAfterInquireScript()) {
-//			if (this.hasAfterInquireScript(aeiObjects.getProcess(), aeiObjects.getActivity())) {
-//				ScriptContext scriptContext = aeiObjects.scriptContext();
-//				CompiledScript cs = null;
-//				if (this.hasAfterInquireScript(aeiObjects.getProcess())) {
-//					cs = aeiObjects.business().element().getCompiledScript(aeiObjects.getApplication().getId(),
-//							aeiObjects.getProcess(), Business.EVENT_AFTERINQUIRE);
-//					cs.eval(scriptContext);
-//				}
-//				if (this.hasAfterInquireScript(aeiObjects.getActivity())) {
-//					cs = aeiObjects.business().element().getCompiledScript(aeiObjects.getApplication().getId(),
-//							aeiObjects.getActivity(), Business.EVENT_AFTERINQUIRE);
-//					cs.eval(scriptContext);
-//				}
-//			}
-//		}
-//	}
-//
-//	protected abstract Work arriveProcessing(AeiObjects aeiObjects) throws Exception;
-//
-//	protected abstract void arriveCommitted(AeiObjects aeiObjects) throws Exception;
-//
-//	protected abstract List<Work> executeProcessing(AeiObjects aeiObjects) throws Exception;
-//
-//	protected abstract void executeCommitted(AeiObjects aeiObjects) throws Exception;
-//
-//	protected abstract List<Route> inquireProcessing(AeiObjects aeiObjects) throws Exception;
-//
-//	protected abstract void inquireCommitted(AeiObjects aeiObjects) throws Exception;
-//
-//}

+ 364 - 278
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/AeiObjects.java

@@ -11,10 +11,6 @@ import javax.script.Bindings;
 import javax.script.ScriptContext;
 import javax.script.SimpleScriptContext;
 
-import org.apache.commons.collections4.ListUtils;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.commons.lang3.StringUtils;
-
 import com.google.gson.reflect.TypeToken;
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.entity.JpaObject;
@@ -60,6 +56,10 @@ import com.x.processplatform.service.processing.WorkDataHelper;
 import com.x.processplatform.service.processing.configurator.ActivityProcessingConfigurator;
 import com.x.processplatform.service.processing.configurator.ProcessingConfigurator;
 
+import org.apache.commons.collections4.ListUtils;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.commons.lang3.StringUtils;
+
 public class AeiObjects extends GsonPropertyObject {
 
 	private static Logger logger = LoggerFactory.getLogger(AeiObjects.class);
@@ -225,16 +225,15 @@ public class AeiObjects extends GsonPropertyObject {
 	}
 
 	public List<Projection> getProjections() throws Exception {
-		if (null == this.projections) {
-			if (null != this.getProcess()) {
-				String text = this.getProcess().getProjection();
-				if (XGsonBuilder.isJsonArray(text)) {
-					this.projections = XGsonBuilder.instance().fromJson(text, new TypeToken<List<Projection>>() {
-					}.getType());
-				}
+		if ((null == this.projections) && (null != this.getProcess())) {
+			String text = this.getProcess().getProjection();
+			if (XGsonBuilder.isJsonArray(text)) {
+				this.projections = XGsonBuilder.instance().fromJson(text, new TypeToken<List<Projection>>() {
+				}.getType());
 			}
 		}
 		return this.projections;
+
 	}
 
 	public List<Mapping> getMappings() throws Exception {
@@ -268,8 +267,7 @@ public class AeiObjects extends GsonPropertyObject {
 
 	public List<Route> getRoutes() throws Exception {
 		if (null == this.routes) {
-			this.routes = this.business.element().listRouteWithActvity(work.getActivity(),
-					work.getActivityType());
+			this.routes = this.business.element().listRouteWithActvity(work.getActivity(), work.getActivityType());
 		}
 		return this.routes;
 	}
@@ -595,90 +593,127 @@ public class AeiObjects extends GsonPropertyObject {
 
 	private void executeProjection() throws Exception {
 		if (ListTools.isNotEmpty(this.getProjections())) {
-			if (this.getProcess().getProjectionFully()) {
+			executeProjectionFullyNotIncludeNormal();
+			executeProjectionWork();
+			executeProjectionTask();
+			executeProjectionTaskCompleted();
+			executeProjectionRead();
+			executeProjectionReadCompleted();
+			executeProjectionReview();
+		}
+	}
 
-				for (Work o : this.getWorks()) {
-					if ((!this.getUpdateWorks().contains(o)) && (!this.getDeleteWorks().contains(o))) {
-						this.getUpdateWorks().add(o);
-					}
-				}
+	private void executeProjectionWork() throws Exception {
+		for (Work o : this.getCreateWorks()) {
+			ProjectionFactory.projectionWork(this.getProjections(), this.getData(), o);
+		}
+		for (Work o : this.getUpdateWorks()) {
+			ProjectionFactory.projectionWork(this.getProjections(), this.getData(), o);
+		}
+	}
 
-				for (Task o : this.getTasks()) {
-					if ((!this.getUpdateTasks().contains(o)) && (!this.getDeleteTasks().contains(o))) {
-						this.getUpdateTasks().add(o);
-					}
-				}
+	private void executeProjectionTask() throws Exception {
+		for (Task o : this.getCreateTasks()) {
+			ProjectionFactory.projectionTask(this.getProjections(), this.getData(), o);
+		}
+		for (Task o : this.getUpdateTasks()) {
+			ProjectionFactory.projectionTask(this.getProjections(), this.getData(), o);
+		}
+	}
 
-				for (TaskCompleted o : this.getTaskCompleteds()) {
-					if ((!this.getUpdateTaskCompleteds().contains(o))
-							&& (!this.getDeleteTaskCompleteds().contains(o))) {
-						this.getUpdateTaskCompleteds().add(o);
-					}
-				}
+	private void executeProjectionTaskCompleted() throws Exception {
+		for (TaskCompleted o : this.getCreateTaskCompleteds()) {
+			ProjectionFactory.projectionTaskCompleted(this.getProjections(), this.getData(), o);
+		}
+		for (TaskCompleted o : this.getUpdateTaskCompleteds()) {
+			ProjectionFactory.projectionTaskCompleted(this.getProjections(), this.getData(), o);
+		}
+	}
 
-				for (Read o : this.getReads()) {
-					if ((!this.getUpdateReads().contains(o)) && (!this.getDeleteReads().contains(o))) {
-						this.getUpdateReads().add(o);
-					}
-				}
+	private void executeProjectionRead() throws Exception {
+		for (Read o : this.getCreateReads()) {
+			ProjectionFactory.projectionRead(this.getProjections(), this.getData(), o);
+		}
+		for (Read o : this.getUpdateReads()) {
+			ProjectionFactory.projectionRead(this.getProjections(), this.getData(), o);
+		}
+	}
 
-				for (ReadCompleted o : this.getReadCompleteds()) {
-					if ((!this.getUpdateReadCompleteds().contains(o))
-							&& (!this.getDeleteReadCompleteds().contains(o))) {
-						this.getUpdateReadCompleteds().add(o);
-					}
-				}
+	private void executeProjectionReadCompleted() throws Exception {
+		for (ReadCompleted o : this.getCreateReadCompleteds()) {
+			ProjectionFactory.projectionReadCompleted(this.getProjections(), this.getData(), o);
+		}
 
-				for (Review o : this.getReviews()) {
-					if ((!this.getUpdateReviews().contains(o)) && (!this.getDeleteReviews().contains(o))) {
-						this.getUpdateReviews().add(o);
-					}
-				}
+		for (ReadCompleted o : this.getUpdateReadCompleteds()) {
+			ProjectionFactory.projectionReadCompleted(this.getProjections(), this.getData(), o);
+		}
+	}
 
-			}
+	private void executeProjectionReview() throws Exception {
+		for (Review o : this.getUpdateReviews()) {
+			ProjectionFactory.projectionReview(this.getProjections(), this.getData(), o);
+		}
 
-			for (Work o : this.getCreateWorks()) {
-				ProjectionFactory.projectionWork(this.getProjections(), this.getData(), o);
-			}
-			for (Work o : this.getUpdateWorks()) {
-				ProjectionFactory.projectionWork(this.getProjections(), this.getData(), o);
-			}
+		for (Review o : this.getDeleteReviews()) {
+			ProjectionFactory.projectionReview(this.getProjections(), this.getData(), o);
+		}
+	}
 
-			for (Task o : this.getCreateTasks()) {
-				ProjectionFactory.projectionTask(this.getProjections(), this.getData(), o);
-			}
-			for (Task o : this.getUpdateTasks()) {
-				ProjectionFactory.projectionTask(this.getProjections(), this.getData(), o);
-			}
+	private void executeProjectionFullyNotIncludeNormal() throws Exception {
+		if (BooleanUtils.isTrue(this.getProcess().getProjectionFully())) {
+			executeProjectionFullyNotIncludeNormalWork();
+			executeProjectionFullyNotIncludeNormalTask();
+			executeProjectionFullyNotIncludeNormalTaskCompleted();
+			executeProjectionFullyNotIncludeNormalRead();
+			executeProjectionFullyNotIncludeNormalReadCompleted();
+			executeProjectionFullyNotIncludeNormalReview();
+		}
+	}
 
-			for (TaskCompleted o : this.getCreateTaskCompleteds()) {
-				ProjectionFactory.projectionTaskCompleted(this.getProjections(), this.getData(), o);
-			}
-			for (TaskCompleted o : this.getUpdateTaskCompleteds()) {
-				ProjectionFactory.projectionTaskCompleted(this.getProjections(), this.getData(), o);
+	private void executeProjectionFullyNotIncludeNormalWork() throws Exception {
+		for (Work o : this.getWorks()) {
+			if ((!this.getUpdateWorks().contains(o)) && (!this.getDeleteWorks().contains(o))) {
+				this.getUpdateWorks().add(o);
 			}
+		}
+	}
 
-			for (Read o : this.getCreateReads()) {
-				ProjectionFactory.projectionRead(this.getProjections(), this.getData(), o);
-			}
-			for (Read o : this.getUpdateReads()) {
-				ProjectionFactory.projectionRead(this.getProjections(), this.getData(), o);
+	private void executeProjectionFullyNotIncludeNormalTask() throws Exception {
+		for (Task o : this.getTasks()) {
+			if ((!this.getUpdateTasks().contains(o)) && (!this.getDeleteTasks().contains(o))) {
+				this.getUpdateTasks().add(o);
 			}
+		}
+	}
 
-			for (ReadCompleted o : this.getCreateReadCompleteds()) {
-				ProjectionFactory.projectionReadCompleted(this.getProjections(), this.getData(), o);
+	private void executeProjectionFullyNotIncludeNormalTaskCompleted() throws Exception {
+		for (TaskCompleted o : this.getTaskCompleteds()) {
+			if ((!this.getUpdateTaskCompleteds().contains(o)) && (!this.getDeleteTaskCompleteds().contains(o))) {
+				this.getUpdateTaskCompleteds().add(o);
 			}
+		}
+	}
 
-			for (ReadCompleted o : this.getUpdateReadCompleteds()) {
-				ProjectionFactory.projectionReadCompleted(this.getProjections(), this.getData(), o);
+	private void executeProjectionFullyNotIncludeNormalRead() throws Exception {
+		for (Read o : this.getReads()) {
+			if ((!this.getUpdateReads().contains(o)) && (!this.getDeleteReads().contains(o))) {
+				this.getUpdateReads().add(o);
 			}
+		}
+	}
 
-			for (Review o : this.getUpdateReviews()) {
-				ProjectionFactory.projectionReview(this.getProjections(), this.getData(), o);
+	private void executeProjectionFullyNotIncludeNormalReadCompleted() throws Exception {
+		for (ReadCompleted o : this.getReadCompleteds()) {
+			if ((!this.getUpdateReadCompleteds().contains(o)) && (!this.getDeleteReadCompleteds().contains(o))) {
+				this.getUpdateReadCompleteds().add(o);
 			}
+		}
+	}
 
-			for (Review o : this.getDeleteReviews()) {
-				ProjectionFactory.projectionReview(this.getProjections(), this.getData(), o);
+	private void executeProjectionFullyNotIncludeNormalReview() throws Exception {
+		for (Review o : this.getReviews()) {
+			if ((!this.getUpdateReviews().contains(o)) && (!this.getDeleteReviews().contains(o))) {
+				this.getUpdateReviews().add(o);
 			}
 		}
 	}
@@ -816,238 +851,289 @@ public class AeiObjects extends GsonPropertyObject {
 		if (ListTools.isNotEmpty(this.getCreateTasks()) || ListTools.isNotEmpty(this.getDeleteTasks())
 				|| ListTools.isNotEmpty(this.getUpdateTasks())) {
 			this.entityManagerContainer().beginTransaction(Task.class);
-			/* 保存待办 */
-			this.getCreateTasks().stream().forEach(o -> {
-				try {
-					o.setSeries(this.getProcessingAttributes().getSeries());
-					/* 写入本次操作串号 */
-					this.business.entityManagerContainer().persist(o, CheckPersistType.all);
-					/* 创建待办的参阅 */
-					this.createReview(new Review(this.getWork(), o.getPerson()));
-				} catch (Exception e) {
-					logger.error(e);
-				}
-			});
-			/* 更新待办 */
-			this.getUpdateTasks().stream().forEach(o -> {
-				try {
-					this.business.entityManagerContainer().check(o, CheckPersistType.all);
-				} catch (Exception e) {
-					logger.error(e);
+			// 保存待办
+			commitTaskCreatePart();
+			// 更新待办
+			commitTaskUpdatePart();
+			// 删除待办
+			commitTaskDeletePart();
+		}
+	}
+
+	private void commitTaskCreatePart() {
+		this.getCreateTasks().stream().forEach(o -> {
+			try {
+				if (StringUtils.isEmpty(this.processingAttributes.getIdentity())) {
+					o.getProperties()
+							.setPrevTaskIdentityList(ListTools.trim(o.getProperties().getPrevTaskIdentityList(), true,
+									true, this.processingAttributes.getIdentity()));
 				}
-			});
-			/* 删除待办 */
-			this.getDeleteTasks().stream().forEach(o -> {
-				Task obj;
-				try {
-					obj = this.business.entityManagerContainer().find(o.getId(), Task.class);
-					if (null != obj) {
-						this.business.entityManagerContainer().remove(obj, CheckRemoveType.all);
-						/* 发送删除待办消息 */
-						// MessageFactory.task_delete(obj);
-					}
-				} catch (Exception e) {
-					logger.error(e);
+				// 写入本次操作串号
+				o.setSeries(this.getProcessingAttributes().getSeries());
+				this.business.entityManagerContainer().persist(o, CheckPersistType.all);
+				// 创建待办的参阅
+				this.createReview(new Review(this.getWork(), o.getPerson()));
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
+	}
+
+	private void commitTaskUpdatePart() {
+		this.getUpdateTasks().stream().forEach(o -> {
+			try {
+				this.business.entityManagerContainer().check(o, CheckPersistType.all);
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
+	}
+
+	private void commitTaskDeletePart() {
+		this.getDeleteTasks().stream().forEach(o -> {
+			Task obj;
+			try {
+				obj = this.business.entityManagerContainer().find(o.getId(), Task.class);
+				if (null != obj) {
+					this.business.entityManagerContainer().remove(obj, CheckRemoveType.all);
 				}
-			});
-		}
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
 	}
 
 	private void commitTaskCompleted() throws Exception {
 		if (ListTools.isNotEmpty(this.getCreateTaskCompleteds()) || ListTools.isNotEmpty(this.getDeleteTaskCompleteds())
 				|| ListTools.isNotEmpty(this.getUpdateTaskCompleteds())) {
 			this.entityManagerContainer().beginTransaction(TaskCompleted.class);
-			/* 保存已办 */
-			this.getCreateTaskCompleteds().stream().forEach(o -> {
-				try {
-					/* 将相同用户的其他已办的lastest标记为false */
-					this.getTaskCompleteds().stream().filter(p -> StringUtils.equals(o.getPerson(), p.getPerson()))
-							.forEach(p -> p.setLatest(false));
-					this.business.entityManagerContainer().persist(o, CheckPersistType.all);
-					/* 创建已办的参阅 */
-					this.createReview(new Review(this.getWork(), o.getPerson()));
-				} catch (Exception e) {
-					logger.error(e);
-				}
-			});
-			/* 更新已办 */
-			this.getUpdateTaskCompleteds().stream().forEach(o -> {
-				try {
-					this.business.entityManagerContainer().check(o, CheckPersistType.all);
-				} catch (Exception e) {
-					logger.error(e);
+			// 保存已办
+			commitTaskCompletedCreatePart();
+			// 更新已办
+			commitTaskCompletedUpdatePart();
+			// 删除已办 */
+			commitTaskCompletedDeletePart();
+		}
+	}
+
+	private void commitTaskCompletedCreatePart() {
+		this.getCreateTaskCompleteds().stream().forEach(o -> {
+			try {
+				/* 将相同用户的其他已办的lastest标记为false */
+				this.getTaskCompleteds().stream().filter(p -> StringUtils.equals(o.getPerson(), p.getPerson()))
+						.forEach(p -> p.setLatest(false));
+				this.business.entityManagerContainer().persist(o, CheckPersistType.all);
+				/* 创建已办的参阅 */
+				this.createReview(new Review(this.getWork(), o.getPerson()));
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
+	}
+
+	private void commitTaskCompletedUpdatePart() {
+		this.getUpdateTaskCompleteds().stream().forEach(o -> {
+			try {
+				this.business.entityManagerContainer().check(o, CheckPersistType.all);
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
+	}
+
+	private void commitTaskCompletedDeletePart() {
+		this.getDeleteTaskCompleteds().stream().forEach(o -> {
+			TaskCompleted obj;
+			try {
+				/* 要删除此已经办前此人其他的已办lastest标记为true */
+				TaskCompleted lastest = this.getTaskCompleteds().stream()
+						.filter(p -> StringUtils.equals(o.getPerson(), p.getPerson())
+								&& (!StringUtils.equals(o.getId(), p.getId())))
+						.sorted(Comparator
+								.comparing(TaskCompleted::getStartTime, Comparator.nullsFirst(Date::compareTo))
+								.reversed())
+						.findFirst().orElse(null);
+				if (null != lastest) {
+					lastest.setLatest(true);
 				}
-			});
-			/* 删除已办 */
-			this.getDeleteTaskCompleteds().stream().forEach(o -> {
-				TaskCompleted obj;
-				try {
-					/* 要删除此已经办前此人其他的已办lastest标记为true */
-					TaskCompleted lastest = this.getTaskCompleteds().stream()
-							.filter(p -> StringUtils.equals(o.getPerson(), p.getPerson())
-									&& (!StringUtils.equals(o.getId(), p.getId())))
-							.sorted(Comparator
-									.comparing(TaskCompleted::getStartTime, Comparator.nullsFirst(Date::compareTo))
-									.reversed())
-							.findFirst().orElse(null);
-					if (null != lastest) {
-						lastest.setLatest(true);
-					}
-					obj = this.business.entityManagerContainer().find(o.getId(), TaskCompleted.class);
-					if (null != obj) {
-						this.business.entityManagerContainer().remove(obj, CheckRemoveType.all);
-					}
-				} catch (Exception e) {
-					logger.error(e);
+				obj = this.business.entityManagerContainer().find(o.getId(), TaskCompleted.class);
+				if (null != obj) {
+					this.business.entityManagerContainer().remove(obj, CheckRemoveType.all);
 				}
-			});
-		}
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
 	}
 
 	private void commitRead() throws Exception {
 		if (ListTools.isNotEmpty(this.getCreateReads()) || ListTools.isNotEmpty(this.getDeleteReads())
 				|| ListTools.isNotEmpty(this.getUpdateReads())) {
 			this.entityManagerContainer().beginTransaction(Read.class);
-			/* 保存待阅 */
-			this.getCreateReads().stream().forEach(o -> {
-				Read obj;
-				try {
-					obj = this.getReads().stream().filter(p -> StringUtils.equals(o.getJob(), p.getJob())
-							&& StringUtils.equals(o.getPerson(), p.getPerson())).findFirst().orElse(null);
-					if (null == obj) {
-						this.business.entityManagerContainer().persist(o, CheckPersistType.all);
-						/* 发送创建待阅消息 */
-						// MessageFactory.read_create(o);
-						/* 创建待阅的参阅 */
-						this.createReview(new Review(this.getWork(), o.getPerson()));
-					} else {
-						o.copyTo(obj, JpaObject.FieldsUnmodify);
-					}
-				} catch (Exception e) {
-					logger.error(e);
-				}
-			});
-			/* 更新待阅 */
-			this.getUpdateReads().stream().forEach(o -> {
-				try {
-					this.business.entityManagerContainer().check(o, CheckPersistType.all);
-				} catch (Exception e) {
-					logger.error(e);
+			// 保存待阅
+			commitReadCreatePart();
+			// 更新待阅
+			commitReadUpdatePart();
+			// 删除待阅
+			commitReadDeletePart();
+		}
+	}
+
+	private void commitReadCreatePart() {
+		this.getCreateReads().stream().forEach(o -> {
+			Read obj;
+			try {
+				obj = this.getReads().stream().filter(p -> StringUtils.equals(o.getJob(), p.getJob())
+						&& StringUtils.equals(o.getPerson(), p.getPerson())).findFirst().orElse(null);
+				if (null == obj) {
+					this.business.entityManagerContainer().persist(o, CheckPersistType.all);
+					/* 创建待阅的参阅 */
+					this.createReview(new Review(this.getWork(), o.getPerson()));
+				} else {
+					o.copyTo(obj, JpaObject.FieldsUnmodify);
 				}
-			});
-			/* 删除待阅 */
-			this.getDeleteReads().stream().forEach(o -> {
-				Read obj;
-				try {
-					obj = this.business.entityManagerContainer().find(o.getId(), Read.class);
-					if (null != obj) {
-						this.business.entityManagerContainer().remove(obj, CheckRemoveType.all);
-						/* 发送删除待阅消息 */
-						// MessageFactory.read_delete(obj);
-					}
-				} catch (Exception e) {
-					logger.error(e);
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
+	}
+
+	private void commitReadUpdatePart() {
+		this.getUpdateReads().stream().forEach(o -> {
+			try {
+				this.business.entityManagerContainer().check(o, CheckPersistType.all);
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
+	}
+
+	private void commitReadDeletePart() {
+		this.getDeleteReads().stream().forEach(o -> {
+			Read obj;
+			try {
+				obj = this.business.entityManagerContainer().find(o.getId(), Read.class);
+				if (null != obj) {
+					this.business.entityManagerContainer().remove(obj, CheckRemoveType.all);
 				}
-			});
-		}
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
 	}
 
 	private void commitReadCompleted() throws Exception {
 		if (ListTools.isNotEmpty(this.getCreateReadCompleteds()) || ListTools.isNotEmpty(this.getDeleteReadCompleteds())
 				|| ListTools.isNotEmpty(this.getUpdateReadCompleteds())) {
 			this.entityManagerContainer().beginTransaction(ReadCompleted.class);
-			/* 保存已阅 */
-			this.getCreateReadCompleteds().stream().forEach(o -> {
-				ReadCompleted obj;
-				try {
-					/* 已阅唯一 */
-					obj = this.getReadCompleteds().stream().filter(p -> StringUtils.equals(o.getJob(), p.getJob())
-							&& StringUtils.equals(o.getPerson(), p.getPerson())).findFirst().orElse(null);
-					if (null == obj) {
-						this.business.entityManagerContainer().persist(o, CheckPersistType.all);
-						/* 发送创建已阅消息 */
-						// MessageFactory.readCompleted_create(o);
-						/* 创建已阅参阅 */
-						this.createReview(new Review(this.getWork(), o.getPerson()));
-					} else {
-						/* 如果逻辑上相同的已阅已经存在,覆盖内容. */
-						o.copyTo(obj, JpaObject.FieldsUnmodify);
-					}
-				} catch (Exception e) {
-					logger.error(e);
-				}
-			});
-			/* 更新已阅 */
-			this.getUpdateReadCompleteds().stream().forEach(o -> {
-				try {
-					this.business.entityManagerContainer().check(o, CheckPersistType.all);
-				} catch (Exception e) {
-					logger.error(e);
+			// 保存已阅
+			commitReadCompletedCreatePart();
+			// 更新已阅
+			commitReadCompletedUpdatePart();
+			// 删除已阅
+			commitReadCompletedDeletePart();
+		}
+	}
+
+	private void commitReadCompletedCreatePart() {
+		this.getCreateReadCompleteds().stream().forEach(o -> {
+			ReadCompleted obj;
+			try {
+				// 已阅唯一
+				obj = this.getReadCompleteds().stream().filter(p -> StringUtils.equals(o.getJob(), p.getJob())
+						&& StringUtils.equals(o.getPerson(), p.getPerson())).findFirst().orElse(null);
+				if (null == obj) {
+					this.business.entityManagerContainer().persist(o, CheckPersistType.all);
+					// 创建已阅参阅
+					this.createReview(new Review(this.getWork(), o.getPerson()));
+				} else {
+					// 如果逻辑上相同的已阅已经存在,覆盖内容.
+					o.copyTo(obj, JpaObject.FieldsUnmodify);
 				}
-			});
-			/* 删除已阅 */
-			this.getDeleteReadCompleteds().stream().forEach(o -> {
-				ReadCompleted obj;
-				try {
-					obj = this.business.entityManagerContainer().find(o.getId(), ReadCompleted.class);
-					if (null != obj) {
-						this.business.entityManagerContainer().remove(obj, CheckRemoveType.all);
-						/* 发送删除已阅消息 */
-						// MessageFactory.readCompleted_delete(obj);
-					}
-				} catch (Exception e) {
-					logger.error(e);
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
+	}
+
+	private void commitReadCompletedUpdatePart() {
+		this.getUpdateReadCompleteds().stream().forEach(o -> {
+			try {
+				this.business.entityManagerContainer().check(o, CheckPersistType.all);
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
+	}
+
+	private void commitReadCompletedDeletePart() {
+		this.getDeleteReadCompleteds().stream().forEach(o -> {
+			ReadCompleted obj;
+			try {
+				obj = this.business.entityManagerContainer().find(o.getId(), ReadCompleted.class);
+				if (null != obj) {
+					this.business.entityManagerContainer().remove(obj, CheckRemoveType.all);
 				}
-			});
-		}
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
 	}
 
 	private void commitReview() throws Exception {
 		if (ListTools.isNotEmpty(this.getCreateReviews()) || ListTools.isNotEmpty(this.getDeleteReviews())
 				|| ListTools.isNotEmpty(this.getUpdateReviews())) {
 			this.entityManagerContainer().beginTransaction(Review.class);
-			/* 保存参阅 */
-			this.getCreateReviews().stream().forEach(o -> {
-				Review obj;
-				try {
-					/* 参阅唯一 */
-					obj = this.getReviews().stream().filter(p -> StringUtils.equals(o.getJob(), p.getJob())
-							&& StringUtils.equals(o.getPerson(), p.getPerson())).findFirst().orElse(null);
-					if (null == obj) {
-						this.business.entityManagerContainer().persist(o, CheckPersistType.all);
-						/* 发送创建参阅消息 */
-						// MessageFactory.review_create(o);
-					} else {
-						/* 如果逻辑上相同的已阅已经存在,覆盖内容. */
-						o.copyTo(obj, JpaObject.FieldsUnmodify);
-					}
-				} catch (Exception e) {
-					logger.error(e);
-				}
-			});
-			/* 更新参阅 */
-			this.getUpdateReviews().stream().forEach(o -> {
-				try {
-					this.business.entityManagerContainer().check(o, CheckPersistType.all);
-				} catch (Exception e) {
-					logger.error(e);
+			// 保存参阅
+			commitReviewCreatePart();
+			// 更新参阅
+			commitReviewUpdatePart();
+			// 删除参阅
+			commitReviewDeletePart();
+		}
+	}
+
+	private void commitReviewCreatePart() {
+		this.getCreateReviews().stream().forEach(o -> {
+			Review obj;
+			try {
+				/* 参阅唯一 */
+				obj = this.getReviews().stream().filter(p -> StringUtils.equals(o.getJob(), p.getJob())
+						&& StringUtils.equals(o.getPerson(), p.getPerson())).findFirst().orElse(null);
+				if (null == obj) {
+					this.business.entityManagerContainer().persist(o, CheckPersistType.all);
+				} else {
+					// 如果逻辑上相同的已阅已经存在,覆盖内容.
+					o.copyTo(obj, JpaObject.FieldsUnmodify);
 				}
-			});
-			/* 删除参阅 */
-			this.getDeleteReviews().stream().forEach(o -> {
-				Review obj;
-				try {
-					obj = this.business.entityManagerContainer().find(o.getId(), Review.class);
-					if (null != obj) {
-						this.business.entityManagerContainer().remove(obj, CheckRemoveType.all);
-						/* 发送删除参阅消息 */
-						// MessageFactory.review_delete(obj);
-					}
-				} catch (Exception e) {
-					logger.error(e);
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
+	}
+
+	private void commitReviewUpdatePart() {
+		this.getUpdateReviews().stream().forEach(o -> {
+			try {
+				this.business.entityManagerContainer().check(o, CheckPersistType.all);
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
+	}
+
+	private void commitReviewDeletePart() {
+		this.getDeleteReviews().stream().forEach(o -> {
+			Review obj;
+			try {
+				obj = this.business.entityManagerContainer().find(o.getId(), Review.class);
+				if (null != obj) {
+					this.business.entityManagerContainer().remove(obj, CheckRemoveType.all);
 				}
-			});
-		}
+			} catch (Exception e) {
+				logger.error(e);
+			}
+		});
 	}
 
 	private void commitDocumentVersion() throws Exception {
@@ -1197,7 +1283,7 @@ public class AeiObjects extends GsonPropertyObject {
 		List<TaskCompleted> copyOfCreateTaskCompleteds = new ArrayList<>(this.getCreateTaskCompleteds());
 		List<Task> copyOfDeleteTasks = new ArrayList<>(this.getDeleteTasks());
 		for (Entry<TaskCompleted, Task> entry : ListTools.pairWithProperty(copyOfCreateTaskCompleteds,
-				TaskCompleted.task_FIELDNAME, copyOfDeleteTasks, Task.id_FIELDNAME).entrySet()) {
+				TaskCompleted.task_FIELDNAME, copyOfDeleteTasks, JpaObject.id_FIELDNAME).entrySet()) {
 			copyOfCreateTaskCompleteds.remove(entry.getKey());
 			copyOfDeleteTasks.remove(entry.getValue());
 			MessageFactory.task_to_taskCompleted(entry.getKey());
@@ -1206,7 +1292,7 @@ public class AeiObjects extends GsonPropertyObject {
 		List<ReadCompleted> copyOfCreateReadCompleteds = new ArrayList<>(this.getCreateReadCompleteds());
 		List<Read> copyOfDeleteReads = new ArrayList<>(this.getDeleteReads());
 		for (Entry<ReadCompleted, Read> entry : ListTools.pairWithProperty(copyOfCreateReadCompleteds,
-				ReadCompleted.read_FIELDNAME, copyOfDeleteReads, Read.id_FIELDNAME).entrySet()) {
+				ReadCompleted.read_FIELDNAME, copyOfDeleteReads, JpaObject.id_FIELDNAME).entrySet()) {
 			copyOfCreateReadCompleteds.remove(entry.getKey());
 			copyOfDeleteReads.remove(entry.getValue());
 			MessageFactory.read_to_readCompleted(entry.getKey());
@@ -1216,7 +1302,7 @@ public class AeiObjects extends GsonPropertyObject {
 		List<WorkCompleted> copyOfCreateWorkCompleteds = new ArrayList<>(this.getCreateWorkCompleteds());
 		List<Work> copyOfDeleteWorks = new ArrayList<>(this.getDeleteWorks());
 		for (Entry<WorkCompleted, Work> entry : ListTools.pairWithProperty(copyOfCreateWorkCompleteds,
-				WorkCompleted.work_FIELDNAME, copyOfDeleteWorks, Read.id_FIELDNAME).entrySet()) {
+				WorkCompleted.work_FIELDNAME, copyOfDeleteWorks, JpaObject.id_FIELDNAME).entrySet()) {
 			copyOfCreateWorkCompleteds.remove(entry.getKey());
 			copyOfDeleteWorks.remove(entry.getValue());
 			MessageFactory.work_to_workCompleted(entry.getKey());