This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I have read the KB article about stopping a workflow on a condition. But, the example doesn't work for me. What I need to do seems simple. I want to look at a Windows folder. If there are files present then continue. If there are no files present, stop.
Here is a really simple workflow that seems to work. From the canvas you need to configure the runtime environment by checking the box next to "Cancel Running Workflow on Error".
The workflow process:
1) The Directory tool looks at c:\temp2 (change to whatever folder you need to examine)
2) The Count Records tool counts the results of the Directory tool and puts the value in a variable called Count.
3) The Block Until Done tool pauses processing and steps through the output anchors in order.
4) The Test tool is processed first as it is coming off the #1 output anchor of the Block Until Done Tool. The test anchor is configured to look if Count is >0. Note: Test Type is configured as "Expression is True for All Records" since only one record is returned for testing.
5) The process continues out of anchor #3 of the Block Until Done Tool. In this case to write a file to c:\temp3. This tool can be replaced by anything you want to continue your work flow.
Test the workflow by creating a Temp2 and Temp3 folder off of your c: drive. Then run the flow with temp2 empty. It should error out and nothing is written to temp3. Then, place any file in temp2 and run the flow. It should complete write a file to temp3. In production I replace writing the file in temp3 to a conditional runner to start a workflow.