โ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