08-07-2017 07:12 AM
When writing expression it would be useful to know, in some cases, whether or not the context is in validation mode or not.
A specific example is when paging in a REST Get Snap: when in validation mode you will get errors about “slot allocation” when the paging exceeds 50 items.
You can put a guard in the “Has next” expression to cut off the paging if the item count is going to exceed 50, but then you have to figure out a way to prevent that guard from interfering when executing the pipeline.
So a simple expression language query would allow you to write something like:
(isValidating() ? (parseInt($.Response['@EndNum']) < 50 : true) && someMethodOfDeterminingHasNext()
OR perhaps there is a better way of accomplishing the same.
Thanks,
TK
08-08-2017 10:43 AM
+1 for the Feature Request. I’ve run into multiple cases where this would be very helpful.
@tk42, Until the feature is added, one potential solution might be to include a pipeline parameter called isValidating that you could set as true in design time but set as false in the task scheduler.
08-08-2017 10:52 AM
You can test for validation mode using the following variable:
pipe.flags.is_suggest
08-08-2017 01:14 PM
Thanks @tstack for bringing that option up. pipe.flags does not appear to be documented specifically in the SnapLogic documentation (although it is documented by vague reference when I search the documentation), So I wasn’t aware of it’s availability nor usage. I’ve passed this along to my team with thumbs-up responses by the team.
08-08-2017 01:29 PM
This looks a like a good option. I am a little concerned about it’s “undocumented” status, Perhaps that could be wrapped in a function so that we might be insulated from that flag being deprecated in the future.
Thanks much for the information @tstack
-TK