Browse Source

用户撤回工单,当前节点未设置表单,撤回成功,但打开异常报未找到表单

o2sword 5 years ago
parent
commit
f61aea7f13

+ 8 - 6
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/factory/ElementFactory.java

@@ -92,14 +92,16 @@ public class ElementFactory extends AbstractFactory {
 			t = (T) optional.get();
 		} else {
 			t = this.entityManagerContainer().find(id, clz);
-			CacheManager.put(cacheCategory, cacheKey, t);
+			if(t != null) {
+				CacheManager.put(cacheCategory, cacheKey, t);
+			}
 		}
 		return t;
 	}
 
 	public Activity getActivity(String id) throws Exception {
 		Activity activity = null;
-		activity = this.get(id, ActivityType.agent);
+		activity = this.get(id, ActivityType.manual);
 		if (null == activity) {
 			activity = this.get(id, ActivityType.begin);
 			if (null == activity) {
@@ -111,11 +113,11 @@ public class ElementFactory extends AbstractFactory {
 						if (null == activity) {
 							activity = this.get(id, ActivityType.embed);
 							if (null == activity) {
-								activity = this.get(id, ActivityType.end);
+								activity = this.get(id, ActivityType.split);
 								if (null == activity) {
 									activity = this.get(id, ActivityType.invoke);
 									if (null == activity) {
-										activity = this.get(id, ActivityType.manual);
+										activity = this.get(id, ActivityType.agent);
 										if (null == activity) {
 											activity = this.get(id, ActivityType.merge);
 											if (null == activity) {
@@ -125,7 +127,7 @@ public class ElementFactory extends AbstractFactory {
 													if (null == activity) {
 														activity = this.get(id, ActivityType.service);
 														if (null == activity) {
-															activity = this.get(id, ActivityType.split);
+															activity = this.get(id, ActivityType.end);
 														}
 													}
 												}
@@ -735,4 +737,4 @@ public class ElementFactory extends AbstractFactory {
 		}
 		return compiledScript;
 	}
-}
+}

+ 6 - 2
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/V2Retract.java

@@ -25,6 +25,7 @@ import com.x.processplatform.core.entity.content.Work;
 import com.x.processplatform.core.entity.content.WorkLog;
 import com.x.processplatform.core.entity.element.Activity;
 import com.x.processplatform.core.entity.element.Application;
+import com.x.processplatform.core.entity.element.Form;
 import com.x.processplatform.core.entity.element.Process;
 import com.x.processplatform.core.entity.element.util.WorkLogTree;
 import com.x.processplatform.core.entity.element.util.WorkLogTree.Node;
@@ -99,7 +100,10 @@ class V2Retract extends BaseAction {
 					}
 
 					if (StringUtils.isNotEmpty(activity.getForm())) {
-						work.setForm(activity.getForm());
+						Form form = business.element().get(activity.getForm(), Form.class);
+						if (null != form) {
+							work.setForm(activity.getForm());
+						}
 					}
 
 					update(work, workLog);
@@ -269,4 +273,4 @@ class V2Retract extends BaseAction {
 
 	public static class Wo extends WrapBoolean {
 	}
-}
+}