泛微E8配置自定义触发流程失败
在新公司接了个配置泛微流程触发的活。因为泛微的官方文档并没有详细的操作指引,在测试环境配置之后、要触发的流程可以手工提交,但是触发一直不成功。简单记录下业务场景和其他处理信息,以供参考。
应用版本
目前使用了泛微 E8 (8.100.0531)的版本。2018年上线的老系统了。

业务场景
目前使用的泛微 OA 启用了“会议”应用。我们需要定时抓取会议状态为“退回”和“取消”的会议、并将每一条记录自动转化为一个流程发送出去。我们选取了会议应用的 Meeting 表(会议管理表详细信息),并选择 “meetingstatus” 字段作为会议状态的来源。通过文档得知:当会议状态为“退回”,字段取值 3 ;当会议状态为“取消”,字段取值 4 。

设置的自定义表单 / 流程如下图所示, 目前手工提交 / 流转均正常操作:

处理步骤
首先配置了回写部分,但是不成功。根据 2012 - 2016 年的资料,文档是这么记录的。
1:该流程自动触发时,将根据外部主表条件搜索外部主表,有多少条记录即触发多少条流程;
流程主字段的值来源于外部主表,而每条流程的各明细值将分别根据明细表条件搜索明细表
得到的结果进行赋值;主表中必须包含主键(默认为id)
2:条件以“where”开头,如:“where fieldname1=1 and fieldname2='value2'”;
回写设置以“set”开头,如:“set flag=1,isok=true”,FtriggerFlag和requestid字段
自动更新,不能在此设置;
3:流程触发时如果需要回写外部主表,需要设置是否回写、流程ID字段、标志字段、标志字段
需要回写的值(字符型),回写数据时,默认标志字段=1:表示已触发,
流程ID字段=0:表示流程创建人对应的外部字段值为空,
流程ID字段=-1:表示外部字段保存的人员信息在oa中不存在,流程ID
4:外部明细表数据如需与主表数据关联,可将外部明细表条件设置为
“where '明细表.字段'='主表.字段'”。
非常 ... 语焉不详。我怀疑当年这个屌茅甚至喝大了。:)
配置数次无果之后,泛微的工程师提醒我找下日志。根据操作日期,我分别在服务器下载了泛微应用目录下的 ecology/log/integration/integration.log 、 ecology/log/ecology 、Resin/log/stderr.log 、Resin/log/stdout.log 这几个文件。
打开 integration.log 文件。发现触发的过程报错、 提示 CREATER 在外部表不存在。
2023-08-18 00:00:14,812 INFO [Thread:AutoWorlflowThread] weaver.general.AutoWorlflowThread.saveTrigLog() - saveTrigLog 记录日志 sql : update outerdatawfdetail set requestid=-1 where mainid=11 and workflowid=466 and outermaintable = 'Meeting' and keyfieldvalue='141'
2023-08-18 00:00:14,827 INFO [Thread:AutoWorlflowThread] weaver.general.AutoWorlflowThread.doActiveOutDataWF() - 检查是否已触发 : select 1 from outerdatawfdetail where workflowid=466 and mainid=11 and keyfieldvalue='142' and outermaintable = 'Meeting' and requestid>0
2023-08-18 00:00:14,827 INFO [Thread:AutoWorlflowThread] weaver.general.AutoWorlflowThread.doActiveOutDataWF() - ===================SQL:select * from outerdatawfsetdetail where (wffieldid=-1 or wffieldid=-2) and mainid=11 order by wffieldid
2023-08-18 00:00:14,827 ERROR [Thread:AutoWorlflowThread] weaver.general.AutoWorlflowThread.doActiveOutDataWF() - THE CREATER IN THE OUTER TABLE IS NOT EXIST!
于是找到应用的源代码。
package weaver.general;import java.io.Writer;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import oracle.sql.CLOB;
import weaver.conn.ConnStatement;
import weaver.conn.RecordSet;
import weaver.conn.RecordSetDataSource;
import weaver.hrm.resource.ResourceComInfo;
import weaver.integration.logging.Logger;
import weaver.integration.logging.LoggerFactory;
import weaver.system.SysCreateWF;
import weaver.system.SysUpdateWF;
import weaver.system.ThreadWork;
import weaver.workflow.automatic.automaticconnect;
import weaver.workflow.dmlaction.DBTypeUtil;
import weaver.workflow.request.RequestManager;
import weaver.workflow.workflow.WorkflowComInfo;
import weaver.workflow.workflow.WorkflowVersion;public class AutoWorlflowThread extends BaseBean implements ThreadWork {private Logger newlog = LoggerFactory.getLogger(AutoWorlflowThread.class);public void doThreadWork() {Thread.currentThread().setUncaughtExceptionHandler(new AutoWorkFlowThreadExceptionHandler());doActiveOutDataWF();}public void doActiveOutDataWF() {automaticconnect automaticconnect = new automaticconnect();Connection connection = null;String str = "";try {WorkflowComInfo workflowComInfo = new WorkflowComInfo();ResourceComInfo resourceComInfo = new ResourceComInfo();SysCreateWF sysCreateWF = new SysCreateWF();RecordSet recordSet1 = new RecordSet();RecordSet recordSet2 = new RecordSet();ArrayList<String> arrayList1 = new ArrayList();ArrayList<String> arrayList2 = new ArrayList();ArrayList<String> arrayList3 = new ArrayList();ArrayList<String> arrayList4 = new ArrayList();ArrayList<String> arrayList5 = new ArrayList();ArrayList<String> arrayList6 = new ArrayList();ArrayList<String> arrayList7 = new ArrayList();ArrayList<String> arrayList8 = new ArrayList();ArrayList<String> arrayList9 = new ArrayList();ArrayList<String> arrayList10 = new ArrayList();ArrayList<String> arrayList11 = new ArrayList();ArrayList<String> arrayList12 = new ArrayList();ArrayList<String> arrayList13 = new ArrayList();ArrayList<String> arrayList14 = new ArrayList();ArrayList<String> arrayList15 = new ArrayList();ArrayList<String> arrayList16 = new ArrayList();ArrayList<String> arrayList17 = new ArrayList();WorkflowVersion workflowVersion = new WorkflowVersion();recordSet1.executeSql("select * from outerdatawfset");while (recordSet1.next()) {String str1 = Util.null2String(recordSet1.getString("id"));String str2 = Util.null2String(recordSet1.getString("workflowid"));String str3 = Util.null2String(recordSet1.getString("datasourceid"));String str4 = Util.null2String(recordSet1.getString("outermaintable"));String str5 = Util.null2String(recordSet1.getString("keyfield"));String str6 = Util.null2String(recordSet1.getString("datarecordtype"));String str7 = Util.null2String(recordSet1.getString("requestid"));String str8 = Util.null2String(recordSet1.getString("FTriggerFlag"));String str9 = Util.null2String(recordSet1.getString("FTriggerFlagValue"));String str10 = Util.null2String(recordSet1.getString("outermainwhere"));String str11 = Util.null2String(recordSet1.getString("successback"));String str12 = Util.null2String(recordSet1.getString("failback"));String str13 = Util.null2String(recordSet1.getString("outerdetailtables"));String str14 = Util.null2String(recordSet1.getString("outerdetailwheres"));String str15 = Util.null2String(recordSet1.getString("isnextnode"));String str16 = Util.null2String(recordSet1.getString("isupdatewfdata"));String str17 = Util.null2String(recordSet1.getString("isupdatewfdataField"));arrayList1.add(str1);arrayList2.add(str2);arrayList3.add(str3);arrayList4.add(str4);arrayList15.add(str15);arrayList16.add(str16);arrayList17.add(str17);arrayList5.add(str5);arrayList6.add(str6);arrayList7.add(str7);arrayList8.add(str8);arrayList9.add(str9);arrayList10.add(str10);arrayList11.add(str11);arrayList12.add(str12);arrayList13.add(str13);arrayList14.add(str14);} RecordSet recordSet3 = new RecordSet();for (byte b = 0; b < arrayList1.size(); b++) {try {String str1 = arrayList1.get(b);recordSet3.executeSql("select mainid from outerdatawfsetdetail where mainid=" + str1);if (!recordSet3.next()) {this.newlog.error("+ str1 + ");} else {String str2 = arrayList2.get(b);String str3 = WorkflowVersion.getActiveVersionWFID(str2);String str4 = arrayList3.get(b);if (!str4.equals("")) {connection = automaticconnect.getConnection("datasource." + str4);if (connection != null && !connection.isClosed()) {str = automaticconnect.getDBType();Statement statement1 = connection.createStatement();Statement statement2 = connection.createStatement();ResultSet resultSet = null;String str5 = arrayList4.get(b);String str6 = arrayList5.get(b);String str7 = arrayList6.get(b);String str8 = arrayList7.get(b);String str9 = arrayList8.get(b);String str10 = arrayList9.get(b);String str11 = arrayList15.get(b);String str12 = arrayList16.get(b);String str13 = arrayList17.get(b);if ("".equals(str10))str10 = "1"; String str14 = arrayList10.get(b);String str15 = arrayList11.get(b);String str16 = arrayList12.get(b);String str17 = arrayList13.get(b);String str18 = arrayList14.get(b);RecordSetDataSource recordSetDataSource = new RecordSetDataSource();Map map = new HashMap<Object, Object>();if (!str4.equals(""))map = recordSetDataSource.getAllColumnWithTypes(str4, str5); String str19 = "";if (str.toLowerCase().indexOf("oracle") > -1) {str19 = "select 1 from user_tables a where a.TABLE_NAME = upper('" + str5 + "') union ALL select 1 from user_views b where b.VIEW_NAME = upper('" + str5 + "')";} else if (str.toLowerCase().indexOf("sqlserver") > -1 || str.toLowerCase().indexOf("sybase") > -1) {str19 = "select 1 from sysobjects where name = '" + str5 + "' ";} else if (str.toLowerCase().indexOf("informix") > -1) {str19 = "select 1 from systables where lower(tabname) = lower('" + str5 + "') ";} else if (str.toLowerCase().indexOf("mysql") > -1) {str19 = "select 1 from information_schema.Tables where LOWER(Table_Name)=LOWER('" + str5 + "') ";} else if (str.toLowerCase().indexOf("db2") > -1) {str19 = "select 1 from SYSIBM.SYSTABLES where lower(name)= lower('" + str5 + "') ";} else {str19 = "select 1 from " + str5;} resultSet = statement1.executeQuery(str19);if (!resultSet.next()) {this.newlog.error("TABLE " + str5 + " IS NOT EXIST!");} else {ArrayList<String> arrayList = new ArrayList();Hashtable<Object, Object> hashtable1 = new Hashtable<Object, Object>();Hashtable<Object, Object> hashtable2 = new Hashtable<Object, Object>();Hashtable<Object, Object> hashtable3 = new Hashtable<Object, Object>();Hashtable<Object, Object> hashtable4 = new Hashtable<Object, Object>();Hashtable<Object, Object> hashtable5 = new Hashtable<Object, Object>();Hashtable<Object, Object> hashtable6 = new Hashtable<Object, Object>();Hashtable<Object, Object> hashtable7 = new Hashtable<Object, Object>();String str20 = "";int i = Util.getIntValue(Util.null2String(workflowComInfo.getIsBill(str2)), -1);String str21 = Util.null2String(workflowComInfo.getFormId(str2));if (i == 0) {str20 = "select workflow_formfield.fieldid as id,fieldname as name,workflow_fieldlable.fieldlable as label,workflow_formdict.fieldhtmltype as htmltype,workflow_formdict.type as type,workflow_formdict.fielddbtype from workflow_formfield,workflow_formdict,workflow_fieldlable where workflow_fieldlable.formid = workflow_formfield.formid and workflow_fieldlable.isdefault = 1 and workflow_fieldlable.fieldid =workflow_formfield.fieldid and workflow_formdict.id = workflow_formfield.fieldid and workflow_formfield.formid=" + str21;} else if (i == 1) {str20 = "select id as id,fieldname as name,fieldlabel as label,fieldhtmltype as htmltype,type as type,fielddbtype from workflow_billfield where viewtype=0 and billid = " + str21 + " order by dsporder ";} recordSet1.executeSql(str20);while (recordSet1.next()) {String str23 = recordSet1.getString("id");String str24 = recordSet1.getString("name");String str25 = recordSet1.getString("htmltype");String str26 = recordSet1.getString("type");String str27 = recordSet1.getString("fielddbtype");String str28 = "";String str29 = "";String str30 = "";recordSet2.executeSql("select outerfieldname,changetype,customsql from outerdatawfsetdetail where wffieldid=" + str23 + " and mainid=" + str1);if (recordSet2.next()) {str28 = recordSet2.getString("outerfieldname");str29 = recordSet2.getString("changetype");str30 = recordSet2.getString("customsql");} arrayList.add(str23);hashtable1.put(str23, str24);hashtable2.put(str23, str25);hashtable3.put(str23, str26);hashtable4.put(str23, str27);hashtable5.put(str23, str28);hashtable6.put(str23, str29);hashtable7.put(str23, str30);} if (str14.equals(""))str14 = " where 1=1 "; if ("2".equals(str7) || "".equals(str7)) {str14 = str14 + " and ((1=1 ";if (str.toLowerCase().indexOf("oracle") > -1) {if (!"".equals(str8))str14 = str14 + " and nvl(" + str8 + ",'0')='0' "; if (!"".equals(str9) && !"".equals(str10))str14 = str14 + " and nvl(" + str9 + ",'0')!='" + str10 + "' "; } else if (str.toLowerCase().indexOf("sqlserver") > -1 || str.toLowerCase().indexOf("sybase") > -1) {if (!"".equals(str8))str14 = str14 + " and isnull(" + str8 + ",'0')='0' "; if (!"".equals(str9) && !"".equals(str10))str14 = str14 + " and isnull(" + str9 + ",'0')!='" + str10 + "' "; } else if (str.toLowerCase().indexOf("informix") > -1) {if (!"".equals(str8))str14 = str14 + " and " + str8 + " is null "; if (!"".equals(str9) && !"".equals(str10))str14 = str14 + " and " + str9 + "!='" + str10 + "' "; } else if (str.toLowerCase().indexOf("mysql") > -1) {if (!"".equals(str8))str14 = str14 + " and IFNULL(" + str8 + ",'0')='0' "; if (!"".equals(str9) && !"".equals(str10))str14 = str14 + " and IFNULL(" + str9 + ",'0')!='" + str10 + "' "; } else if (str.toLowerCase().indexOf("db2") > -1) {if (!"".equals(str8))str14 = str14 + " and coalesce(" + str8 + ",'0')='0' "; if (!"".equals(str9) && !"".equals(str10))str14 = str14 + " and coalesce(" + str9 + ",'0')!='" + str10 + "' "; } else {if (!"".equals(str8))str14 = str14 + " and " + str8 + " is null "; if (!"".equals(str9) && !"".equals(str10))str14 = str14 + " and " + str9 + "!='" + str10 + "' "; } str14 = str14 + " ) ";if (str12.equals("2") && !str13.equals(""))str14 = str14 + " or " + str13 + "='1' "; str14 = str14 + " ) ";} this.newlog.info("select * from " + str5 + " " + str14);ResultSet resultSet1 = statement1.executeQuery("select * from " + str5 + " " + str14);String str22 = "";while (resultSet1.next()) {try {if ("2".equals(str7) || "".equals(str7)) {if (str6.equals(""))str6 = "id"; if (str9.equals(""))str9 = "FTriggerFlag"; if (str8.equals(""))str8 = "requestid"; } String str23 = resultSet1.getString(str6).replace("'", "''");boolean bool1 = false;if (str12.equals("2") && !str13.equals("")) {String str27 = Util.null2String(resultSet1.getString(str13));if (str27.equals("1"))bool1 = true; } if (bool1)this.newlog.info("." + str13 + "=" + Util.null2String(resultSet1.getString(str13))); boolean bool2 = false;str22 = "select 1 from outerdatawfdetail where workflowid=" + str2 + " and mainid=" + str1 + " and keyfieldvalue='" + str23 + "' and outermaintable = '" + str5 + "' and requestid>0";this.newlog.info(": " + str22);recordSet1.executeSql(str22);if (recordSet1.next()) {this.newlog.info("keyid : " + str23 + " );bool2 = true;} if (!bool1 && bool2)continue; String str24 = "";String str25 = "";ArrayList<Integer> arrayList18 = new ArrayList();boolean bool3 = false;recordSet1.executeSql("select * from outerdatawfsetdetail where (wffieldid=-1 or wffieldid=-2) and mainid=" + str1 + " order by wffieldid");this.newlog.info("===================SQL:select * from outerdatawfsetdetail where (wffieldid=-1 or wffieldid=-2) and mainid=" + str1 + " order by wffieldid");while (recordSet1.next()) {String str27 = Util.null2String(recordSet1.getString("wffieldid"));if (str27.equals("-2")) {String str28 = Util.null2String(recordSet1.getString("outerfieldname"));String str29 = Util.null2String(recordSet1.getString("changetype"));String str30 = Util.null2String(recordSet1.getString("customsql"));if (str29.equals("5")) {str25 = Util.null2String(getCreater(str28, "5"));if (str25.equals("")) {this.newlog.error("THE CREATER IN THE OUTER TABLE IS NOT EXIST!");if ("2".equals(str7) || "".equals(str7))saveOutTrigLog(statement2, str5, str16, str6, str9, str8, str23, str10, "-1"); if (str12.equals("2") && !str13.equals(""))saveUpdateWfFlag(statement2, str5, str6, str23, str12, str13); saveTrigLog(str3, "-1", str1, str23, str5);bool3 = true;break;} continue;} if (str29.equals("6")) {if (str28.indexOf(".") > -1)str28 = str28.substring(str28.indexOf(".") + 1); String str32 = Util.null2String(resultSet1.getString(str28));if (!"".equals(str30)) {str30 = str30 + " and status<4 and (loginid !='' Or loginid is not null) ";str25 = getTranSqlValue(str30, str32);} else {str25 = str32;} if (str25.equals("")) {this.newlog.error("THE CREATER IN THE OUTER TABLE IS NOT EXIST!");if ("2".equals(str7) || "".equals(str7))saveOutTrigLog(statement2, str5, str16, str6, str9, str8, str23, str10, "-1"); if (str12.equals("2") && !str13.equals(""))saveUpdateWfFlag(statement2, str5, str6, str23, str12, str13); saveTrigLog(str3, "-1", str1, str23, str5);bool3 = true;break;} continue;} if (str28.equals("")) {this.newlog.error(");str25 = "1";continue;} str28 = str28.substring(str28.indexOf(".") + 1);String str31 = Util.null2String(resultSet1.getString(str28));if (str31.equals("")) {this.newlog.error("VALUE OF THE FIELD IN THE OUTER TABLE IS NULL!");if ("2".equals(str7) || "".equals(str7))saveOutTrigLog(statement2, str5, str16, str6, str9, str8, str23, str10, "0"); if (str12.equals("2") && !str13.equals(""))saveUpdateWfFlag(statement2, str5, str6, str23, str12, str13); saveTrigLog(str3, "0", str1, str23, str5);bool3 = true;break;} str25 = Util.null2String(getCreater(str31, str29));if (str25.equals("")) {this.newlog.error("THE CREATER IN THE OUTER TABLE IS NOT EXIST!");if ("2".equals(str7) || "".equals(str7))saveOutTrigLog(statement2, str5, str16, str6, str9, str8, str23, str10, "-1"); if (str12.equals("2") && !str13.equals(""))saveUpdateWfFlag(statement2, str5, str6, str23, str12, str13); saveTrigLog(str3, "-1", str1, str23, str5);bool3 = true;break;} continue;} if (str27.equals("-1")) {String str28 = Util.null2String(recordSet1.getString("outerfieldname"));String str29 = Util.null2String(workflowComInfo.getWorkflowname(str3));String str30 = Util.toScreen(resourceComInfo.getResourcename(str25), 7);String str31 = "";Calendar calendar = Calendar.getInstance();str31 = Util.add0(calendar.get(1), 4) + "-" + Util.add0(calendar.get(2) + 1, 2) + "-" + Util.add0(calendar.get(5), 2);DateUtil dateUtil = new DateUtil();if (str28.equals("")) {str24 = Util.null2String(dateUtil.getWFTitleNew("" + str3, "" + str25, "" + str30, "1"));if (str24.equals(""))str24 = str29 + "-" + str30 + "-" + str31; continue;} str28 = str28.substring(str28.indexOf(".") + 1);String str32 = Util.null2String(resultSet1.getString(str28));if (!str32.equals("")) {str24 = str32;continue;} str24 = Util.null2String(dateUtil.getWFTitleNew("" + str3, "" + str25, "" + str30, "1"));if (str24.equals(""))str24 = str29 + "-" + str30 + "-" + str31; } } if (bool3)continue; for (byte b1 = 0; b1 < arrayList.size(); b1++) {String str27 = Util.null2String(arrayList.get(b1));String str28 = Util.null2String((String)hashtable1.get(str27));if (!str28.equals("")) {String str29 = Util.null2String((String)hashtable2.get(str27));String str30 = Util.null2String((String)hashtable3.get(str27));String str31 = Util.null2String((String)hashtable4.get(str27));String str32 = Util.null2String((String)hashtable5.get(str27));String str33 = Util.null2String((String)hashtable6.get(str27));String str34 = Util.null2String((String)hashtable7.get(str27));String str35 = "";if (!str32.equals("")) {str32 = str32.substring(str32.indexOf(".") + 1);String str36 = (String)map.get(str32.toLowerCase());if (str36.contains("("))str36 = str36.substring(0, str36.indexOf("(")); if (str36.equals("number") || str36.equals("NUMBER") || str36.equals("float") || str36.equals("Real") || str36.equals("real")) {str35 = Util.null2String(resultSet1.getString(str32));if (str35.startsWith("."))str35 = "0" + str35; if (str35.startsWith("-."))str35 = str35.replaceFirst("-.", "-0."); } else {str35 = Util.null2String(resultSet1.getString(str32));} if (!"6".equals(str33)) {if (str29.equals("3"))if (str30.equals("1")) {str35 = getCreater(str35, str33);} else if (str30.equals("4")) {str35 = getDept(str35, str33);} else if (str30.equals("164")) {str35 = getSubCom(str35, str33);} } else if (!"".equals(str34)) {str35 = getTranSqlValue(str34, str35);} } if (str35.equals("")) {if (str29.equals("4")) {arrayList18.add(Integer.valueOf(0));} else if (!str29.equals("6") && !str29.equals("2") && (!str29.equals("1") || (!str30.equals("1") && !str30.equals("5"))) && (!str29.equals("3") || (!str30.equals("2") && !str30.equals("19") && !str30.equals("161") && !str30.equals("162")))) {arrayList18.add(null);} else {arrayList18.add("");} } else {if (str31.startsWith("text") || str31.startsWith("char") || str31.startsWith("varchar") || str31.indexOf(".") > -1 || str31.startsWith("clob")) {if (str31.startsWith("char") || str31.startsWith("varchar")) {int k = Util.getIntValue(str31.substring(str31.indexOf("(") + 1, str31.indexOf(")")), 0);if (Util.length2(str35) > k)do {str35 = str35.substring(0, str35.length() - 1);} while (Util.length2(str35) > k); } str35 = str35.replace("'", "''");} else if (str31.equals("int") || str31.equals("integer")) {str35 = Util.getIntValue(str35, 0) + "";} else if (str31.indexOf("decimal") == 0 || str31.indexOf("number") == 0) {str35 = str35.replace(",", "");str35 = Util.getDoubleValue(str35, 0.0D) + "";} else if (str31.indexOf("text") == 0) {str35 = str35.replaceAll("'", "''");} arrayList18.add(str35);} } } if (bool1 && bool2) {String str27 = "";str22 = "select requestid from outerdatawfdetail where workflowid=" + str2 + " and mainid=" + str1 + " and keyfieldvalue='" + str23 + "' and outermaintable = '" + str5 + "' and requestid>0";this.newlog.info(": " + str22);RecordSet recordSet = new RecordSet();recordSet.executeSql(str22);if (recordSet.next())str27 = Util.null2String(recordSet.getString("requestid")); if (str27.equals("")) {this.newlog.info(");continue;} SysUpdateWF sysUpdateWF = new SysUpdateWF();if (sysUpdateWF.updateWorkflowInfo(Util.getIntValue(str3, 0), str24, Util.getIntValue(str25, 1), arrayList18, Util.getIntValue(str27, 0))) {String str28 = str15;if ("2".equals(str7) || "".equals(str7))saveOutTrigLog(statement2, str5, str28, str6, str9, str8, str23, str10, "" + str27); if (str12.equals("2") && !str13.equals(""))saveUpdateWfFlag(statement2, str5, str6, str23, str12, str13); saveTrigLog(str3, "" + str27, str1, str23, str5);saveRequestLog(str1, str23, str3, Util.getIntValue(str27, 0));UpdateIntoDetailTable(statement2, str5, str, str1, str2, Util.getIntValue(str27, 0), str6, str23, str17, str18, str8, str7);continue;} if ("2".equals(str7) || "".equals(str7))saveOutTrigLog(statement2, str5, str16, str6, str9, str8, str23, str10, "0"); if (str12.equals("2") && !str13.equals(""))saveUpdateWfFlag(statement2, str5, str6, str23, str12, str13); saveRequestLog(str1, str23, str3, Util.getIntValue(str27, 0));continue;} this.newlog.info("=======+ str24);sysCreateWF = new SysCreateWF();RequestManager requestManager = sysCreateWF.setWorkflowInfo(Util.getIntValue(str3, 0), str24, 0, Util.getIntValue(str25, 1), arrayList18, false, str11);int j = requestManager.getRequestid();String str26 = str15;if (j > 0) {if ("2".equals(str7) || "".equals(str7))saveOutTrigLog(statement2, str5, str26, str6, str9, str8, str23, str10, "" + j); if (str12.equals("2") && !str13.equals(""))saveUpdateWfFlag(statement2, str5, str6, str23, str12, str13); saveTrigLog(str3, "" + j, str1, str23, str5);saveRequestLog(str1, str23, str3, j);this.newlog.info("****insertIntoDetailTable = " + str + "^^^^^^^^^^^^^:requestid = " + j);insertIntoDetailTable(str4, statement2, str5, str, str1, str2, j, str6, str23, str17, str18, str8, str7);this.newlog.info("+ str11 + ",workflowid=" + str2);if (str11.equals("1"))requestManager.flowNextNode(); continue;} if ("2".equals(str7) || "".equals(str7))saveOutTrigLog(statement2, str5, str16, str6, str9, str8, str23, str10, "0"); if (str12.equals("2") && !str13.equals(""))saveUpdateWfFlag(statement2, str5, str6, str23, str12, str13); saveTrigLog(str3, "-2", str1, str23, str5);saveRequestLog(str1, str23, str3, j);} catch (Exception exception) {this.newlog.error(", exception);} } resultSet1.close();resultSet.close();statement1.close();statement2.close();automaticconnect.closeConnection(connection);} } } } } catch (Exception exception) {this.newlog.error(", exception);} } } catch (Exception exception) {this.newlog.error(", exception);} }public String getTranSqlValue(String paramString1, String paramString2) {paramString2 = paramString2.replace("'", "''");paramString1 = DBTypeUtil.replaceString(paramString1, "{?currentvalue}", paramString2);RecordSet recordSet = new RecordSet();recordSet.executeSql(paramString1);if (recordSet.next())return recordSet.getString(1); return "";}public void insertIntoDetailTable(String paramString1, Statement paramStatement, String paramString2, String paramString3, String paramString4, String paramString5, int paramInt, String paramString6, String paramString7, String paramString8, String paramString9, String paramString10, String paramString11) throws Exception {ResultSet resultSet = null;HashMap<Object, Object> hashMap = new HashMap<Object, Object>();WorkflowComInfo workflowComInfo = new WorkflowComInfo();String str1 = Util.null2String(workflowComInfo.getIsBill(paramString5));String str2 = Util.null2String(workflowComInfo.getFormId(paramString5));ArrayList<String> arrayList1 = new ArrayList();ArrayList<String> arrayList2 = new ArrayList();String str3 = "mainid";String str4 = "";ArrayList<String> arrayList3 = Util.TokenizerString(paramString8, ",");String[] arrayOfString = paramString9.split("\\$@\\|@\\$");ArrayList<String> arrayList4 = new ArrayList();for (byte b1 = 0; b1 < arrayOfString.length; b1++)arrayList4.add(arrayOfString[b1]); RecordSet recordSet = new RecordSet();boolean bool = recordSet.getDBType().equals("oracle");RecordSetDataSource recordSetDataSource = new RecordSetDataSource();boolean bool1 = false;if (!str2.equals(""))if (str1.equals("0")) {recordSet.executeSql("select distinct groupId from Workflow_formfield where formid=" + str2 + " and isdetail='1' order by groupid");while (recordSet.next()) {arrayList1.add("workflow_formdetail");arrayList2.add(recordSet.getString(1));} } else if (str1.equals("1")) {recordSet.executeSql("select tablename from Workflow_billdetailtable where billid=" + str2 + " order by orderid");while (recordSet.next()) {String str = Util.null2String(recordSet.getString(1));if (!str.equals(""))arrayList1.add(recordSet.getString(1)); } recordSet.executeSql("select tablename,detailtablename,detailkeyfield from workflow_bill where id=" + str2);if (recordSet.next()) {str3 = Util.null2String(recordSet.getString("detailkeyfield"));if (arrayList1.size() == 0) {String str5 = Util.null2String(recordSet.getString("detailtablename"));if (!str5.equals(""))arrayList1.add(str5); } String str = recordSet.getString("tablename");recordSet.executeSql("select id from " + str + " where requestid=" + paramInt);if (recordSet.next())str4 = recordSet.getString("id"); } } if (arrayList1.size() != arrayList3.size()) {writeLog(");return;} for (byte b2 = 0; b2 < arrayList1.size(); b2++) {String str5 = arrayList1.get(b2);String str6 = arrayList3.get(b2);String str7 = "";if (paramString3.toLowerCase().indexOf("oracle") > -1) {str7 = "select 1 from user_tables a where a.TABLE_NAME = upper('" + str6 + "') union ALL select 1 from user_views b where b.VIEW_NAME = upper('" + str6 + "')";} else if (paramString3.toLowerCase().indexOf("sqlserver") > -1 || paramString3.toLowerCase().indexOf("sybase") > -1) {str7 = "select 1 from sysobjects where name = '" + str6 + "' ";} else if (paramString3.toLowerCase().indexOf("informix") > -1) {str7 = "select 1 from systables where lower(tabname) = lower('" + str6 + "') ";} else if (paramString3.toLowerCase().indexOf("mysql") > -1) {str7 = "select 1 from information_schema.Tables where LOWER(Table_Name)=LOWER('" + str6 + "') ";} else if (paramString3.toLowerCase().indexOf("db2") > -1) {str7 = "select 1 from SYSIBM.SYSTABLES where lower(name)= lower('" + str6 + "') ";} else {str7 = "select 1 from " + str6;} resultSet = paramStatement.executeQuery(str7);if (!resultSet.next()) {this.newlog.error("TABLE " + str6 + " IS NOT EXIST!");} else {Map map = new HashMap<Object, Object>();if (!paramString1.equals(""))map = recordSetDataSource.getAllColumnWithTypes(paramString1, str6); ArrayList<String> arrayList = new ArrayList();Hashtable<Object, Object> hashtable1 = new Hashtable<Object, Object>();Hashtable<Object, Object> hashtable2 = new Hashtable<Object, Object>();Hashtable<Object, Object> hashtable3 = new Hashtable<Object, Object>();Hashtable<Object, Object> hashtable4 = new Hashtable<Object, Object>();Hashtable<Object, Object> hashtable5 = new Hashtable<Object, Object>();Hashtable<Object, Object> hashtable6 = new Hashtable<Object, Object>();Hashtable<Object, Object> hashtable7 = new Hashtable<Object, Object>();String str = Util.null2String(arrayList4.get(b2));if (str.equals("-"))str = ""; recordSet.executeSql("select * from outerdatawfsetdetail where outerfieldname like '" + str6 + ".%' and mainid=" + paramString4);while (recordSet.next()) {String str8 = recordSet.getString("wffieldid");String str9 = recordSet.getString("wffieldname");String str10 = recordSet.getString("wffieldhtmltype");String str11 = recordSet.getString("wffieldtype");String str12 = recordSet.getString("wffielddbtype");String str13 = recordSet.getString("outerfieldname");String str14 = recordSet.getString("changetype");String str15 = recordSet.getString("customsql");arrayList.add(str8);hashtable1.put(str8, str9);hashtable2.put(str8, str10);hashtable3.put(str8, str11);hashtable4.put(str8, str12);hashtable5.put(str8, str13);hashtable6.put(str8, str14);hashtable7.put(str8, str15);} Pattern pattern = Pattern.compile("where");Matcher matcher = pattern.matcher(str);str = matcher.replaceFirst(" and ");if (!paramString11.equals("1") && !paramString10.equals("")) {str7 = "select * from " + str6 + " ," + paramString2 + " " + " where 1=1" + " and " + paramString2 + "." + paramString10 + " = " + paramInt + str;} else {str7 = "select * from " + str6 + " ," + paramString2 + " " + " where 1=1" + " and " + paramString2 + "." + paramString6 + " = '" + paramString7 + "'" + str;} this.newlog.info("querysql:" + str7);resultSet = paramStatement.executeQuery(str7);while (resultSet.next()) {String str8 = "";String str9 = "";if (str1.equals("0")) {str8 = "insert into " + str5 + "(requestid,groupId";str9 = " values(" + paramInt + "," + (String)arrayList2.get(b2);} else if (str1.equals("1")) {str8 = "insert into " + str5 + "(" + str3;str9 = " values(" + str4;} for (byte b = 0; b < arrayList.size(); b++) {String str10 = Util.null2String(arrayList.get(b));String str11 = Util.null2String((String)hashtable1.get(str10));if (!str11.equals("")) {String str12 = Util.null2String((String)hashtable2.get(str10));String str13 = Util.null2String((String)hashtable3.get(str10));String str14 = Util.null2String((String)hashtable4.get(str10));String str15 = Util.null2String((String)hashtable5.get(str10));String str16 = Util.null2String((String)hashtable6.get(str10));String str17 = Util.null2String((String)hashtable7.get(str10));String str18 = "";if (!str15.equals("")) {str15 = str15.substring(str15.indexOf(".") + 1);String str19 = (String)map.get(str15.toLowerCase());if (str19.contains("("))str19 = str19.substring(0, str19.indexOf("(")); if (str19.equals("number") || str19.equals("NUMBER") || str19.equals("float") || str19.equals("real") || str19.equals("Real")) {str18 = Util.null2String(resultSet.getString(str15));if (str18.startsWith("."))str18 = "0" + str18; if (str18.startsWith("-."))str18 = str18.replaceFirst("-.", "-0."); } else {str18 = Util.null2String(resultSet.getString(str15));} if (!"6".equals(str16)) {if (str12.equals("3"))if (str13.equals("1")) {str18 = getCreater(str18, str16);} else if (str13.equals("4")) {str18 = getDept(str18, str16);} else if (str13.equals("164")) {str18 = getSubCom(str18, str16);} } else if (!"".equals(str17)) {str18 = getTranSqlValue(str17, str18);} else {str18 = str18;} } if (str18.equals("")) {if (!str12.equals("2") && (!str12.equals("1") || (!str13.equals("1") && !str13.equals("5"))) && (!str12.equals("3") || (!str13.equals("2") && !str13.equals("19") && !str13.equals("161") && !str13.equals("162"))))str18 = "NULL"; if (str12.equals("5")) {str18 = "-1";} else if (str12.equals("4")) {str18 = "0";} } else if (str14.indexOf("varchar") == 0 || str14.indexOf("char") == 0) {int i = Util.getIntValue(str14.substring(str14.indexOf("(") + 1, str14.indexOf(")")), 0);if (Util.length2(str18) > i)do {str18 = str18.substring(0, str18.length() - 1);} while (Util.length2(str18) > i); str18 = str18.replace("'", "''");} else if (str14.equals("int") || str14.equals("integer")) {str18 = Util.getIntValue(str18, -1) + "";} else if (str14.indexOf("decimal") == 0 || str14.indexOf("number") == 0) {str18 = str18.replace(",", "");str18 = Util.getDoubleValue(str18, -1.0D) + "";} else if (str12.equals("3") && str13.equals("17") && bool) {hashMap.put(str11, str18);str18 = " empty_clob() ";} str8 = str8 + "," + str11;if (str14.startsWith("text") || str14.startsWith("char") || str14.startsWith("varchar") || str14.indexOf(".") > -1) {str9 = str9 + ",'" + str18 + "'";} else if (str12.equals("3") && (str13.equals("256") || str13.equals("257"))) {str9 = str9 + ",'" + str18 + "'";} else if (str14.startsWith("clob")) {str9 = str9 + "," + str18;} else {str9 = str9 + "," + str18;} } } str8 = str8 + ") ";str9 = str9 + ") ";this.newlog.info("detail sql:" + str8 + str9);recordSet.executeSql(str8 + str9);if (bool)try {String str10 = "";if (str1.equals("0")) {str10 = "select max(id) dtid from " + str5 + " where requestid =" + paramInt + " and groupId = " + (String)arrayList2.get(b2);} else if (str1.equals("1")) {str10 = "select max(id) dtid from " + str5 + " where " + str3 + " =" + str4;} recordSet.executeSql(str10);if (recordSet.next()) {String str11 = Util.null2String(recordSet.getString("dtid"));if (!"".equals(str11)) {String str12 = "";str12 = " select ";byte b3 = 0;String str13 = " ";Iterator<Map.Entry> iterator = hashMap.entrySet().iterator();while (iterator.hasNext()) {b3++;Map.Entry entry = iterator.next();String str14 = entry.getKey().toString();String str15 = "";if (entry.getValue() != null)if (String.valueOf(entry.getValue()).equals(" ")) {str15 = "";} else {str15 = String.valueOf(entry.getValue());} if (b3 > 1) {str12 = str12 + str13 + " , " + str14;continue;} str12 = str12 + str13 + " " + str14;} str12 = str12 + " from " + str5;if (str1.equals("0")) {str12 = str12 + " where requestid = " + paramInt + " and groupId = " + (String)arrayList2.get(b2) + " and id = " + str11 + " for update";} else if (str1.equals("1")) {str12 = str12 + " where " + str3 + " = " + str4 + "and id = " + str11 + " for update";} if (b3 > 0) {ConnStatement connStatement = null;try {connStatement = new ConnStatement();connStatement.setStatementSql(str12, false);connStatement.executeQuery();if (connStatement.next()) {iterator = hashMap.entrySet().iterator();b3 = 0;while (iterator.hasNext()) {b3++;Map.Entry entry = iterator.next();String str14 = entry.getKey().toString();String str15 = "";if (entry.getValue() != null)if (String.valueOf(entry.getValue()).equals(" ")) {str15 = "";} else {str15 = String.valueOf(entry.getValue());} CLOB cLOB = connStatement.getClob(b3);char[] arrayOfChar = str15.toCharArray();Writer writer = cLOB.getCharacterOutputStream();writer.write(arrayOfChar);writer.flush();writer.close();} } } catch (Exception exception) {this.newlog.error(", exception);} finally {if (connStatement != null)connStatement.close(); } } } } hashMap.clear();} catch (Exception exception) {this.newlog.error(", exception);} } } } }public void UpdateIntoDetailTable(Statement paramStatement, String paramString1, String paramString2, String paramString3, String paramString4, int paramInt, String paramString5, String paramString6, String paramString7, String paramString8, String paramString9, String paramString10) throws Exception {ResultSet resultSet = null;HashMap<Object, Object> hashMap = new HashMap<Object, Object>();WorkflowComInfo workflowComInfo = new WorkflowComInfo();String str1 = Util.null2String(workflowComInfo.getIsBill(paramString4));String str2 = Util.null2String(workflowComInfo.getFormId(paramString4));ArrayList<String> arrayList1 = new ArrayList();ArrayList<String> arrayList2 = new ArrayList();String str3 = "mainid";String str4 = "";ArrayList<String> arrayList3 = Util.TokenizerString(paramString7, ",");String[] arrayOfString = paramString8.split("\\$@\\|@\\$");ArrayList<String> arrayList4 = new ArrayList();for (byte b1 = 0; b1 < arrayOfString.length; b1++)arrayList4.add(arrayOfString[b1]); RecordSet recordSet = new RecordSet();boolean bool = recordSet.getDBType().equals("oracle");boolean bool1 = false;if (!str2.equals(""))if (str1.equals("0")) {recordSet.executeSql("select distinct groupId from Workflow_formfield where formid=" + str2 + " and isdetail='1' order by groupid");while (recordSet.next()) {arrayList1.add("workflow_formdetail");arrayList2.add(recordSet.getString(1));} } else if (str1.equals("1")) {recordSet.executeSql("select tablename from Workflow_billdetailtable where billid=" + str2 + " order by orderid");while (recordSet.next()) {String str = Util.null2String(recordSet.getString(1));if (!str.equals(""))arrayList1.add(recordSet.getString(1)); } recordSet.executeSql("select tablename,detailtablename,detailkeyfield from workflow_bill where id=" + str2);if (recordSet.next()) {str3 = Util.null2String(recordSet.getString("detailkeyfield"));if (arrayList1.size() == 0) {String str5 = Util.null2String(recordSet.getString("detailtablename"));if (!str5.equals(""))arrayList1.add(str5); } String str = recordSet.getString("tablename");recordSet.executeSql("select id from " + str + " where requestid=" + paramInt);if (recordSet.next())str4 = recordSet.getString("id"); } } if (arrayList1.size() != arrayList3.size()) {writeLog(");return;} for (byte b2 = 0; b2 < arrayList1.size(); b2++) {String str5 = arrayList1.get(b2);String str6 = arrayList3.get(b2);String str7 = "";if (paramString2.toLowerCase().indexOf("oracle") > -1) {str7 = "select 1 from user_tables a where a.TABLE_NAME = upper('" + str6 + "') union ALL select 1 from user_views b where b.VIEW_NAME = upper('" + str6 + "')";} else if (paramString2.toLowerCase().indexOf("sqlserver") > -1 || paramString2.toLowerCase().indexOf("sybase") > -1) {str7 = "select 1 from sysobjects where name = '" + str6 + "' ";} else if (paramString2.toLowerCase().indexOf("informix") > -1) {str7 = "select 1 from systables where lower(tabname) = lower('" + str6 + "') ";} else if (paramString2.toLowerCase().indexOf("mysql") > -1) {str7 = "select 1 from information_schema.Tables where LOWER(Table_Name)=LOWER('" + str6 + "') ";} else if (paramString2.toLowerCase().indexOf("db2") > -1) {str7 = "select 1 from SYSIBM.SYSTABLES where lower(name)= lower('" + str6 + "') ";} else {str7 = "select 1 from " + str6;} resultSet = paramStatement.executeQuery(str7);if (!resultSet.next()) {this.newlog.error("TABLE " + str6 + " IS NOT EXIST!");} else {String str8 = "";RecordSet recordSet1 = new RecordSet();if (str1.equals("0")) {str8 = "delete " + str5 + " where requestid='" + paramInt + "' and groupId='" + (String)arrayList2.get(b2) + "' ";} else if (str1.equals("1")) {str8 = "delete " + str5 + " where " + str3 + "='" + str4 + "' ";} recordSet1.executeSql(str8);ArrayList<String> arrayList = new ArrayList();Hashtable<Object, Object> hashtable1 = new Hashtable<Object, Object>();Hashtable<Object, Object> hashtable2 = new Hashtable<Object, Object>();Hashtable<Object, Object> hashtable3 = new Hashtable<Object, Object>();Hashtable<Object, Object> hashtable4 = new Hashtable<Object, Object>();Hashtable<Object, Object> hashtable5 = new Hashtable<Object, Object>();Hashtable<Object, Object> hashtable6 = new Hashtable<Object, Object>();Hashtable<Object, Object> hashtable7 = new Hashtable<Object, Object>();String str9 = Util.null2String(arrayList4.get(b2));if (str9.equals("-"))str9 = ""; recordSet.executeSql("select * from outerdatawfsetdetail where outerfieldname like '" + str6 + ".%' and mainid=" + paramString3);while (recordSet.next()) {String str10 = recordSet.getString("wffieldid");String str11 = recordSet.getString("wffieldname");String str12 = recordSet.getString("wffieldhtmltype");String str13 = recordSet.getString("wffieldtype");String str14 = recordSet.getString("wffielddbtype");String str15 = recordSet.getString("outerfieldname");String str16 = recordSet.getString("changetype");String str17 = recordSet.getString("customsql");arrayList.add(str10);hashtable1.put(str10, str11);hashtable2.put(str10, str12);hashtable3.put(str10, str13);hashtable4.put(str10, str14);hashtable5.put(str10, str15);hashtable6.put(str10, str16);hashtable7.put(str10, str17);} Pattern pattern = Pattern.compile("where");Matcher matcher = pattern.matcher(str9);str9 = matcher.replaceFirst(" and ");if (!paramString10.equals("1") && !paramString9.equals("")) {str7 = "select * from " + str6 + " ," + paramString1 + " " + " where 1=1" + " and " + paramString1 + "." + paramString9 + " = " + paramInt + str9;} else {str7 = "select * from " + str6 + " ," + paramString1 + " " + " where 1=1" + " and " + paramString1 + "." + paramString5 + " = '" + paramString6 + "'" + str9;} this.newlog.info("querysql:" + str7);resultSet = paramStatement.executeQuery(str7);while (resultSet.next()) {String str10 = "";String str11 = "";if (str1.equals("0")) {str10 = "insert into " + str5 + "(requestid,groupId";str11 = " values(" + paramInt + "," + (String)arrayList2.get(b2);} else if (str1.equals("1")) {str10 = "insert into " + str5 + "(" + str3;str11 = " values(" + str4;} for (byte b = 0; b < arrayList.size(); b++) {String str12 = Util.null2String(arrayList.get(b));String str13 = Util.null2String((String)hashtable1.get(str12));if (!str13.equals("")) {String str14 = Util.null2String((String)hashtable2.get(str12));String str15 = Util.null2String((String)hashtable3.get(str12));String str16 = Util.null2String((String)hashtable4.get(str12));String str17 = Util.null2String((String)hashtable5.get(str12));String str18 = Util.null2String((String)hashtable6.get(str12));String str19 = Util.null2String((String)hashtable7.get(str12));String str20 = "";if (!str17.equals("")) {str17 = str17.substring(str17.indexOf(".") + 1);str20 = Util.null2String(resultSet.getString(str17));if (!"6".equals(str18)) {if (str14.equals("3"))if (str15.equals("1")) {str20 = getCreater(str20, str18);} else if (str15.equals("4")) {str20 = getDept(str20, str18);} else if (str15.equals("164")) {str20 = getSubCom(str20, str18);} } else if (!"".equals(str19)) {str20 = getTranSqlValue(str19, str20);} else {str20 = str20;} } if (str20.equals("")) {if (!str14.equals("2") && (!str14.equals("1") || (!str15.equals("1") && !str15.equals("5"))) && (!str14.equals("3") || (!str15.equals("2") && !str15.equals("19") && !str15.equals("161") && !str15.equals("162"))))str20 = "NULL"; if (str14.equals("5")) {str20 = "-1";} else if (str14.equals("4")) {str20 = "0";} } else if (str16.indexOf("varchar") == 0 || str16.indexOf("char") == 0) {int i = Util.getIntValue(str16.substring(str16.indexOf("(") + 1, str16.indexOf(")")), 0);if (Util.length2(str20) > i)do {str20 = str20.substring(0, str20.length() - 1);} while (Util.length2(str20) > i); str20 = str20.replace("'", "''");} else if (str16.equals("int") || str16.equals("integer")) {str20 = Util.getIntValue(str20, -1) + "";} else if (str16.indexOf("decimal") == 0 || str16.indexOf("number") == 0) {str20 = str20.replace(",", "");str20 = Util.getDoubleValue(str20, -1.0D) + "";} else if (str14.equals("3") && str15.equals("17") && bool) {hashMap.put(str13, str20);str20 = " empty_clob() ";} str10 = str10 + "," + str13;if (str16.startsWith("text") || str16.startsWith("char") || str16.startsWith("varchar") || str16.indexOf(".") > -1 || str16.startsWith("clob")) {str11 = str11 + ",'" + str20 + "'";} else if (str14.equals("3") && (str15.equals("256") || str15.equals("257"))) {str11 = str11 + ",'" + str20 + "'";} else {str11 = str11 + "," + str20;} } } str10 = str10 + ") ";str11 = str11 + ") ";this.newlog.info("detail sql:" + str10 + str11);recordSet.executeSql(str10 + str11);if (bool)try {String str = "";if (str1.equals("0")) {str = "select max(id) dtid from " + str5 + " where requestid =" + paramInt + " and groupId = " + (String)arrayList2.get(b2);} else if (str1.equals("1")) {str = "select max(id) dtid from " + str5 + " where " + str3 + " =" + str4;} recordSet.executeSql(str);if (recordSet.next()) {String str12 = Util.null2String(recordSet.getString("dtid"));if (!"".equals(str12)) {String str13 = "";str13 = " select ";byte b3 = 0;String str14 = " ";Iterator<Map.Entry> iterator = hashMap.entrySet().iterator();while (iterator.hasNext()) {b3++;Map.Entry entry = iterator.next();String str15 = entry.getKey().toString();String str16 = "";if (entry.getValue() != null)if (String.valueOf(entry.getValue()).equals(" ")) {str16 = "";} else {str16 = String.valueOf(entry.getValue());} if (b3 > 1) {str13 = str13 + str14 + " , " + str15;continue;} str13 = str13 + str14 + " " + str15;} str13 = str13 + " from " + str5;if (str1.equals("0")) {str13 = str13 + " where requestid = " + paramInt + " and groupId = " + (String)arrayList2.get(b2) + " and id = " + str12 + " for update";} else if (str1.equals("1")) {str13 = str13 + " where " + str3 + " = " + str4 + "and id = " + str12 + " for update";} if (b3 > 0) {ConnStatement connStatement = null;try {connStatement = new ConnStatement();connStatement.setStatementSql(str13, false);connStatement.executeQuery();if (connStatement.next()) {iterator = hashMap.entrySet().iterator();b3 = 0;while (iterator.hasNext()) {b3++;Map.Entry entry = iterator.next();String str15 = entry.getKey().toString();String str16 = "";if (entry.getValue() != null)if (String.valueOf(entry.getValue()).equals(" ")) {str16 = "";} else {str16 = String.valueOf(entry.getValue());} CLOB cLOB = connStatement.getClob(b3);char[] arrayOfChar = str16.toCharArray();Writer writer = cLOB.getCharacterOutputStream();writer.write(arrayOfChar);writer.flush();writer.close();} } } catch (Exception exception) {this.newlog.error(", exception);} finally {if (connStatement != null)connStatement.close(); } } } } hashMap.clear();} catch (Exception exception) {this.newlog.error(", exception);} } } } }public String getCreater(String paramString1, String paramString2) {paramString1 = paramString1.replace("'", "''");RecordSet recordSet = new RecordSet();String str = "";if (paramString2.equals("0")) {recordSet.executeSql("select id from HrmResource where id='" + paramString1 + "' and status<4 and (loginid !='' Or loginid is not null) ");if (recordSet.next())str = recordSet.getString("id"); } else if (paramString2.equals("1")) {recordSet.executeSql("select id from HrmResource where workcode='" + paramString1 + "' and status<4 and (loginid !='' Or loginid is not null) ");if (recordSet.next())str = recordSet.getString("id"); } else if (paramString2.equals("2")) {recordSet.executeSql("select id from HrmResource where loginid='" + paramString1 + "' and status<4 and (loginid !='' Or loginid is not null) ");if (recordSet.next())str = recordSet.getString("id"); } else if (paramString2.equals("3")) {recordSet.executeSql("select id from HrmResource where mobile='" + paramString1 + "' and status<4 and (loginid !='' Or loginid is not null) ");if (recordSet.next())str = recordSet.getString("id"); } else if (paramString2.equals("4")) {recordSet.executeSql("select id from HrmResource where email='" + paramString1 + "' and status<4 and (loginid !='' Or loginid is not null) ");if (recordSet.next())str = recordSet.getString("id"); } else if (paramString2.equals("5")) {recordSet.executeSql("select id from HrmResource where id='" + paramString1 + "' and status<4 and (loginid !='' Or loginid is not null) ");if (recordSet.next())str = recordSet.getString("id"); } return str;}public String getDept(String paramString1, String paramString2) {paramString1 = paramString1.replace("'", "''");RecordSet recordSet = new RecordSet();String str = "";if (paramString2.equals("0")) {recordSet.executeSql("select id from HrmDepartment where id='" + paramString1 + "'");if (recordSet.next())str = recordSet.getString("id"); } else if (paramString2.equals("1")) {recordSet.executeSql("select id from HrmDepartment where departmentcode='" + paramString1 + "'");if (recordSet.next())str = recordSet.getString("id"); } return str;}public String getSubCom(String paramString1, String paramString2) {paramString1 = paramString1.replace("'", "''");RecordSet recordSet = new RecordSet();String str = "";if (paramString2.equals("0")) {recordSet.executeSql("select id from HrmSubCompany where id='" + paramString1 + "'");if (recordSet.next())str = recordSet.getString("id"); } else if (paramString2.equals("1")) {recordSet.executeSql("select id from HrmSubCompany where subcompanycode='" + paramString1 + "'");if (recordSet.next())str = recordSet.getString("id"); } return str;}private boolean saveOutTrigLog(Statement paramStatement, String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6, String paramString7, String paramString8) {try {String str = "";if (!"".equals(paramString4))str = str + paramString4 + "='" + paramString7 + "'"; if (!"".equals(paramString4))str = str + ("".equals(str) ? (paramString5 + "='" + paramString8 + "'") : ("," + paramString5 + "='" + paramString8 + "'")); if (!"".equals(paramString2)) {paramString2 = paramString2.trim();if (paramString2.indexOf("set") == 0)paramString2 = paramString2.substring(4); str = str + ("".equals(str) ? paramString2 : ("," + paramString2));} if (!"".equals(str)) {String str1 = "update " + paramString1 + " set " + str + " where " + paramString3 + "='" + paramString6 + "'";this.newlog.info("saveOutTrigLog sql : " + str1);paramStatement.executeUpdate(str1);} } catch (Exception exception) {this.newlog.error(", exception);return false;} return true;}private boolean saveUpdateWfFlag(Statement paramStatement, String paramString1, String paramString2, String paramString3, String paramString4, String paramString5) {try {String str1 = "";String str2 = "";if (paramString4.equals("2") && !"".equals(paramString5))str2 = str2 + ("".equals(str2) ? (paramString5 + "='0'") : ("," + paramString5 + "='0'")); if (!"".equals(str1)) {str1 = str1.trim();if (str1.indexOf("set") == 0)str1 = str1.substring(4); str2 = str2 + ("".equals(str2) ? str1 : ("," + str1));} if (!"".equals(str2)) {String str = "update " + paramString1 + " set " + str2 + " where " + paramString2 + "='" + paramString3 + "'";paramStatement.executeUpdate(str);this.newlog.info("saveUpdateWfFlag sql : " + str);} } catch (Exception exception) {this.newlog.error(", exception);return false;} return true;}private boolean saveTrigLog(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5) {try {boolean bool = false;RecordSet recordSet = new RecordSet();String str = "select requestid from outerdatawfdetail where keyfieldvalue='" + paramString4 + "' and outermaintable = '" + paramString5 + "' and workflowid=" + paramString1 + " and mainid=" + paramString3;recordSet.executeSql(str);if (recordSet.next())bool = true; if (bool) {str = "update outerdatawfdetail set requestid=" + paramString2 + " where mainid=" + paramString3 + " and workflowid=" + paramString1 + " and outermaintable = '" + paramString5 + "' and keyfieldvalue='" + paramString4 + "'";} else {str = "insert into outerdatawfdetail(mainid,workflowid,requestid,keyfieldvalue,outermaintable) values(" + paramString3 + "," + paramString1 + "," + paramString2 + ",'" + paramString4 + "','" + paramString5 + "')";} this.newlog.info("saveTrigLog sql : " + str);recordSet.executeSql(str);} catch (Exception exception) {this.newlog.error(", exception);return false;} return true;}private void saveRequestLog(String paramString1, String paramString2, String paramString3, int paramInt) {SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM-dd");SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("HH:mm:ss");Date date = new Date();String str1 = simpleDateFormat1.format(date);String str2 = simpleDateFormat2.format(date);String str3 = "";if (paramInt > -1) {str3 = "1";} else {str3 = "0";} RecordSet recordSet = new RecordSet();String str4 = "insert into outerdatawflog(Outerdatawfid,Outkey,Workflowid,RequestId,Triggerflag,CreateDate,CreateTime) values('" + paramString1 + "','" + paramString2 + "','" + paramString3 + "','" + paramInt + "','" + str3 + "','" + str1 + "','" + str2 + "')";recordSet.executeSql(str4);this.newlog.info("saveRequestLog sql : " + str4);}
}
很长一段,核心检查逻辑在 public void doActiveOutDataWF() 这里。
| 参数名 | 含义 | 用途 |
id | 外部表的主键项,可以是任何名字 | |
workflowid | 需要被触发创建的流程id | |
datasourceid | 数据源id、即使是泛微自己的表作为外部表、也需要创建数据源 | |
outermaintable | 外部表(主表)的名字 | |
keyfield | ||
datarecordtype | ||
requestid | 外部表触发成功后、回写产生的流程请求id的列的名字 | |
FTriggerFlag | 默认不可更名:触发成功的回写列,不能在其他条件中进行数据修改。 | |
FTriggerFlagValue | ||
outermainwhere | 外部表的数据筛选条件,必须以 where 开头。 | |
successback | ||
failback | ||
outerdetailtables | 外部表的明细表(可选) | |
outerdetailwheres | 外部表的明细表筛选条件、用作判断和主表关联(可选) | |
isnextnode | ||
isupdatewfdata | ||
isupdatewfdataField |
目前看来、在最简单的配置方法下:CREATER 和流程标题是必须提供外部表字段的。其他等泛微工程师进行解答。

总结
未完待续。。
相关文章:
泛微E8配置自定义触发流程失败
在新公司接了个配置泛微流程触发的活。因为泛微的官方文档并没有详细的操作指引,在测试环境配置之后、要触发的流程可以手工提交,但是触发一直不成功。简单记录下业务场景和其他处理信息,以供参考。 应用版本 目前使用了泛微 E8 ࿰…...
Springboot整合Mybatis调用Oracle存储过程
1、配置说明 Oracel11g+springboot2.7.14+mybatis3.5.13 目标:springboot整合mybatis访问oracle中的存储过程,存储过程返回游标信息。 mybatis调用oracle中的存储过程方式 2、工程结构 3、具体实现 3.1、在Oracle中创建测试数据库表 具体数据可自行添加 create table s…...
【java安全】Log4j反序列化漏洞
文章目录 【java安全】Log4j反序列化漏洞关于Apache Log4j漏洞成因CVE-2017-5645漏洞版本复现环境漏洞复现漏洞分析 CVE-2019-17571漏洞版本漏洞复现漏洞分析 参考 【java安全】Log4j反序列化漏洞 关于Apache Log4j Log4j是Apache的开源项目,可以实现对System.out…...
[mars3d 打包]vue3+vite,打包后mars3d找不到
前提 : vue3vite开发框架;使用 官网 方式3获取sdk,引入mars3d; 问题:开发时一切正常,打包之后,页面白屏,没有渲染; 相关的mars3d的相关方法会报错;但是mars3d的打印日志是有的&…...
STM32——SPI外设总线
SPI外设简介 STM32内部集成了硬件SPI收发电路,可以由硬件自动执行时钟生成、数据收发等功能,减轻CPU的负担 可配置8位/16位数据帧、高位先行/低位先行 时钟频率: fPCLK / (2, 4, 8, 16, 32, 64, 128, 256) 支持多主机模型、主或从操作 可…...
BOXTRADE-天启量化分析平台 主要功能介绍
BOXTRADE-天启量化分析平台 主要功能介绍 potato 数学 web 缘起 月晕而风,础润而雨 BOXTRADE-天启量化 欢迎来到天启量化!这是一个专注于量化分析的网站。我们致力于为用户提供市场行情技术指标和量化策略分析方面的优质内容和资源。 我们的使命是 做…...
kaggle注册不显示验证码
edge浏览器 1.点击浏览器右上角三个点 2.点击扩展 3.点击管理扩展 4.点击获取Microsoft Edge扩展,在左上角输入Head Editor 5.输入https://www.azurezeng.com/static/HE-GoogleRedirect.json 6.下载后,点保存 成功!...
python爬虫7:实战1
python爬虫7:实战1 前言 python实现网络爬虫非常简单,只需要掌握一定的基础知识和一定的库使用技巧即可。本系列目标旨在梳理相关知识点,方便以后复习。 申明 本系列所涉及的代码仅用于个人研究与讨论,并不会对网站产生不好…...
uniApp引入vant2
uniApp引入vant2 1、cnpm 下载:cnpm i vantlatest-v2 -S2、main.js文件引入 import Vant from ./node_modules/vant/lib/vant;Vue.use(Vant);3.app.vue中引入vant 样式文件 import /node_modules/vant/lib/index.css;...
如何大幅提高遥感影像分辨率(Python+MATLAB)
前言: 算法:NSCT算法(非下采样变换) 数据:Landsat8 OLI 遥感图像数据 编程平台:MATLAB+Python 论文参考:毛克.一种快速的全色和多光谱图像融合算法[J].测绘科学,2016,41(01):151-153+98.DOI:10.16251/j.cnki.1009-2307.2016.01.028. 左图:未进行融合的多光谱真彩色合…...
nginx php-fpm安装配置
nginx php-fpm安装配置 nginx本身不能处理PHP,它只是个web服务器,当接收到请求后,如果是php请求,则发给php解释器处理,并把结果返回给客户端。 nginx一般是把请求发fastcgi管理进程处理,fascgi管理进程选…...
通过ip获取地理位置信息
GeoLite2-City.mmdb 文件是 MaxMind 公司提供的一个免费的 IP 地址与城市地理位置映射数据库文件。它包含了 IP 地址范围与对应的城市、地区、国家、经纬度等地理位置信息的映射。这种数据库文件可以用于识别访问您的应用程序或网站的用户的地理位置,从而实现针对不…...
数据库索引优化策略与性能提升实践
文章目录 什么是数据库索引?为什么需要数据库索引优化?数据库索引优化策略实践案例:索引优化带来的性能提升索引优化规则1. 前导模糊查询不适用索引2. 使用IN优于UNION和OR3. 负向条件查询不适用索引4. 联合索引最左前缀原则5. 范围条件查询右…...
【ARM 嵌入式 编译系列 11.1 -- GCC __attribute__((aligned(x)))详细介绍】
文章目录 __attribute__((aligned(x)))详细介绍其它对齐方式上篇文章:ARM 嵌入式 编译系列 11 – GCC attribute((packed))详细介绍 attribute((aligned(x)))详细介绍 __attribute__((aligned(x))) 是 GCC 编译器的一个特性,它可以用于变量或类型,用来指定它们在内存中的…...
【计算机视觉|生成对抗】逐步增长的生成对抗网络(GAN)以提升质量、稳定性和变化
本系列博文为深度学习/计算机视觉论文笔记,转载请注明出处 标题:Progressive Growing of GANs for Improved Quality, Stability, and Variation 链接:[1710.10196] Progressive Growing of GANs for Improved Quality, Stability, and Vari…...
C++11并发与多线程笔记(8) condition_variable、wait、notify_one、notify_all
C11并发与多线程笔记(8) condition_variable、wait、notify_one、notify_all 1、条件变量condition_variable、wait、notify_one、notify_all1.1 std::condition_variable1.2 wait()1.3 notify_one()1.4 notify_all() 2、深入思考 1、条件变量condition_…...
C语言——通讯录详解(动态版)
通讯录详解 前言:一、定义一个通讯录二、初始化三、增加联系人3.1 给通讯录扩容3.2增加联系人 四、释放内存五、完整代码 前言: 我们已经学过了通讯录的静态版,但是它的缺点很明显,通讯录满了就添加不了联系人了啦。我再让通讯录升…...
【云原生】kubernetes应用程序包管理工具Helm
Helm 什么是 Helm 安装 Helm 重要概念 使用 Helm 1 简介 官网地址: Helm Helm是一个Kubernetes应用程序包管理工具,它允许你轻松管理和部署Kubernetes应用程序。Helm通过使用称为Charts的预定义模板来简化Kubernetes应用程序的部署和管理。Chart包含了一组Ku…...
蓝牙资讯|苹果Apple Watch可手势操控Mac和Apple TV等设备
根据美国商标和专利局(USPTO)公示的清单,苹果公司近日获得了一项技术专利,概述了未来的 Apple Watch 手表,使用手势等操控 Mac 和 Apple TV 等设备。 该专利描述未来 Apple Watch 可以交互实现编辑图像、绘图、处理文…...
认识excel篇2之如何快速输入数据
一、快速输入数据(快捷键功能的使用) 1、鼠标左键填充:复制填充、等差序列填充(行、列是一样的) 步骤:选中单元格,鼠标放置到单元格右下角待鼠标箭头变成实心十字架,左键向下拖拽&…...
深度学习在微纳光子学中的应用
深度学习在微纳光子学中的主要应用方向 深度学习与微纳光子学的结合主要集中在以下几个方向: 逆向设计 通过神经网络快速预测微纳结构的光学响应,替代传统耗时的数值模拟方法。例如设计超表面、光子晶体等结构。 特征提取与优化 从复杂的光学数据中自…...
synchronized 学习
学习源: https://www.bilibili.com/video/BV1aJ411V763?spm_id_from333.788.videopod.episodes&vd_source32e1c41a9370911ab06d12fbc36c4ebc 1.应用场景 不超卖,也要考虑性能问题(场景) 2.常见面试问题: sync出…...
Appium+python自动化(十六)- ADB命令
简介 Android 调试桥(adb)是多种用途的工具,该工具可以帮助你你管理设备或模拟器 的状态。 adb ( Android Debug Bridge)是一个通用命令行工具,其允许您与模拟器实例或连接的 Android 设备进行通信。它可为各种设备操作提供便利,如安装和调试…...
【Java学习笔记】Arrays类
Arrays 类 1. 导入包:import java.util.Arrays 2. 常用方法一览表 方法描述Arrays.toString()返回数组的字符串形式Arrays.sort()排序(自然排序和定制排序)Arrays.binarySearch()通过二分搜索法进行查找(前提:数组是…...
django filter 统计数量 按属性去重
在Django中,如果你想要根据某个属性对查询集进行去重并统计数量,你可以使用values()方法配合annotate()方法来实现。这里有两种常见的方法来完成这个需求: 方法1:使用annotate()和Count 假设你有一个模型Item,并且你想…...
质量体系的重要
质量体系是为确保产品、服务或过程质量满足规定要求,由相互关联的要素构成的有机整体。其核心内容可归纳为以下五个方面: 🏛️ 一、组织架构与职责 质量体系明确组织内各部门、岗位的职责与权限,形成层级清晰的管理网络…...
MODBUS TCP转CANopen 技术赋能高效协同作业
在现代工业自动化领域,MODBUS TCP和CANopen两种通讯协议因其稳定性和高效性被广泛应用于各种设备和系统中。而随着科技的不断进步,这两种通讯协议也正在被逐步融合,形成了一种新型的通讯方式——开疆智能MODBUS TCP转CANopen网关KJ-TCPC-CANP…...
全面解析各类VPN技术:GRE、IPsec、L2TP、SSL与MPLS VPN对比
目录 引言 VPN技术概述 GRE VPN 3.1 GRE封装结构 3.2 GRE的应用场景 GRE over IPsec 4.1 GRE over IPsec封装结构 4.2 为什么使用GRE over IPsec? IPsec VPN 5.1 IPsec传输模式(Transport Mode) 5.2 IPsec隧道模式(Tunne…...
蓝桥杯 冶炼金属
原题目链接 🔧 冶炼金属转换率推测题解 📜 原题描述 小蓝有一个神奇的炉子用于将普通金属 O O O 冶炼成为一种特殊金属 X X X。这个炉子有一个属性叫转换率 V V V,是一个正整数,表示每 V V V 个普通金属 O O O 可以冶炼出 …...
AGain DB和倍数增益的关系
我在设置一款索尼CMOS芯片时,Again增益0db变化为6DB,画面的变化只有2倍DN的增益,比如10变为20。 这与dB和线性增益的关系以及传感器处理流程有关。以下是具体原因分析: 1. dB与线性增益的换算关系 6dB对应的理论线性增益应为&…...
