cancel
Showing results for 
Search instead for 
Did you mean: 

Build Process Automation Control Condition Comparison

08-30-2023 6:33 PM
bryan_sippel3 Explorer
1124 views 1 comments
0 Likes
SAP Managed Tags
Subscribe

I have been asked to explore Build Process Automation to develop some proof of concept projects.

I am vaguely familiar with JavaScript, but still learning.

My initial test is using agent version 3.16 and is intended to delete files from a file server folder older than a specified date.

I am using Get File Collection to retrieve the files, For Each to loop through each one, and Get Information to examine the last modified date/time (mtime) for comparison against my as-of deletion date.

(Steps 7 and 8 are just Log messages so I can see values while debugging)

Here is the problem: In order to only delete older files and skip newer files, I am trying to use the Condition control with this comparison (as recommended by one of the tutorials I reviewed).

When I use ==, !==, or ===, and press the Test button, the status shows Green, but whenever I use <, >, <=, or >=, the status shows Red producing an error condition that causes the process to fail.

Any thoughts, suggestions, or recommendations would be greatly appreciated.

Thanks

0 Likes

Accepted Solutions (0)

Answers (1)

Answers (1)

bryan_sippel3
Explorer
0 Likes

I worked around the issue by moving the comparison out of the Condition into a Custom Script that set a flag.

I then changed the Condition to compare the flag == "X", which evaluated to True or False.

Not sure why I had to do that since the tutorial examples showed I could compare numeric values to some limit (e.g., Step5.total < 1000), which would evaluate to True or False.

Curious why my comparison of two variables was invalid (Step6.returnedValues < Step2.deletionDate) when the comparison of a value with a literal is valid.

Thanks anyway 🙂