EventIntrospectionApp.java
This sample code shows example introspection requests:
import java.util.LinkedList; import com.jdedwards.system.connector.dynamic.Connector; import com.jdedwards.system.connector.dynamic.newevents.EventService;
Sample Java Connector Events Introspection application.
public class EventIntrospectionApp {
public static void main(String[] args) {
try {
// Instantiate a Connector object
Connector con = Connector.getInstance();
// Login through the Connector
int sessionID = con.login("username", "password",
"environment", "role");
Get the list of all events in JD Edwards EnterpriseOne. This list is returned as a LinkedList of Strings.
LinkedList list = EventService.getEventList(sessionID);
Get the template for a particular event type. This is returned as an XML template in a single String object.
String template = EventService.getEventTemplate(sessionID, "category",
"type", "environment");
Get the list of all subscriptions for the user associated with the given sessionID. This is returned as a LinkedList of com.jdedwards.pt.e1.common.events.connectorsvc.Subscription objects. This Subscription class is located in the Common_JAR.jar file.
LinkedList subs = EventService.getSubscriptions(sessionID);
// Logoff the user from JD Edwards EnterpriseOne
con.logoff(sessionID);
// Shut the Connector down
con.shutDown();
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
System.exit(0);
}
}