I have created a simple workflow that merges both the Checks for File on Guest and Deletes File on Guest canned workflow. I am inserting a decision element that I would liek to take the OUTPUT (exists boolean out-param) from the Set Result scriptable task within (from the Check for File on Guest) and bind it to the input of my decision. Essentially, if the exist parameter is true, it will excute the script to delete the file. However, I can not figure out how to bind the input of the decision to the output of SetResult. I am including a snippet showing the desired workflow. Also below is the script of SetResult that shows the exists out-param.
exists = false;
for (var i in result) {
var f = result[i];
System.log(">" + f.path + "<");
System.log(">" + path + "<");
System.log(f.path + " : " + f.type + " p:" + (f.path == path) + " f:" + (f.type == "file"));
if (f.path == path && f.type == "file") {
exists = true;
break;
}
}
You need to ensure that exists variable is mapped as a workflow attribute, not as workflow output when you setup/promote the bindings from 'Check for file in guest' workflow. Then, in your decision element, you will be able to bind the attribute directly.
On the other hand, on the shown schema I don't see how exactly you use 'Check for File in Guest' and 'Delete File in Guest' workflows, so I'm not sure if the exists variable you are referring to is the same exists which is output parameter of 'Check for File in Guest' workflow. But in any case, the decision element will allow you to use variables that are either input parameters or attributes, not output parameters.
I have something like this that runs multiple times a day. My workflow is actually looking for java dump files and if it finds the file it will delete. Looking at your picture I see one thing different than mine. The process error scripting task is what sets the value to false and you need to have the process error scriptable task connect to the decision or really you can get rid of the decision all together and just have the delete file workflow after the process error. The list path workflow will fail if the file is not found and the process error tasks sets the value to false.
Hope that helps
You have to edit your decision and bind it to the exists attribute, then tell it whether you want exists to be true or false.
You need to ensure that exists variable is mapped as a workflow attribute, not as workflow output when you setup/promote the bindings from 'Check for file in guest' workflow. Then, in your decision element, you will be able to bind the attribute directly.
On the other hand, on the shown schema I don't see how exactly you use 'Check for File in Guest' and 'Delete File in Guest' workflows, so I'm not sure if the exists variable you are referring to is the same exists which is output parameter of 'Check for File in Guest' workflow. But in any case, the decision element will allow you to use variables that are either input parameters or attributes, not output parameters.