فهرست منبع

流程平台流程模板设计搜索

o2sword 5 سال پیش
والد
کامیت
c317d91851

+ 24 - 3
o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/WrapDesigner.java

@@ -100,9 +100,30 @@ public class WrapDesigner extends GsonPropertyObject {
 		}
 	}
 
-	public DesignerPattern getPatternInstant(){
-		DesignerPattern pattern = new DesignerPattern();
-		return pattern;
+	public void addPatternList(String elementType, Map<String, String> map) {
+		if(map!=null && !map.isEmpty()){
+			for (String key : map.keySet()){
+				DesignerPattern pattern = new DesignerPattern();
+				pattern.setElementType(elementType);
+				pattern.setProperty(key);
+				pattern.setPropertyValue(map.get(key));
+				this.patternList.add(pattern);
+			}
+		}
+	}
+
+	public void addPatternList(String elementType, String elementId, String elementName, Map<String, String> map) {
+		if(map!=null && !map.isEmpty()){
+			for (String key : map.keySet()){
+				DesignerPattern pattern = new DesignerPattern();
+				pattern.setElementType(elementType);
+				pattern.setElementId(elementId);
+				pattern.setElementName(elementName);
+				pattern.setProperty(key);
+				pattern.setPropertyValue(map.get(key));
+				this.patternList.add(pattern);
+			}
+		}
 	}
 
 	public void clearPatternValue(){

+ 8 - 1
o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/PropertyTools.java

@@ -1,10 +1,12 @@
 package com.x.base.core.project.tools;
 
 import java.lang.reflect.Field;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import com.x.base.core.project.gson.XGsonBuilder;
 import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.reflect.FieldUtils;
@@ -42,7 +44,12 @@ public class PropertyTools {
 			for (String name : properties) {
 				Object o = PropertyUtils.getProperty(t, name);
 				if (o!=null) {
-					String content = String.valueOf(o);
+					String content = "";
+					if (o instanceof Collection<?> || o instanceof Map<?, ?>){
+						content = XGsonBuilder.toJson(o);
+					} else {
+						content = String.valueOf(o);
+					}
 					if (StringTools.matchKeyword(keyword, content, caseSensitive, matchWholeWord, matchRegExp)) {
 						map.put(name, content);
 					}

+ 15 - 1
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/element/factory/ProcessFactory.java

@@ -7,6 +7,7 @@ import java.util.stream.Collectors;
 import javax.persistence.EntityManager;
 import javax.persistence.criteria.*;
 
+import com.x.base.core.project.tools.ListTools;
 import com.x.processplatform.assemble.designer.AbstractFactory;
 import com.x.processplatform.assemble.designer.Business;
 import com.x.processplatform.core.entity.element.Application;
@@ -31,6 +32,19 @@ public class ProcessFactory extends AbstractFactory {
 		return em.createQuery(cq).getResultList();
 	}
 
+	public List<String> listWithApplications(List<String> applications) throws Exception {
+		EntityManager em = this.entityManagerContainer().get(Process.class);
+		CriteriaBuilder cb = em.getCriteriaBuilder();
+		CriteriaQuery<String> cq = cb.createQuery(String.class);
+		Root<Process> root = cq.from(Process.class);
+		Predicate p = cb.conjunction();
+		if(ListTools.isNotEmpty(applications)) {
+			p = cb.isMember(root.get(Process_.application), cb.literal(applications));
+		}
+		cq.select(root.get(Process_.id)).where(p);
+		return em.createQuery(cq).getResultList();
+	}
+
 	public List<Process> listWithApplicationObject(String application) throws Exception {
 		EntityManager em = this.entityManagerContainer().get(Process.class);
 		CriteriaBuilder cb = em.getCriteriaBuilder();
@@ -123,4 +137,4 @@ public class ProcessFactory extends AbstractFactory {
 		return 1.0;
 	}
 
-}
+}

+ 378 - 6
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/designer/ActionSearch.java

@@ -8,6 +8,7 @@ import com.x.base.core.entity.enums.DesignerType;
 import com.x.base.core.project.bean.WrapCopier;
 import com.x.base.core.project.bean.WrapCopierFactory;
 import com.x.base.core.project.exception.ExceptionAccessDenied;
+import com.x.base.core.project.gson.XGsonBuilder;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.jaxrs.WiDesigner;
@@ -16,22 +17,22 @@ 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.base.core.project.tools.PropertyTools;
+import com.x.base.core.project.tools.StringTools;
 import com.x.processplatform.assemble.designer.Business;
-import com.x.processplatform.core.entity.element.Application;
-import com.x.processplatform.core.entity.element.Form;
-import com.x.processplatform.core.entity.element.Script;
-import com.x.processplatform.core.entity.element.wrap.WrapProcess;
+import com.x.processplatform.core.entity.element.*;
+import com.x.processplatform.core.entity.element.Process;
+import com.x.processplatform.core.entity.element.wrap.*;
 import org.apache.commons.lang3.StringUtils;
 
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.TimeUnit;
+import java.util.concurrent.*;
 
 class ActionSearch extends BaseAction {
 
 	private static Logger logger = LoggerFactory.getLogger(ActionSearch.class);
+	private final static String DESIGN_PROCESS_ACTIVITY = "activity";
 
 	ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {
 		if(!effectivePerson.isManager()){
@@ -52,6 +53,9 @@ class ActionSearch extends BaseAction {
 		if (wi.getDesignerTypes().isEmpty() || wi.getDesignerTypes().contains(DesignerType.script.toString())){
 			list.add(searchScript(wi, wi.getAppIdList()));
 		}
+		if (wi.getDesignerTypes().isEmpty() || wi.getDesignerTypes().contains(DesignerType.process.toString())){
+			resWos.addAll(searchProcess(wi, wi.getAppIdList()));
+		}
 		for (CompletableFuture<List<Wo>> cf : list){
 			if(resWos.size()<50) {
 				resWos.addAll(cf.get(60, TimeUnit.SECONDS));
@@ -139,6 +143,374 @@ class ActionSearch extends BaseAction {
 		return cf;
 	}
 
+	private List<Wo> searchProcess(final Wi wi, final List<String> appIdList) {
+
+		List<List<String>> batchList = new ArrayList<>();
+		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+			Business business = new Business(emc);
+			List<String> processIds = business.process().listWithApplications(appIdList);
+			batchList = ListTools.batch(processIds, 20);
+		}catch (Exception e){
+			logger.error(e);
+		}
+		Executor executor = Executors.newFixedThreadPool(batchList.size());
+		List<CompletableFuture<List<Wo>>> cfList = new ArrayList<>();
+		for (List<String> partProcessIds : batchList) {
+			CompletableFuture<List<Wo>> cf = CompletableFuture.supplyAsync(() -> {
+				List<Wo> resWos = new ArrayList<>();
+				try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
+					Business business = new Business(emc);
+					List<Process> processList = emc.list(Process.class, partProcessIds);
+					for (Process process : processList) {
+						try {
+							Wo wo = doProcessSearch(business, process, wi);
+							if (wo!=null){
+								resWos.add(wo);
+							}
+						} catch (Exception e) {
+							logger.error(e);
+						}
+					}
+					processList.clear();
+				}catch (Exception e){
+					logger.error(e);
+				}
+				return resWos;
+			}, executor);
+			cfList.add(cf);
+		}
+		List<Wo> woList = new ArrayList<>();
+		for (CompletableFuture<List<Wo>> cf : cfList){
+			try {
+				woList.addAll(cf.get(30, TimeUnit.SECONDS));
+			} catch (Exception e){
+				logger.error(e);
+			}
+		}
+		return woList;
+	}
+
+
+	private Wo doProcessSearch(Business business, Process process, Wi wi) throws Exception {
+		Wo wo = null;
+		WrapProcess wrap = WrapProcess.outCopier.copy(process);
+		wrap.setAgentList(WrapAgent.outCopier.copy(business.entityManagerContainer().list(Agent.class,
+				business.agent().listWithProcess(process.getId()))));
+		wrap.setBegin(WrapBegin.outCopier.copy(
+				business.entityManagerContainer().find(business.begin().getWithProcess(process.getId()), Begin.class)));
+		wrap.setCancelList(WrapCancel.outCopier.copy(business.entityManagerContainer().list(Cancel.class,
+				business.cancel().listWithProcess(process.getId()))));
+		wrap.setChoiceList(WrapChoice.outCopier.copy(business.entityManagerContainer().list(Choice.class,
+				business.choice().listWithProcess(process.getId()))));
+		wrap.setDelayList(WrapDelay.outCopier.copy(business.entityManagerContainer().list(Delay.class,
+				business.delay().listWithProcess(process.getId()))));
+		wrap.setEmbedList(WrapEmbed.outCopier.copy(business.entityManagerContainer().list(Embed.class,
+				business.embed().listWithProcess(process.getId()))));
+		wrap.setEndList(WrapEnd.outCopier.copy(
+				business.entityManagerContainer().list(End.class, business.end().listWithProcess(process.getId()))));
+		wrap.setInvokeList(WrapInvoke.outCopier.copy(business.entityManagerContainer().list(Invoke.class,
+				business.invoke().listWithProcess(process.getId()))));
+		wrap.setManualList(WrapManual.outCopier.copy(business.entityManagerContainer().list(Manual.class,
+				business.manual().listWithProcess(process.getId()))));
+		wrap.setMergeList(WrapMerge.outCopier.copy(business.entityManagerContainer().list(Merge.class,
+				business.merge().listWithProcess(process.getId()))));
+		wrap.setMessageList(WrapMessage.outCopier.copy(business.entityManagerContainer().list(Message.class,
+				business.message().listWithProcess(process.getId()))));
+		wrap.setParallelList(WrapParallel.outCopier.copy(business.entityManagerContainer().list(Parallel.class,
+				business.parallel().listWithProcess(process.getId()))));
+		wrap.setServiceList(WrapService.outCopier.copy(business.entityManagerContainer().list(Service.class,
+				business.service().listWithProcess(process.getId()))));
+		wrap.setSplitList(WrapSplit.outCopier.copy(business.entityManagerContainer().list(Split.class,
+				business.split().listWithProcess(process.getId()))));
+		wrap.setRouteList(WrapRoute.outCopier.copy(business.entityManagerContainer().list(Route.class,
+				business.route().listWithProcess(process.getId()))));
+
+		if(!StringTools.matchKeyword(wi.getKeyword(), XGsonBuilder.toJson(wrap), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())) {
+			wrap.getManualList().clear();
+			return null;
+		}
+
+		Map<String, String> pmap = PropertyTools.fieldMatchKeyword(WrapProcess.outCopier.getCopyFields(), process, wi.getKeyword(),
+				wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+		if (!pmap.isEmpty()) {
+			if(wo == null){
+				wo = this.getProcessWo(business, process);
+			}
+			wo.addPatternList(DesignerType.process.toString(), pmap);
+		}
+
+		if(!wrap.getAgentList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(wrap.getAgentList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+			if(wo == null){
+				wo = this.getProcessWo(business, process);
+			}
+			for (WrapAgent active : wrap.getAgentList()){
+				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapAgent.outCopier.getCopyFields(), active, wi.getKeyword(),
+						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+				if (!map.isEmpty()) {
+					if(wo == null){
+						wo = this.getProcessWo(business, process);
+					}
+					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+				}
+			}
+		}
+
+		if(wrap.getBegin() != null && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(wrap.getBegin()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+			if(wo == null){
+				wo = this.getProcessWo(business, process);
+			}
+			WrapBegin active = wrap.getBegin();
+			Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapBegin.outCopier.getCopyFields(), active, wi.getKeyword(),
+					wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+			if (!map.isEmpty()) {
+				if(wo == null){
+					wo = this.getProcessWo(business, process);
+				}
+				wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+			}
+		}
+
+		if(!wrap.getCancelList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(wrap.getCancelList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+			if(wo == null){
+				wo = this.getProcessWo(business, process);
+			}
+			for (WrapCancel active : wrap.getCancelList()){
+				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapCancel.outCopier.getCopyFields(), active, wi.getKeyword(),
+						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+				if (!map.isEmpty()) {
+					if(wo == null){
+						wo = this.getProcessWo(business, process);
+					}
+					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+				}
+			}
+		}
+
+		if(!wrap.getChoiceList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(wrap.getChoiceList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+			if(wo == null){
+				wo = this.getProcessWo(business, process);
+			}
+			for (WrapChoice active : wrap.getChoiceList()){
+				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapChoice.outCopier.getCopyFields(), active, wi.getKeyword(),
+						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+				if (!map.isEmpty()) {
+					if(wo == null){
+						wo = this.getProcessWo(business, process);
+					}
+					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+				}
+			}
+		}
+
+		if(!wrap.getDelayList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(wrap.getDelayList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+			if(wo == null){
+				wo = this.getProcessWo(business, process);
+			}
+			for (WrapDelay active : wrap.getDelayList()){
+				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapDelay.outCopier.getCopyFields(), active, wi.getKeyword(),
+						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+				if (!map.isEmpty()) {
+					if(wo == null){
+						wo = this.getProcessWo(business, process);
+					}
+					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+				}
+			}
+		}
+
+		if(!wrap.getEmbedList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(wrap.getEmbedList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+			if(wo == null){
+				wo = this.getProcessWo(business, process);
+			}
+			for (WrapEmbed active : wrap.getEmbedList()){
+				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapEmbed.outCopier.getCopyFields(), active, wi.getKeyword(),
+						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+				if (!map.isEmpty()) {
+					if(wo == null){
+						wo = this.getProcessWo(business, process);
+					}
+					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+				}
+			}
+		}
+
+		if(!wrap.getEndList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(wrap.getEndList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+			if(wo == null){
+				wo = this.getProcessWo(business, process);
+			}
+			for (WrapEnd active : wrap.getEndList()){
+				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapEnd.outCopier.getCopyFields(), active, wi.getKeyword(),
+						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+				if (!map.isEmpty()) {
+					if(wo == null){
+						wo = this.getProcessWo(business, process);
+					}
+					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+				}
+			}
+		}
+
+		if(!wrap.getInvokeList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(wrap.getInvokeList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+			if(wo == null){
+				wo = this.getProcessWo(business, process);
+			}
+			for (WrapInvoke active : wrap.getInvokeList()){
+				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapInvoke.outCopier.getCopyFields(), active, wi.getKeyword(),
+						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+				if (!map.isEmpty()) {
+					if(wo == null){
+						wo = this.getProcessWo(business, process);
+					}
+					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+				}
+			}
+		}
+
+		if(!wrap.getManualList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(wrap.getManualList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+			if(wo == null){
+				wo = this.getProcessWo(business, process);
+			}
+			for (WrapManual active : wrap.getManualList()){
+				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapManual.outCopier.getCopyFields(), active, wi.getKeyword(),
+						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+				if (!map.isEmpty()) {
+					if(wo == null){
+						wo = this.getProcessWo(business, process);
+					}
+					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+				}
+			}
+		}
+
+		if(!wrap.getMergeList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(wrap.getMergeList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+			if(wo == null){
+				wo = this.getProcessWo(business, process);
+			}
+			for (WrapMerge active : wrap.getMergeList()){
+				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapMerge.outCopier.getCopyFields(), active, wi.getKeyword(),
+						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+				if (!map.isEmpty()) {
+					if(wo == null){
+						wo = this.getProcessWo(business, process);
+					}
+					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+				}
+			}
+		}
+
+		if(!wrap.getMessageList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(wrap.getMessageList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+			if(wo == null){
+				wo = this.getProcessWo(business, process);
+			}
+			for (WrapMessage active : wrap.getMessageList()){
+				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapMessage.outCopier.getCopyFields(), active, wi.getKeyword(),
+						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+				if (!map.isEmpty()) {
+					if(wo == null){
+						wo = this.getProcessWo(business, process);
+					}
+					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+				}
+			}
+		}
+
+		if(!wrap.getParallelList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(wrap.getParallelList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+			if(wo == null){
+				wo = this.getProcessWo(business, process);
+			}
+			for (WrapParallel active : wrap.getParallelList()){
+				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapParallel.outCopier.getCopyFields(), active, wi.getKeyword(),
+						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+				if (!map.isEmpty()) {
+					if(wo == null){
+						wo = this.getProcessWo(business, process);
+					}
+					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+				}
+			}
+		}
+
+		if(!wrap.getServiceList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(wrap.getServiceList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+			if(wo == null){
+				wo = this.getProcessWo(business, process);
+			}
+			for (WrapService active : wrap.getServiceList()){
+				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapService.outCopier.getCopyFields(), active, wi.getKeyword(),
+						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+				if (!map.isEmpty()) {
+					if(wo == null){
+						wo = this.getProcessWo(business, process);
+					}
+					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+				}
+			}
+		}
+
+		if(!wrap.getSplitList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(wrap.getSplitList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+			if(wo == null){
+				wo = this.getProcessWo(business, process);
+			}
+			for (WrapSplit active : wrap.getSplitList()){
+				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapSplit.outCopier.getCopyFields(), active, wi.getKeyword(),
+						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+				if (!map.isEmpty()) {
+					if(wo == null){
+						wo = this.getProcessWo(business, process);
+					}
+					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+				}
+			}
+		}
+
+		if(!wrap.getRouteList().isEmpty() && StringTools.matchKeyword(wi.getKeyword(),
+				XGsonBuilder.toJson(wrap.getRouteList()), wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp())){
+			if(wo == null){
+				wo = this.getProcessWo(business, process);
+			}
+			for (WrapRoute active : wrap.getRouteList()){
+				Map<String, String> map = PropertyTools.fieldMatchKeyword(WrapRoute.outCopier.getCopyFields(), active, wi.getKeyword(),
+						wi.getCaseSensitive(), wi.getMatchWholeWord(), wi.getMatchRegExp());
+				if (!map.isEmpty()) {
+					if(wo == null){
+						wo = this.getProcessWo(business, process);
+					}
+					wo.addPatternList(DESIGN_PROCESS_ACTIVITY, active.getId(), active.getName(), map);
+				}
+			}
+		}
+
+		wrap.getManualList().clear();
+		return wo;
+	}
+
+	private Wo getProcessWo(Business business, Process process) throws Exception {
+		Wo wo = new Wo();
+		Application app = business.entityManagerContainer().find(process.getApplication(), Application.class);
+		if (app != null) {
+			wo.setAppId(app.getId());
+			wo.setAppName(app.getName());
+		}
+		wo.setDesignerId(process.getId());
+		wo.setDesignerName(process.getName());
+		wo.setDesignerType(DesignerType.process.toString());
+		wo.setUpdateTime(process.getUpdateTime());
+		return wo;
+	}
+
 
 
 	public static class Wi extends WiDesigner {