Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to handle printer with Mercator

Status
Not open for further replies.

rspala

Programmer
Sep 25, 2003
2
US
Hi,

Problem Description:
I have a Mercator Map (mapA) which creates and executes a batch script which in turn triggers the printer. When the map is run, the printer is triggered and at the same time the files are copied in a folder(directory). The number of files can varies during each run. I have to execute another map (mapB) ONLY WHEN all the files are written to the folder. As of now, the mapB run simultaneously when the printer is triggered.

Question: How can I trigger the mapB when mapA finishes writing all the files to the folder.

Thanks,
Raja.
 
I have always found it a problem to run a batch file and then act upon the results within the same map.
The only way I have managed to get round it (vn6.5.2) was to have MapA run MapB in output card 1 which executes the batch script and in output card 2, run MapC which processed the result of the batch script.
The other alternative is to use the Event Server to trigger on the creation of the files produced by your batch script.
 
Hi,

I had already tried both the approaches you suggested.

I had MapA run MapB which executed the batch script in output card1 and run MapC in output card2. With this approach, the MapC (from card2) is triggered after MapB (from card1) but the files are in the process of being written to the folder while the MapC is already triggered.

So we tried the second approach, that of triggering MapC in the Event Server using time event which is not a good solution since we do not know how much time will be taken to write the files (number of files can vary or the printer may be slow). As per my knowledge the Event Server has time event and source. The source event cannot be used in this case because the source is variable i.e the number of files is uncertain.

Is there any other way out?

Thanks,
Raja.
 
You can use wild cards as the trigger for the event server. So if all your output files are written to a specific folder you can use *.* as the file name for the map trigger and this will run the map for every file created in the folder.
You can use the Poll adapter command for the batch adapter to check for the batch job finishing.

Poll Process (-P or -POLL)
Use the Poll Process adapter command (-P or -POLL) to specify the number of
times and frequency at which the adapter polls for process completion.
-POLL count:interval
Option Description
count The number of times to check for process completion.
interval The number of seconds to wait between each poll.
If the number of specified polling attempts is exhausted and the process has not
yet completed, the adapter will exit with the message Command Still Executing.
This is a warning for a target, but an error for a source.

However, I'm not sure how usefull this is.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top