This topic contains 3 replies, has 0 voices, and was last updated by chanarbon 7 years, 10 months ago.
-
AuthorPosts
-
December 29, 2016 at 5:50 pm #1369
CREECEI want to be able to detect where the script triggered from so that I can ignore some script parameters. I am using runtime.executionContext which according to the doc returns a runtime.ContextType that represents what triggered the current script. When I log out the runtime.executionContext in my Map/Reduce, i get “MAPREDUCE”. This isn’t even in the runtime.ContextType object (see below for object details). Is there an issue with this currently? Is there something else I should be using to detect if my map/reduce was triggered from the user interface?
runtime.ContextType log:
Code:
{
“USER_INTERFACE”:”USERINTERFACE”,
“WEBSERVICES”:”WEBSERVICES”,
“WEBSTORE”:”WEBSTORE”,
“PORTLET”:”PORTLET”,
“SCHEDULED”:”SCHEDULED”,
“SUITELET”:”SUITELET”,
“CSV_IMPORT”:”CSVIMPORT”,
“CUSTOM_MASSUPDATE”:”CUSTOMMASSUPDATE”,
“WORKFLOW”:”WORKFLOW”,
“USEREVENT”:”USEREVENT”,
“ACTION”:”ACTION”,
“DEBUGGER”:”DEBUGGER”,
“CLIENT”:”CLIENT”,
“BUNDLE_INSTALLATION”:”BUNDLE_INSTALLATION”,
“RESTLET”:”RESTLET”,
“WEBAPPLICATION”:”WEBAPPLICATION”,
“PAYMENTGATEWAY”:”PAYMENTGATEWAY”,
“CONSOLRATEADJUSTOR”:”CONSOLRATEADJUSTOR”,
“PROMOTIONS”:”PROMOTIONS”,
“CUSTOMGLLINES”:”CUSTOMGLLINES”,
“TAX_CALCULATION”:”TAXCALCULATION”,
“SHIPPING_PARTNERS”:”SHIPPINGPARTNERS”,
“EMAIL_CAPTURE”:”EMAILCAPTURE”
}
This is a cached copy. Click here to see the original post. -
December 30, 2016 at 2:28 pm #1370
chanarbonI actually tried to check it out through the context from the entry points as I am wondering whether it has an InvocationType similar to scheduled script but similarly, there is no invocation type on the context. Let’s just say that you could have another script parameter (possibly a checkbox) which a user could check or uncheck on the deployment level which represent whether the M/R script will be triggered using UI.
-
December 30, 2016 at 3:00 pm #1371
CREECEYeah that was my thought as well for the checkbox. That seems to be the only solution right now that I see. Thanks!
-
December 30, 2016 at 4:39 pm #1372
chanarbonHi Chris,
Also make sure to submit a support request so we can have an enhancement for this since it is a really good use case for checking the invocation type. Another solution that I am thinking is having a text field which detects invocation type by letters e.g. UI for user-interface, and OD for on demand which is triggered by task module. that way the map reduce scripts gets more dynamic.
-
AuthorPosts
You must be logged in to reply to this topic.