Aris流程数据迁移日志记录处理
This commit is contained in:
parent
d4935a629a
commit
7d9d5ed35d
Binary file not shown.
@ -0,0 +1,16 @@
|
|||||||
|
package com.actionsoft.apps.coe.pal.datamigration.aris.constant;
|
||||||
|
|
||||||
|
public class ArisConstant {
|
||||||
|
|
||||||
|
public final static String REPOSITORY_NAME = "arisXML";// aris xml文件导入dc根目录
|
||||||
|
|
||||||
|
public final static String UPFILE = "upfile";// aris xml文件上传根目录,在REPOSITORY_NAME之下
|
||||||
|
|
||||||
|
public final static String LOG_GROUP_VALUE = "log";// aris xml文件导入日志根目录,在REPOSITORY_NAME之下
|
||||||
|
|
||||||
|
public final static String IMPORT_LOG_FILE_SIMPLE = "simpleImport.log";// 简要日志,展示给前端,体现大致的导入内容和进度
|
||||||
|
public final static String IMPORT_LOG_FILE_FULL = "fullImport.log";// 详细日志,包括全量信息内容
|
||||||
|
public final static String IMPORT_LOG_FILE_WARN = "warnErrImport.log";// 错误&警告日志,单独记录错误&警告日志,同时详细日志中也有记录
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -24,12 +24,12 @@ public class XMLUtil {
|
|||||||
* @param fromFilePath
|
* @param fromFilePath
|
||||||
* @param toFilePath
|
* @param toFilePath
|
||||||
*/
|
*/
|
||||||
public static void unicode2String(String fromFilePath, String toFilePath) {
|
public static void unicode2String(String fromFilePath, String toFilePath) throws DocumentException, FileNotFoundException{
|
||||||
Document d = XMLUtil.readXML(fromFilePath, true);
|
Document d = XMLUtil.readXML(fromFilePath, true);
|
||||||
XMLUtil.writeXml(d, toFilePath);
|
XMLUtil.writeXml(d, toFilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Document readXML(String filePath, boolean ignoreDtd) {
|
public static Document readXML(String filePath, boolean ignoreDtd) throws DocumentException, FileNotFoundException {
|
||||||
if (filePath == null) {
|
if (filePath == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -60,16 +60,12 @@ public class XMLUtil {
|
|||||||
|
|
||||||
return document;
|
return document;
|
||||||
} catch (DocumentException e) {
|
} catch (DocumentException e) {
|
||||||
File fil = new File(filePath);
|
e.printStackTrace();
|
||||||
try {
|
throw e;
|
||||||
document = reader.read(fil);
|
|
||||||
} catch (Exception e1) {
|
|
||||||
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Document readXMLFromInputStream(InputStream in) {
|
public static Document readXMLFromInputStream(InputStream in) {
|
||||||
|
|||||||
@ -2,12 +2,15 @@ package com.actionsoft.apps.coe.pal.datamigration.aris.web;
|
|||||||
|
|
||||||
import com.actionsoft.apps.coe.pal.datamigration.aris.mapping.ModelMappingAPIManager;
|
import com.actionsoft.apps.coe.pal.datamigration.aris.mapping.ModelMappingAPIManager;
|
||||||
import com.actionsoft.apps.coe.pal.datamigration.aris.model.*;
|
import com.actionsoft.apps.coe.pal.datamigration.aris.model.*;
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.constant.Constant;
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.util.LogUtil;
|
||||||
import com.actionsoft.bpms.util.UtilString;
|
import com.actionsoft.bpms.util.UtilString;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.dom4j.Document;
|
import org.dom4j.Document;
|
||||||
import org.dom4j.Element;
|
import org.dom4j.Element;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,22 +32,22 @@ public class ArisXmlHandleWeb {
|
|||||||
|
|
||||||
public Map<String, Set<String>> objDefLinkerMap = new HashMap<>();// 记录所有定义形状的连线map记录
|
public Map<String, Set<String>> objDefLinkerMap = new HashMap<>();// 记录所有定义形状的连线map记录
|
||||||
|
|
||||||
|
|
||||||
// 连线 todo
|
|
||||||
|
|
||||||
// 属性 todo
|
|
||||||
|
|
||||||
// 处理文档
|
// 处理文档
|
||||||
public void handleXmlDoc(Document doc) {
|
public void handleXmlDoc(Document doc) throws Exception{
|
||||||
// 获取根元素节点
|
try {
|
||||||
Element root = doc.getRootElement();
|
// 获取根元素节点
|
||||||
String groupPath = "/";
|
Element root = doc.getRootElement();
|
||||||
getNodes(root, groupPath);
|
String groupPath = "/";
|
||||||
// 整合Model路径
|
getNodes(root, groupPath);
|
||||||
calculateModelPath();
|
// 整合Model路径
|
||||||
// 计算定义形状之间的连线
|
calculateModelPath();
|
||||||
calculateObjDefLinker();
|
// 计算定义形状之间的连线
|
||||||
test();
|
calculateObjDefLinker();
|
||||||
|
// test();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,26 @@
|
|||||||
|
package com.actionsoft.apps.coe.pal.datamigration.cache;
|
||||||
|
|
||||||
|
import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile;
|
||||||
|
import com.actionsoft.bpms.commons.cache.Cache;
|
||||||
|
import com.actionsoft.bpms.commons.cache.CacheManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存储导入数据
|
||||||
|
* @author sunlh
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class DataMigrationCache extends Cache<String, Integer>{
|
||||||
|
|
||||||
|
public DataMigrationCache(CachePluginProfile configuration) {
|
||||||
|
super(configuration);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void load() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DataMigrationCache getCache() {
|
||||||
|
return CacheManager.getCache(DataMigrationCache.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -61,9 +61,31 @@ public class Constant {
|
|||||||
|
|
||||||
|
|
||||||
// 日志常量记录
|
// 日志常量记录
|
||||||
public static final String LOG_SUCCESS = "成功";
|
public static final String LOG_SUCCESS = "【成功】";
|
||||||
public static final String LOG_WARNING = "警告";
|
public static final String LOG_WARNING = "【警告】";
|
||||||
public static final String LOG_ERROR = "错误";
|
public static final String LOG_ERROR = "【错误】";
|
||||||
|
|
||||||
|
// 日志表resultType字段常量codeß
|
||||||
|
public static final int LOG_RESULT_TYPE_RUN = 0;// 进行中
|
||||||
|
public static final int LOG_RESULT_TYPE_SUCCESS = 1;// 完成
|
||||||
|
public static final int LOG_RESULT_TYPE_ERROR = 2;// 失败
|
||||||
|
|
||||||
|
public static final String IMPORT_STOP_MSG = "导入停止";
|
||||||
|
|
||||||
|
public static final String PROCESS_EPC = "process.epc";
|
||||||
|
|
||||||
|
public static final String ORG_ROLE = "org.role";
|
||||||
|
|
||||||
|
public static final String ITSYSTEM_NORMAIL = "itsystem.normal";
|
||||||
|
|
||||||
|
public static final String METHOD_APPROVAL_NODE = "method_approval_node";// 线上审批
|
||||||
|
|
||||||
|
public static final String METHOD_SERVICE_NODE = "method_service_node";// 线下审批
|
||||||
|
|
||||||
|
public static final String METHOD_APPROVAL_NODE3 = "method_approval_node3";// 系统任务
|
||||||
|
public static final String METHOD_SERVICE_NODE4 = "method_service_node4";// 人工任务
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.actionsoft.apps.coe.pal.datamigration.plugin;
|
package com.actionsoft.apps.coe.pal.datamigration.plugin;
|
||||||
|
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.aris.constant.ArisConstant;
|
||||||
|
import com.actionsoft.apps.coe.pal.datamigration.cache.DataMigrationCache;
|
||||||
import com.actionsoft.apps.coe.pal.datamigration.web.DataMigrationWeb;
|
import com.actionsoft.apps.coe.pal.datamigration.web.DataMigrationWeb;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.upfile.CoeFileProcessor;
|
import com.actionsoft.apps.coe.pal.pal.repository.upfile.CoeFileProcessor;
|
||||||
import com.actionsoft.apps.listener.PluginListener;
|
import com.actionsoft.apps.listener.PluginListener;
|
||||||
@ -21,8 +23,11 @@ public class Plugins implements PluginListener {
|
|||||||
public List<AWSPluginProfile> register(AppContext context) {
|
public List<AWSPluginProfile> register(AppContext context) {
|
||||||
List<AWSPluginProfile> list = new ArrayList<AWSPluginProfile>();
|
List<AWSPluginProfile> list = new ArrayList<AWSPluginProfile>();
|
||||||
|
|
||||||
|
// 注册缓存
|
||||||
|
list.add(new CachePluginProfile(DataMigrationCache.class));
|
||||||
|
|
||||||
list.add(new DCPluginProfile("migration", CoeFileProcessor.class.getName(), "存放数据迁移文件", false, false));
|
list.add(new DCPluginProfile("migration", CoeFileProcessor.class.getName(), "存放数据迁移文件", false, false));
|
||||||
|
list.add(new DCPluginProfile(ArisConstant.REPOSITORY_NAME, CoeFileProcessor.class.getName(), "存在arisXML数据迁移日志", false, false));
|
||||||
|
|
||||||
// PAL应用扩展点
|
// PAL应用扩展点
|
||||||
Map<String, Object> params0 = new HashMap<String, Object>();
|
Map<String, Object> params0 = new HashMap<String, Object>();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user