This topic contains 3 replies, has 0 voices, and was last updated by chanarbon 7 years, 10 months ago.

  • Author
    Posts
  • #1369

    CREECE

    I 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.

  • #1370

    chanarbon

    I 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.

  • #1371

    CREECE

    Yeah that was my thought as well for the checkbox. That seems to be the only solution right now that I see. Thanks!

  • #1372

    chanarbon

    Hi 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.

You must be logged in to reply to this topic.