How to check if the event was created

Hello everyone,

I am in the process of creating an event using the following code:

Event emailInfos := new Event;
emailInfos.params.add("message", emailText);
emailInfos.params.add("newAlarm", newAlarms);
emailInfos.params.add("childDeviceId", source);
send emailInfos to "emailServer";

After initiating this event, I would like to confirm its successful creation. Despite checking on the Events page, I am unable to locate it. Is there a way to obtain a return value or confirmation to ascertain whether the event was created successfully or not?

Thank you in advance for your assistance.

Hi Gabriele,

this just sends the event to the “emailServer” channel in Apama. If you want it stored in C8Y, you have to send it to the Event.SEND_CHANNEL channel.

Yes, then from another EPL I am trying to read the Event like this:

action onload {
		monitor.subscribe("emailServer");

		log ("Inside the email aggregator");

		on all Event(type="emailServer") as e {
			log "ME " + e.toString();
			collctedEmail.append(e);
		}
 }

But nothing is found, do you know why?

In the code above, you are not setting the “type” but here you are filtering on “type”. Maybe that is the issue?

What I want to do is listen for event “emailServer” only.
For some reason it can’t find it though.

ok, but type is not the same as channel. If you want to use that as a filter criterion, you also have to set it:

Event emailInfos := new Event;
emailInfos.type := "emailServer";
emailInfos.params.add("message", emailText);
emailInfos.params.add("newAlarm", newAlarms);
emailInfos.params.add("childDeviceId", source);
send emailInfos to "emailServer";