Hi ,
I am trying to create custom triggers and gone through pdf for the same. I have few doubts .
1-If I need to have trigger on dcr save or new file creation then how we hv to register iwatcreate in iwlocal.cfg.
2-How we can set env. variables for it that are req. before prog. execution.
Thanks
In general - you should ignore the iwat**** programs and just use iwat itself.
Read that part of the CLT manual and/or search for posts here and on the Support Site KB articles for more information.
The iwat trigger scripts get registered in the backing store and can then be viewed (iwlsat) and/or removed (iwrmat) if needed; but because they're registered in the backing store you don't have to worry about having them re-run anytime you reboot your server or restart the services.
Assuming you have a DEV box to work on, you can experiment and learn through trial-and-error how to write a [good] iwat script (I'd suggest a simple script that prints the elements in @ARGV and %ENV to a log file as the equivalent of a "hello world" for iwat)
Thanks for reply .So you are trying to suggest to create my own iwat ipl file.So how to register it iwlocal.cfg file and how we initialise env. variable for it .This thing is not much clear to me as in pdf nothing much is given and on devnet nothing detailed is being provided.
gauravTsDev wrote: Hi , Thanks for reply .So you are trying to suggest to create my own iwat ipl file.So how to register it iwlocal.cfg file and how we initialise env. variable for it .This thing is not much clear to me as in pdf nothing much is given and on devnet nothing detailed is being provided.
If you use iwat with your own IPL script - you do not need to register it in iwlocal.cfg - it gets registered automatically (via iwat) in the backing store.
Create a simple Perl script like:
#!/usr/Interwoven/TeamSite/iw-perl/bin/iwperl# SCRIPT: /usr/Interwoven/TeamSite/tmp/iwat_test.ipluse strict;use warnings;use TeamSite::Config;my $iwhome = TeamSite::Config::iwgethome();my $logfile = "$iwhome/tmp/iwat_test.log";open OUT, '>', $logfile || die "[w] '$logfile' ($!)";print OUT "===== ARGV =====\n";for(my $i = 0; $i < @ARGV; $i++) { print OUT "ARGV[$i]: '$ARGV[$i]'\n";}print "\n===== ENV =====\n";foreach my $e (sort keys %ENV) { print OUT "ENV: $e: '$ENV{$e}'\n";}close OUT;exit 0;
Then, go to the command line on the server and run:
% iwat CreateFSE /usr/Interwove/TeamSite/tmp/iwat_test.ipl
Then go into TeamSite (GUI) and create a file (DCR, plain file, whatever) and then look at the contents of /usr/Interwoven/TeamSite/tmp/iwat_test.log. From there you will hopefully be able to figure out what you need to do for your actual requirements.
NOTES:
I followed the same steps registered my script with iwat and can see it registered by checking it against iwlsat.But on dcr save no log is being created .How we can debug this ?
First look for the event in the iwevents log and trace log. It should be a CreateFSE
I think CreateFSE is only when an asset is first created (hence the name) - ModifyFSE would be the event to use for tiggering the script for (you guessed it, hopefully) when already existing assets are modified.
There's a list of the events in the CLT manual - but, as @nipper indicated, the best thing to do is perform the operation and then look at the end of the iwevents.log (if you don't have it running in a tail)