Trigger Handler Service Input Parameter

I would like to use the same trigger handler service for multiple triggers that subscribe to the same published document. The small logic difference for each of the triggers can be driven by an input parameter.

Is there a way to provide an input parameter to the handler service that’s called from a trigger? If no, then is there an API call to find out the name of the calling trigger? My last resort is to create wrapper handler services for each of the triggers.


I’m not sure I fully understand your question. It appears that you want to use a single service that is invoked by multiple triggers each of which is subscribes to the same publishable document.

I’m not clear on why you have multple triggers that subscribe to the same document. Seems like you could do this with a single trigger, but that’s a different topic.

At any rate, since the same document type is used by each trigger, you will need to branch on one or more fields of data inside the document to use the same handling service. This logic probably duplicates some or all of the filter conditions that your triggers are using.



Strictly speaking, a trigger doesn’t “call” anything. A trigger is really just configuration data. IS “trigger execution” threads do the work under the covers. A document is retrieved from the document store (which is populated by document retrieval threads which get documents from the Broker, for example) and then matched with the appropriate trigger. The trigger config indicates which service to invoke.

AFAIK, there is nothing that indicates which trigger caused the service to be invoked, but I’m not sure. As Mark points out, presumably your existing trigger definitions use filters to get the docs of interest. Move this filtering logic to your uber service and you should be set.