Skip to main content
17-Peridot
March 10, 2021
Question

Event context

  • March 10, 2021
  • 1 reply
  • 1779 views

Is there any way to access the event context that triggered a service in the mashup builder?  For instance, if I have a service that runs on mashup load and also on the change of a session variable, I'd like to know, in the service, which event triggered it (something like event.source or similar).  I know I can probably get to this by using expressions and an event router but that gets cumbersome over many mashups and it's tedious to scale it if I keep adding events that trigger a given service.

1 reply

5-Regular Member
March 10, 2021

You want to see the context while you view the mashup? Not sure if this can help but did you try to use start trace->reload the mashup and then->stop trace from mashup show/hide debug info tab?

 

 

 

nmilleson17-PeridotAuthor
17-Peridot
March 10, 2021

@mnarang ,

 

Thanks for the quick reply.  I want to have access to the event context inside a service that I trigger.  For instance, if I have a service that returns some data, I want to be able to do something like this:

 

if(event.source == "MashupLoaded"){
//return this data
} else {
//return that data
}

 

Just some way to access which event triggered the service, inside the service that was triggered. 

5-Regular Member
March 12, 2021

well AFAIK there is no OOTB way to capture the event which triggered the service in the service code itself. do you have many instances like this in your use case? was just wondering why we can't have two flavors of service, one execute on mashup load and other of another event, although if you have many instances like this then it will increase the service execution overhead in the mashup. Let's see if anyone else in the community have better/direct approach for this.