Trigger any event through custom plugin

We can trigger any event via  custom plugin code, you just have to invoke this custom plugin and it will automatically trigger the event that is used in this plugin. Below is the custom plug-in to trigger any event . Please replace the bold text below with the type of event and it's corresponding activity id at both the places:-

 

import javax.security.auth.Subject;
import com.adeptia.indigo.event.Event;
import com.adeptia.indigo.storage.Entity;
import com.adeptia.indigo.event.EventUtils;

Subject sub = service.getSubject();

System.out.println("*******************SSSSSSSSSSSSSSSs");

System.out.println("SUBJECT*********************:::"+sub);
Entity entity = EventUtils.getEntity("Type of Event:corresponding Event id",
sub);
System.out.println("entity name:::"+entity.getEntityName());
if (entity != null) {
Event event = ((Event) entity);
event.setTriggerNow("true");
event.setSubject(sub);
event.activate();
event.triggerEvent("Type of Event:corresponding Event id", sub);
}

Have more questions? Submit a request

1 Comments

  • 0
    Avatar
    David Paras

    To get the status of the Event you can use

    event.getActivateStatus()

    which will return true if the event is already activated and false if the method is deactivated.

     

Article is closed for comments.