I'm currently working with TS 6.7.2 SP2 + P1 on W2K3.
I have a Java class that I created for use in a WFM that implements the CSURLExternalTask interface and while I can run make_toolkit.ipl and then launch a workflow to test it - I'd like to find out how to run the same class / program from the command line.
I assume that I need to include something like the following in my .java file:
...
private static void main(String[] args) {
CSFactory factory = CSFactory.getFactory(null);
try {
CSClient client = factory.getClientForTrustedUser("DOMAIN\\userid", "master", null, null, "SERVER_NAME");
Hashtable myhash = new Hashtable();
CSTask task = client.getTask(new Integer(args[0]));
// call default constructor implicitly created, to get a handle on the class
MyClassname obj = new MyClassname();
// call the execute() method with the expected arguments - hopefully
obj.execute(client, (CSExternalTask)task, myhash);
} catch (CSException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
...
So, the first question is - does the above look about right? I am expecting to pass in a taskid from the command line, which should be all that I need to get the CSTask (CSExternalTask) object as long as a I have an authenticated CSClient object - right? And I believe those are the only two things I need to call the
execute method (I've yet to figure out what the hashtable is for and haven't bothered to look inside it to see if there's anything there)
Assuming that the above looks "about" right - the next question is - How do I invoke it from the command line?
If I build it with make_toolkit.ipl - the results will be stored somewhere within
.../content_center/customer_src/.../bin/...
or they'll also be in
.../content_center/customer_out/...
. The first path seems a little easier since I'll have a command prompt open and sitting in customer_src from which to run the make_toolkit.ipl command - so, for the sake of providing a use-case example:
I'm sure it's something simple that I'm doing wrong, but I haven't figured it out yet, so if someone can point me in the right direction I'd appreciate it.