Stop macro for error
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have a complex workflow within a batch macro which is set to loop for a set of files via an elementary workflow. I want the macro-ed workflow to terminate on hitting any error (be it of a non-fatal kind; I designed one using the Test Tool) for any file and the next file in the queue sent to the macro for fresh processing.
I had checked the "Cancel Running Workflow on Error" in the macro but defaulting files manage to run through the entire length of the macro despite returning errors (as ascertained from the message-box). Looking for suggestions on where I went wrong.
- Labels:
- Batch Macro
- Error Message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I had a similar question. Here is the link to my question and solution. Link
Here is another potential angle. . here by @MarqueeCrew
Ideally an output configuration would block all output until your defense has had a chance to review all conditions before it. I have a trick for that. I count my error records and use an append fields tool in front of a filter. Only zero defect data (all or none) can pass. If a single defect is encountered the filter passes no data. There are additional steps post the filter to cleanup and define the output.
And...CReW Macros includes the Blocking Test Tool that "tests an expression is true for all records in a data stream and if any are false does not pass any records downstream"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Neither does answer my question. To elucidate a bit more:
- Within the macro, it might happen that the outflow of a certain tool X has no records but only a header row. Such being the case, I want the workflow to stop further execution since there is little meaning in passing such a file through a series of data-processing tools.
- To do that, I connected X to a Block Until Done tool:
- Stream 1 was connected to a Count Records tool followed by a Test tool, set to "[Count]!=0".
- Stream 2 was connected to the rest of the workflow.
- If I run the macro itself with a defaulting file, checking the "Cancel Running Workflow on Error" flag, execution stops right after the error at Test Tool is encountered.
- This does not happen if the Macro is called from within another standard workflow.
