You can add a condition that determines whether a step is executed in a task. For example:
AddConditionInStep.png (47.02 KiB) Viewed 2557 times
You will have to use a trigger which is fired beforehand to set the value of the @%numberFiles variables. If you unsure whether the files have been uploaded or not, you can use trigger code like this:
Code: Select all$caseId = @@APPLICATION;
$sql = "SELECT * FROM APP_DOCUMENT WHERE APP_UID='$caseId' AND APP_DOC_TYPE='INPUT' AND
APP_DOC_STATUS='ACTIVE'";
$aFiles = executeQuery($sql);
@%numberFiles = count($aFiles);
If you want to search for particular Input Documents, then use this trigger code:
Code: Select all$caseId = @@APPLICATION;
//set the IDs of Input Documents:
$inputDocs = "'6367801425ce612cf874c77005570234', '1969334975ce4b292c10685077270096', '4940937105ce4b2d3d315e2026819365'";
$sql = "SELECT DISTINCT DOC_UID, APP_DOC_UID, DOC_VERSION FROM APP_DOCUMENT
WHERE APP_UID='$caseId' AND APP_DOC_TYPE='INPUT' AND
APP_DOC_STATUS='ACTIVE' AND DOC_UID IN ($inputDocs) GROUP BY DOC_UID";
$aFiles = executeQuery($sql);
@%numberFiles = count($aFiles);