Hi ,
Can anyone help me to create a workflow having External Task to initiate an exe or java class before submitting the files.
Thanks,
Hi Ghoti,
I thought this as open form , thats why writing my queries.
Anyways I have created the workflow with Exteranal task.
In the workflwo I want to run an exe which will merge some json files. I have used external task for the same.
I havnt used External task before; so just want to know that which query will execute my exe in command-script.
Like for IPL we use:
$IW_HOME/iw-perl/bin/iwperl $IW_HOME/custom/bin/scripts/mergejson.ipl
Thanks again!!!
You formulated your query better this time - before you were basically asking for someone to do work for you for free.
Generally - if it's an exe - you should be able to just write the path to the EXE - e.g.: c:/****/yyy/zzz.exe
However, unless you actually wrote the EXE and provided it with the ability to perform callbacks - you don't want to call the EXE directly from the workflow externaltask - instead you want to call a wrapper (perl, batch, whatever) - that calls the EXE and then performs a callback to the workflow to let it know that the task has completed and that it can transition.
The alternative would be to call the EXE directly but have a timeout specification on the task that forces the workflow to transition to the next task automatically after some elapsed time - but that would mean that you are not checking the results / exit code of the EXE and just blindly transitioning as-if it was successful (not a very good practice in most cases)
Can you guide me to make the perl batch or any example for help or if I will opt for some elapsed time option how can I apply that ?
Thanks a lot!!!
Badli15 wrote: Hi , Can you guide me to make the perl batch or any example for help or if I will opt for some elapsed time option how can I apply that ?
For running batch scripts from the Perl script - I'd play around with it a bit - you might be able to just execute the batch script directly or you might have to run it through cmd -c "...", in both cases via something like qx() or system().
I don't know what you need "elapsed time" for - you can always put a sleep(integer) call into the code if you want it to delay for some reason, but you shouldn't have to do so as near as I can tell from your description thus far, unless startdeploy.bat forks, in which case you could loop through calls to iwodserverstatus (with a sleep(integer) spec in the loop) to wait until there are no running deployments before initiating the script.
Hi,
Thanks Ghoti for the guidance. I am able to create an External Task using ipl file and its working fine for me.
But still I am struck with callback issue. Since I havnt done any code for callback thus I can see my task in workflow tab.
My ipl:
#!/vol01/interwoven/TeamSite/iw-perl/bin/iwperl -w#-----------------------------------------------------------------------------use strict; # Try to catch errors as early as possible.eval {main();};#---------------------------------------------------------------------# main# Do whatever processing this program is expected to perform# and then activate the task callback.# ARGUMENTS# @args - The program's command-line arguments.# RETURNS# Nothing.#---------------------------------------------------------------------sub main{ my @args = ("java", "-jar", "/xyz/merge.jar"); system(@args);}When ever I am trying to use use
TeamSite::WFtask;use TeamSite::WFworkflow;
its showing error :
Can't locate TeamSite/WFtask.pm in @INC (@INC contains: /usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib /usr/perl5/site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int /usr/perl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl .) at test.ipl line 7.
Can you please help me out with this.
Thanks a ton for the help
You may have specified iwperl in the #! line of the script - but how are you specifying the script in the <command> (wft) or Command: (wfm) property of the workflow?
Based on the error you showed, my guess is that you are prefacing the name of the script with an explicit reference to a different version of Perl on the system (like /usr/bin/perl) - and thus it isn't finding the modules that are on iwperl's built-in @INC path.
Either don't preface the script name that way in the Workflow, or add the explicit paths for the TeamSite perl directories to the @INC path within your script (I prefer the former) - the script itself should be executable, so you should not need to preface it with anything.
Thanks for the reply
This is the script I have written in command in WFM and its showing the above mentioned error.
"$IW_HOME/iw-perl/bin/iwperl $IW_HOME/local/bin/test.ipl"
Thanks!!!!
Badli15 wrote: Thanks for the reply This is the script I have written in command in WFM and its showing the above mentioned error. "$IW_HOME/iw-perl/bin/iwperl $IW_HOME/local/bin/test.ipl" Thanks!!!!
That doesn't make sense unless someone symlink'd $IW_HOME/iw-perl/bin/iwperl to /usr/bin/perl (or some other perl engine) - try getting rid of the $IW_HOME/iw-perl/bin/iwperl, from the command, entirely and see if that makes any difference.
Also verify /bin/ls -l $IW_HOME/iw-perl/bin/iwperl is what it should be.