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

Workflow Loop

Status
Not open for further replies.

JDAEMS

Programmer
Aug 27, 2003
84
BE
Dear Sir/Madam,

Is there a way to do the same workflows multiple times?

Let me explain in detail what I want: We have pharmeceutical studies in an XML format. These studies have to be uploaded into our datawarehouse. The list of studies that have to be uploaed are put in an oracle table as a kind of queue of studies to be processed.

For each study the XML must be processed. And this process is an entire workflow. So it has to run through this workflow for the first study, then it needs to go through it again for the next study, then again for the next study until there are no more studies in the queue table.

Is there any way to do that? How would you solve this? Is this possible?

Thank you very much for your reactions.
 
I have thought out this scenario, but is this possible?

There is a Pre-workflow whcih calls up a batch file that copies the first XML file to a certain placeand renames it data.xml

Then the mian workflow starts. First it checks if the file data.xml can be found?

If it can, then it executes the rest of the workflow (a lot of different sessions) and finally it will delete the data.xml file, check if there are nay other studies in the queue and copy the next xml file to data.xml.

A pmcmd is executed in the final step, which checks if a file can be found there? If not, stop workflow. If it can be found, stop workflow and restart the workflow.

Is something like this possible? If so, what do I need to do practically to accomplish this?
 
1. task that moves oldest xml file to a directory
2. task that renames the xml to data.xml
3. eventwait that watches the data.xml file.
4. execute the rest of workflow and set it to run continuously. (perhaps use a timer to stop it at a certain hour)
5. task that moves and renames the data.xml to a backup ditrectory. (this task is the last step in the workflow)

To be honest, the first step may be a tricky one..

Ties Blom

 
This is very messy to do strictly in PC and/or batch files. I just wrote a vb.net program to do similar functionality - download files from a ftp site and run the workflow for each file - either by changing the name of the session variable for the input file or processing the same file name one at a time (then archiving or deleting the file).

You can run the wf using the pmcmd command line program from a batch file or program or stored procedure. Maybe that's the easiest way to do it is by running an sp to get the files to process and batch commands to rename the file and run the pmcnd program, etc.

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
Is it possible to create a command task, which contains a DOS for loop function and in this loop you call a workflow using pmcmd?

Would this be something we can use?
 
Sure, but how will you get the file names out of the database?

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
If you are using PC version 8 you can use a java transformation. Source the table with the list of xml files then have the java transform read the xml file and spit out the content in a port.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top