Skip to main content
1-Visitor
July 12, 2016
Solved

Fire an event from a service

  • July 12, 2016
  • 4 replies
  • 3294 views

Hi!

How can i fire the event from inside the service code?

As an example: if validation fails inside the service i would like to fire an ValidationFails event.

Is this possible?

Thanks

Best answer by CarlesColl

About the Log, if you want to record debug type logs, you should activate Debug Log level:

Composer > Monitoring > Script

On the Log View Mashup

Logs > Settings  ( tab )

Inside settings tab:

Script Log --> New Settings = Debug

4 replies

1-Visitor
July 12, 2016

me.name_of_the_event(params);

rmórocz1-VisitorAuthor
1-Visitor
July 12, 2016

Hi Carles!

I have this in my code

(Test is an event)

Code of my test service:

var params = {

  Message: "Hello" /* STRING */,

};

me.Test(params);

And i have a subscription to this event (enabled). In the subscription i have this:

logger.debug(eventData.Message);

But "Hello" is still not showing in the script log.

What is missing?

1-Visitor
July 12, 2016

About the Log, if you want to record debug type logs, you should activate Debug Log level:

Composer > Monitoring > Script

On the Log View Mashup

Logs > Settings  ( tab )

Inside settings tab:

Script Log --> New Settings = Debug