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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command Tasks and File Detection

Status
Not open for further replies.

glenpark

Programmer
Oct 6, 2006
21
US
I can't seem to find a similar situation on here so here I go. I'm running INFA 7.x on Linux and need to use a command task to detect a flat file before running a workflow. I can't use an event wait because the workflow needs to run whether the flat file is there or not. So basically when the workflow starts, the command task needs to look for the flat file, if it's there then do nothing. But if it's not there, I have to email someone.

I'm not sure if it works but if I run a command like "ls thisfile.txt" does it return any usable error code that can be utilized in the link logic (i.e. STATUS=0 or STATUS=1) or to that effect? That way I can put an email task object into the workflow and it can run only when needed...

Thanks for the help!
Glen
 
This should be fairly simple by using a decision task. Look in the Powercenter help on the Workflow manager and you'll get the idea.

The trick is to start with a workflow as a wrapper, stuff the real workflow into a worklet and fire the worklet from the decision if conditions meet.

Ties Blom

 
Do I really need to use a decision task for this? What about putting the command into the command task "ls $sourcefiledir/filename.txt" Then in the following link, set "STATUS != 0" and an email task connected to it?

So it would look like this:

Command Task(command1='ls $sourcefiledir/filename.txt) ---STATUS!=0--->Email

That way an email would only be sent if the search for the file is unsuccessful and the logic all stays at the workflow level.
 
I am not suggesting that there is just one solution, but I prefer solutions that are transparent.
A decision task is a direct indication that you are applying logic within the workflow.

Ties Blom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top