cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Event context

nmilleson
17-Peridot

Event context

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.

3 REPLIES 3
mnarang
17-Peridot
(To:nmilleson)

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?

 

 

 

nmilleson
17-Peridot
(To:mnarang)

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

mnarang
17-Peridot
(To:nmilleson)

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.

Top Tags