INSERT INTO MWCONFIG.CONFIG_METADATA (ACTIVE, XML, MODIFIED_BY, TIMESTAMP)
VALUES (1, '
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}''
2000
mapping-script
String unescape(String p) {
id.co.hanoman.config.Util.unescape(p);
}
String hex(String p) {
id.co.hanoman.config.Util.hex(p);
}
void copyMessage() {
id.co.hanoman.config.UtilMQ.copyMbMessage(tar.''!this'', msg.''!this'');
}
void copyMessage(String dest, String src) {
id.co.hanoman.config.UtilMQ.copyMbMessage(id.co.hanoman.config.UtilMQ.getMbFolder(tar.''!this'', dest), id.co.hanoman.config.UtilMQ.getMbFolder(head.''!this'', src));
}
void copyMessage(String dest, String src, int depth) {
id.co.hanoman.config.UtilMQ.copyMbMessage(id.co.hanoman.config.UtilMQ.getMbFolder(tar.''!this'', dest), id.co.hanoman.config.UtilMQ.getMbFolder(head.''!this'', src), depth);
}
void copyMessageToChild(String id) {
id.co.hanoman.config.UtilMQ.copyMbMessage(id.co.hanoman.config.UtilMQ.getMbFolder(tar.''!this'', id), msg.''!this'');
}
void setValue(String name, String value) {
mbt.createElementAsLastChild(com.ibm.broker.plugin.MbXMLNSC.FOLDER, name, value);
}
String counter(String id, int hiLength, int loLength, String dateReset) {
id.co.hanoman.config.Util.counter(getParamValue("System", "counter." + id, getParamValue("System", "counter.path", null)), id, hiLength, loLength, dateReset);
}
String convert(String type, Object value, int length) {
id.co.hanoman.config.Util.convert(type, value, length);
}
String decimalFormat(String format, Number value) {
new java.text.DecimalFormat(format).format(value);
}
String getTimeZoneFormat(String format, String timeZone) {
id.co.hanoman.config.Util.getTimeZoneFormat(format, timeZone);
}
String getTimeZoneFormat(String format, String timeZone, Date) {
id.co.hanoman.config.Util.getTimeZoneFormat(format, timeZone, Date);
}
String getUID(String str) {
id.co.hanoman.config.Util.getUID(str);
}
Object bitmap(Map msg, List fields) {
id.co.hanoman.config.Util.bitmap(msg, fields);
}
Object bitmapHex(Map msg, List fields) {
id.co.hanoman.config.Util.hex(id.co.hanoman.config.Util.bitmap(msg, fields));
}
Object dtree(String group, String treeRoot) {
id.co.hanoman.mbplugin.codex.UtilCodex.dtree(config, ctx, group, treeRoot, msg, head, tar);
}
String getParamValue(String group, String name, String defaultValue) {
id.co.hanoman.mbplugin.codex.UtilCodex.getParamValue(config, ctx, group, name, defaultValue, msg, head, local, tar, idx, size);
}
String getParamValueWithError(String group, String name, String error) {
def v = id.co.hanoman.mbplugin.codex.UtilCodex.getParamValue(config, ctx, group, name, null, msg, head, local, tar, idx, size);
if (v == null)
throw new Exception(error);
return v;
}
List getParamValues(String group, String name) {
id.co.hanoman.mbplugin.codex.UtilCodex.getParamValues(config, ctx, group, name, defaultValue, msg, head, local, tar, idx, size);
}
String binaryToNumeric(String type, Object value) {
id.co.hanoman.config.Util.binaryToNumeric(type, value);
}
String ebcdicToAscii(String value) {
id.co.hanoman.config.Util.ebcdicToAscii(value);
}
String getCharge(int idx) {
def v;
if ((v = tar.get("charge_script_" + idx)) != null) {
def script = id.co.hanoman.mbplugin.codex.MappingScript.init(config, ctx, "", "return " + v);
script.setParam("charge_value", tar.get("charge_value_" + idx));
return script.evalString(msg, head, local, tar, idx, size);
} else if ((v = tar.get("charge_value_" + idx)) != null) {
return v;
}
return null;
}
String getChargeValue(int idx) {
def v;
if ((v = tar.get("charge_value_" + idx)) != null) {
return v;
}
return null;
}
String getAccount(int index) {
return tar.get("charge_account_" + index);
}
String numericToBinaryCounter(String value, int idx) {
new java.lang.Integer(value).toHexString(new java.lang.Integer(value) + new java.lang.Integer(idx));
}
void throwException(String error) {
throw new Exception(error);
}
String padLeftMbElementOrString(Object obj, int i, String s) {
return (obj instanceof String ? ((String)obj).padLeft(i, s) : ((com.ibm.broker.plugin.MbElement)obj).getValueAsString().padLeft(i, s));
}
void convertMsg() {
Map map = new LinkedHashMap();
id.co.hanoman.config.UtilMQ.convertData2Map(msg.''!this'', map);
map.remove("!raw");
map.remove("!remaining");
map.remove("!remainingPos");
id.co.hanoman.mbplugin.codex.CodexFactory cf = new id.co.hanoman.mbplugin.codex.CodexFactory(null, config);
id.co.hanoman.mbplugin.codex.Codex cc = cf.getCodex("dsp-iso-response");
id.co.hanoman.mbplugin.codex.CodexContext ctx = new id.co.hanoman.mbplugin.codex.CodexContext();
cc.encode(ctx, map);
String hex = id.co.hanoman.config.Util.dump(ctx.toByteArray(), 0, ctx.toByteArray().length);
if (hex.length() > 999) {
tar.responses1 = hex.substring(0, 999);
hex = hex.substring(999);
} else {
tar.responses1 = hex;
hex = "";
}
if (hex.length() > 999) {
tar.responses2 = hex.substring(0, 999);
hex = hex.substring(999);
} else if (hex.length() > 0) {
tar.responses2 = hex;
hex = "";
}
if (hex.length() > 999) {
tar.responses3 = hex.substring(0, 999);
hex = hex.substring(999);
} else if (hex.length() > 0) {
tar.responses3 = hex;
hex = "";
}
if (hex.length() > 0) {
tar.responses4 = hex;
}
}
String checkSpvOR(String hex) {
String binaryString = Integer.toBinaryString(Integer.parseInt(hex, 16));
String toCheck = binaryString.substring(binaryString.length() - 2, binaryString.length());
if (toCheck.equals("10")) {
return "FE";
} else if (toCheck.equals("01")) {
return "FD";
} else if (toCheck.equals("11")) {
return "FF";
} else {
return "FC";
}
}
void normalizeF9() {
Map map = new LinkedHashMap();
id.co.hanoman.config.UtilMQ.convertData2Map(msg.''!this'', map);
id.co.hanoman.mbplugin.codex.CodexFactory cf = new id.co.hanoman.mbplugin.codex.CodexFactory(null, config);
id.co.hanoman.mbplugin.codex.Codex cc = cf.getCodex("dsp-abcs-response");
id.co.hanoman.mbplugin.codex.CodexContext ctx = new id.co.hanoman.mbplugin.codex.CodexContext();
cc.encode(ctx, map);
String F9Concat = "";
int countF9 = Integer.valueOf(map.get("!COUNT_F9"));
F9Concat = String.valueOf(countF9).padLeft(3, "0");
int i = 1;
while (countF9 >= i) {
F9Concat += map.get("!WITH_" + i + "_F9").toString().padLeft(20, "0") + map.get("!DEP_" + i + "_F9").toString().padLeft(20, "0") + map.get("!INT_" + i + "_F9").toString().padLeft(20, "0") + map.get("!BAL_" + i + "_F9").toString().padLeft(20, "0") + map.get("!TELL_" + i + "_F9").toString().padLeft(7, "0") + map.get("!DATE_" + i + "_F9").toString().padLeft(7, "0") + map.get("!TLPBB_" + i + "_F9").toString().padLeft(3, "0") + map.get("!TLLIN_" + i + "_F9").toString().padLeft(3, "0") + map.get("!TLSB_" + i + "_F9").toString().padLeft(4, "0");
i++;
}
tar.F9Normalize = F9Concat;
}
String getNormalizeF9() {
Map map = new LinkedHashMap();
id.co.hanoman.config.UtilMQ.convertData2Map(msg.''!this'', map);
id.co.hanoman.mbplugin.codex.CodexFactory cf = new id.co.hanoman.mbplugin.codex.CodexFactory(null, config);
id.co.hanoman.mbplugin.codex.Codex cc = cf.getCodex("dsp-abcs-response");
id.co.hanoman.mbplugin.codex.CodexContext ctx = new id.co.hanoman.mbplugin.codex.CodexContext();
cc.encode(ctx, map);
String F9Concat = "";
int countF9 = Integer.valueOf(map.get("!COUNT_F9"));
F9Concat = String.valueOf(countF9).padLeft(2, "0");
int i = 1;
while (countF9 >= i) {
F9Concat += map.get("!WITH_" + i + "_F9").toString().padLeft(19, "0") + map.get("!DEP_" + i + "_F9").toString().padLeft(19, "0") + map.get("!INT_" + i + "_F9").toString().padLeft(19, "0") + map.get("!BAL_" + i + "_F9").toString().padLeft(19, "0") + map.get("!TELL_" + i + "_F9").toString().padLeft(7, "0") + map.get("!DATE_" + i + "_F9").toString().padLeft(7, "0") + map.get("!TLPBB_" + i + "_F9").toString().padLeft(3, "0") + map.get("!TLLIN_" + i + "_F9").toString().padLeft(3, "0") + map.get("!TLSB_" + i + "_F9").toString().padLeft(4, "0");
i++;
}
return F9Concat;
}
String getNormalize42() {
Map map = new LinkedHashMap();
id.co.hanoman.config.UtilMQ.convertData2Map(msg.''!this'', map);
id.co.hanoman.mbplugin.codex.CodexFactory cf = new id.co.hanoman.mbplugin.codex.CodexFactory(null, config);
id.co.hanoman.mbplugin.codex.Codex cc = cf.getCodex("dsp-abcs-response");
id.co.hanoman.mbplugin.codex.CodexContext ctx = new id.co.hanoman.mbplugin.codex.CodexContext();
cc.encode(ctx, map);
String StrConcat = "";
StrConcat = map.get("!TELLERTRANCD_42").toString().padLeft(5, "0") + map.get("!TELLERTRANMNM_42").toString().padLeft(3, "0") + map.get("!TELLERJOURNALSEQ_42").toString().padLeft(7, "0") + map.get("!TELLER_42").toString().padLeft(7, "0") + map.get("!CTRLID_42").toString().padLeft(3, "0") + map.get("!WORKSTID_42").toString().padLeft(2, "0") + map.get("!HIGHOVRD_42").toString().padLeft(1, "0") + map.get("!NUMERR_42").toString().padLeft(2, "0") + map.get("!FILL_A_42").toString().padLeft(3, "0") + map.get("!FILL_B_42").toString().padLeft(1, "0");
int count42 = Integer.valueOf(map.get("!NUMERR_42"));
int i = 1;
while (count42 >= i) {
StrConcat += map.get("!EDIT_" + i + "_42").toString().padLeft(2, "0") + map.get("!OVERRIDE_" + i + "_42").toString().padLeft(1, "0") + map.get("!TLTX_" + i + "_42").toString().padLeft(1, "0") + map.get("!ADDINF_" + i + "_42").toString().padLeft(17, "0") + map.get("!FILLER1_" + i + "_42").toString().padLeft(3, "0") + map.get("!FILLER2_" + i + "_42").toString().padLeft(1, "0");
i++;
}
StrConcat += map.get("!FILL_1_42").toString().padLeft(2, "0") + map.get("!FILL_2_42").toString().padLeft(1, "0") + map.get("!FILL_3_42").toString().padLeft(1, "0") + map.get("!FILL_4_42").toString().padLeft(17, "0") + map.get("!ERROR_42").toString().padLeft(50, "0");
return StrConcat;
}
String passBookF9() {
Map map = new LinkedHashMap();
id.co.hanoman.config.UtilMQ.convertData2Map(msg.''!this'', map);
String F9Concat = "";
int countF9 = Integer.valueOf(map.get("!COUNT_F9"));
int index = 0;
int i = 1;
if (countF9 > 12) {
index = 12;
} else {
index = countF9;
}
F9Concat = String.valueOf(index) + "|";
while (index >= i) {
F9Concat += decimalFormat(".00", Double.valueOf(map.get("!WITH_" + i + "_F9"))) + "|" + decimalFormat(".00", Double.valueOf(map.get("!DEP_" + i + "_F9"))) + "|" + decimalFormat(".00", Double.valueOf(map.get("!INT_" + i + "_F9"))) + "|" + decimalFormat(".00", Double.valueOf(map.get("!BAL_" + i + "_F9"))) + "|" + Integer.valueOf(map.get("!TELL_" + i + "_F9")) + "|" + Integer.valueOf(map.get("!DATE_" + i + "_F9")) + "|" + map.get("!TLPBB_" + i + "_F9").toString() + "|" + Integer.valueOf(map.get("!TLLIN_" + i + "_F9")) + "|";
i++;
}
return F9Concat;
}
String getMD5(String input) {
java.security.MessageDigest md = java.security.MessageDigest.getInstance("MD5");
byte[]messageDigest = md.digest(input.getBytes());
BigInteger number = new BigInteger(1, messageDigest);
String hashstr = number.toString(16);
while (hashstr.length() < 32) {
hashstr = "0" + hashstr;
}
return hashstr;
}
String sha1(String input) {
java.security.MessageDigest mDigest = java.security.MessageDigest.getInstance("SHA1");
byte[]result = mDigest.digest(input.getBytes());
StringBuffer sb = new StringBuffer();
for (int i = 0; i < result.length; i++) {
sb.append(Integer.toString((result[i] & 0xff) + 0x100, 16).substring(1));
}
return sb.toString();
}
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}'' AND TYPE = ''port''
${v.server}
${v.id}
${v.timestamp}
${v.group}
${v.asynchronous}
${v.port}
${v.close_queue}
${v.name}
${v.value}
${v.id}
/*/codex[@id=''${v.codex_id}'']
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}'' AND TYPE = ''codex''
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}'' AND TYPE = ''port''
${v.id}
${v.adaptor_id}
${v.timestamp}
${v.node}
${v.asynchronous}
${v.keep_conn}
${v.reuse_delay}
${v.idle_wait}
${v.close_queue}
${v.control_queue}
${v.name}
${v.value}
${v.id}|${v.seq}
${v.weight}
${v.host}
${v.id}
/*/codex[@id=''${v.codex_id}'']
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}'' AND TYPE = ''codex''
${v.id}
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}'' AND TYPE = ''parser''
${v.id}
/*/codex[@id=''${v.codex_id}'']
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}'' AND TYPE = ''codex''
${v.id}
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}'' AND TYPE = ''db''
${v.driver}
${v.url}
${v.username}
${v.password}
${v.schema}
${v.timeout}
${v.id}
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}'' AND TYPE = ''db''
${v.query}
${v.channel}|${v.code_start}|${v.code_end}
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}'' AND TYPE = ''routing''
${v.code_start}
${v.code_end}
${v.channel}
${v.start_date}
${v.end_date}
${v.subcodex}
${v.queue}
${v.status}
${v.additional}
${v.reply_to}
${v.reply_to_qmgr}
${v.id}
${v.module}
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}'' AND TYPE = ''mapping''
${v.description}
${v.id}
${v.include_mapping_id}
${v.include_id}
${v.source}
${v.target}
${v.name}
${v.seq}
${v.text}
${v.id}
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}'' AND TYPE = ''rpg''
${v.host}
${v.username}
${v.password}
${v.context}
${v.id}
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}'' AND TYPE = ''rpg''
${v.cmd}
${v.timeout}
${v.host}
${v.username}
${v.password}
${v.context}
${v.name}
${v.type}
${v.length}
${v.id}
${v.allow_partial}
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}'' AND TYPE = ''codex''
${v.xml}
${v.group}|${v.path}
${v.module}
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}'' AND TYPE = ''param''
${v.group}
${v.path}
${v.value}
${v.name}
${v.value}
charge_name_1
${v.c1_name}
charge_value_1
${v.c1_value}
charge_script_1
${v.c1_script}
charge_account_1
${v.c1_account}
charge_name_2
${v.c2_name}
charge_value_2
${v.c2_value}
charge_script_2
${v.c2_script}
charge_account_2
${v.c2_account}
charge_name_3
${v.c3_name}
charge_value_3
${v.c3_value}
charge_script_3
${v.c3_script}
charge_account_3
${v.c3_account}
charge_name_4
${v.c4_name}
charge_value_4
${v.c4_value}
charge_script_4
${v.c4_script}
charge_account_4
${v.c4_account}
charge_name_5
${v.c5_name}
charge_value_5
${v.c5_value}
charge_script_5
${v.c5_script}
charge_account_5
${v.c5_account}
charge_name_6
${v.c6_name}
charge_value_6
${v.c6_value}
${v.group}|${v.name}
${v.seq}
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}'' AND TYPE = ''param''
${v.group}
${v.name}
${v.value}
device_teller_map|${v.group}_${v.device_id}
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}'' AND TYPE = ''param''
device_teller_map
${v.group}_${v.device_id}
${v.teller_id}|${v.terminal_id}|${v.ctrl_unit_id}|${v.terminal_ip}
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}'' AND TYPE = ''param''
error_map|${v.group}|${v.original}
error_map|${v.group}
${v.original}
${v.target}
SELECT MAX(TIMESTAMP) FROM ${schema}.RELOADTS WHERE BROKER = ''${broker}'' AND EXECUTIONGROUP = ''${executionGroup}'' AND TYPE = ''param''
error_map_detail|${v.group}|${v.original}
error_map_detail|${v.group}
${v.original}
${v.detail}
', CURRENT USER, CURRENT TIMESTAMP)~
INSERT INTO MWCONFIG.CODEX (ID, XML, MODIFIED_BY, TIMESTAMP)
VALUES ('dsp-abcs-response', '
dsp-abcs-response
${dtree("DSPRESP-CODE", "dspScenarioNumber")}
${dtree("DSPRESP-CODE", "dspScenarioNumber")}
${ def l1 = [], l2 = [], l3 = [];
def m1 = msg.abcsResponses; m1.split("\\s").each { v -> l1.add(v) };
def m2 = msg.msgCode; getParamValue("core-response-ok", m2, "999").split("\\s").each { v -> l2.add(v) };
def m3 = "41 42 43 44"; m3.split("\\s").each { v -> l3.add(v) }
return l1.containsAll(l2) ? "000" : (l3.containsAll(l1) ? (msg.abcsResponses) : (msg.TLBERR_F2 != null ? msg.TLBERR_F2.padLeft(3,"0") : "999")) }
${msg.TLBERR_F2 != null ? msg.TLBERR_F2.padLeft(3,"0") : "000"}
', CURRENT USER, CURRENT TIMESTAMP)~