Plus, you can map out to the
entryRawData parameter when this component is used in a Connector Loop, letting you use multiple Parsers on the same bytestream.Very handy indeed!
entryRawData parameter when this component is used in a Connector Loop, letting you use multiple Parsers on the same bytestream.[TDI Installation Folder]/jars sub-directory; or 2) leaving these files where they are and instead telling TDI where to find them.com.ibm.di.loader.userjars property found near the top of the solution.properties file which is located in your Solution Directory.com.ibm.di.loader.userjars=C:\Notes;CustomJars;C:\Drivers\jdbcDrv.jar
ibmditk and ibmdisrv files to include additional folders*.
function logerror(msg) {
task.logmsg("ERROR", "@@ERROR - " + msg);
task.logmsg("ERROR", "@@ AL[Component]: " + task.getShortName()
+ "[" + error.getString("connectorname") + "]");
task.logmsg("ERROR", "@@ Operation: " + error.getString("operation"));
task.logmsg("ERROR", "@@ Message: " + error.getString("message"));
task.logmsg("ERROR", "@@ Exception: " + error.getString("exception"));
}
work and conn. Unfortunately, the dumpEntry() call does not let you set the log level. So I made my own:
function attList( e ) {
if (typeof(e) == "undefined" || !e)
return;
var attnames = e.getAttributeNames();
java.util.Arrays.sort(attnames);
var str = "";
for (var name in attnames) {
var att = e.getAttribute(name);
str += "@@ " + name + ": ";
for (var i = 0; i < att.size(); i++)
str += att.getValue(i) + " | ";
str = str.substring(0, str.length-3) + "\n";
}
return str;
}
function dumpEntry( logLevel, e, name ) {
if (typeof(e) == "undefined" || !e)
return;
task.logmsg(logLevel, "\n@@ ******** Entry Dump: " + name + " ********\n"
+ attList( e )
+ "@@ ***************************************\n")
}
function logerror( msg ) {
task.logmsg("ERROR", "@@ **** ERROR - " + msg);
task.logmsg("ERROR", "@@ AL[Component]: " + task.getShortName()
+ "[" + thisConnector.getName() + "]");
logval("operation");
logval("message");
logval("exception");
if (typeof(work) != "undefined" && work)
dumpEntry("ERROR", work, "Work");
if (typeof(conn) != "undefined" && conn)
dumpEntry("ERROR", conn, "Conn");
if (typeof(current) != "undefined" && current)
dumpEntry("ERROR", current, "Current");
}
java.lang.System.out.println() to print messages to the command window where the TDI Server was started from.
try {
makeSomeCall(); // if this fails, catch below
} catch (exc) {
task.logmsg("@@ Error: " + exc);
}
if (error.getString("status") != "ok")
task.shutdown(); // Invokes AL Shutdown Request Hook
My issue with scripting was that JavaScript code is "opaque" in TDI; there is no Hook flow through it, making it harder to troubleshoot and test. Furthermore, hiding code away in Hooks doesn't help AL legibility. More importantly, new TDI users often had no previous scripting experience.Stop AL On Error.work and conn, inspect script variables, call any functions and just generally ensure the sanity of my AssemblyLine logic and the health of the data it's working with.After GetNext Hook and then told the Attribute value in question to tell me its Java class name:rev = conn.getObject("$Revisions"); task.logmsg(rev.getClass().getName()) Which I then looked it up in some Domino Java Classes documentation that Ken Lin pointed me at (thanks again, Ken). I also used system.dumpJavaClass(rev.getClass().getName()) to quickly get the list of publicly available methods:[1:29:46 PM CEDT] E: system.dumpJavaClass(work.getObject("$Revisions".getClass().getName()) -> trueBingo! I could create a
CTGDIS827I Class name: lotus.domino.cso.DateTime.
getDateTimeData ();
setJavaDate (java.util.Date);
setJavaDate (java.util.Calendar);
makeRDate ();
doAdjust (int, int, boolean);
getRDateTime ();
markInvalid ();
getParent ();
toJavaDate ();
...
java.util.Date object by simply calling the Domino DateTime's toJavaDate() method.new java.sql.Timestamp(rev.toJavaDate().getTime())Armed with Google in the one hand and my Norwegian Army Knife in the other, I happily whittled away at the solution, learning and correcting its design as I go.
e = getNextEntry(); task.dumpEntry(e);You'd be surprise how much code you can squeeze into a single line :).
atts=work.getAttributeNames(); java.util.Arrays.sort(atts); for (a in atts) task.logmsg(a)TDI jockey Jon Elwood is currently building an AJAX interace to launch and monitor the progress of his AssemblyLines. You can imagine how handy the Debugger is for examining the incoming HTTP requests and interactively testing out return snippets of XHTML (or XML/JSON) by simply setting the value of the
http.body Attribute before End-of-Flow. Jon will be publishing a HowTo write-up on this that I am looking forward to.
. . .
rem Only set TDI_SOLDIR if it hasn't been set already in caller's shell
if .%TDI_SOLDIR%==. (
set TDI_SOLDIR="C:\Documents and Settings\\My Documents\TDI"
)
call "C:\Program Files\IBM\TDI\V6.1.1_GA\ibmdicwd" %TDI_SOLDIR%
. . .
ibmdisrv -c ITIL.xml -r Omnibus_2_TSRM, TSRM_2_Omnibus -s d:\ISM\