OL Learn

Create Job returns no content items - how to conditionally handle in Workflow

I have a workflow with a Create Job task. Sometimes there will be nothing for that task to produce, which causes it to error. As far as I can tell there isn’t a way to check prior to running the Create Job task.

Is there a way to check if there is anything to produce prior to running the task? I don’t want to assume that if there is an error it is because of no output and miss other errors.

Hi Nick,

You need to use the plugins On Error settings for this “error”. I do this when no multi paged records are found. (I usually move multi paged records to their own PDF) So in the Properties-On Error of the Create Job plugin you set Action to Default, tick the Log Message checkbox, Add a meaningful message (In my case “No multi’s found in job x”), give the ID a number for this error (I use the same ID every time any process has a no multi found custom error), then store the ID in a job info or custom local variable and hit ok. Then after the Create Job plugin add a Text Condition plugin. In its properties set the String to the job info or variable you used in the On Error of the Create Job plugin, Operator to “is equal to” and the Compare to String to that ID you used in the Create Job On Error and hit ok. This creates a branch which you add the delete plugin too.

This will then delete the file that is not needed and add a custom error to the Workflow logs or continue if the Cretate Job actually creates something usable.