on 10-14-2008 9:16 AM
hi,
I am new member of this community. I am very happy to be part of it. I am working in BO XI r2. I need to schedule some reports based on custom event and I need to trigger this event externally using some java application. Is it possible to trigger custom event using java code??
Need Help!.
Regards,
Yasar
hi Fritz,
Thanks for the reply. I have some questions regarding the code which you sent. In that code below
//Create the query to retrieve the all the events
String lQuery = "SELECT * " +
"FROM CI_SYSTEMOBJECTS " +
"WHERE SI_KIND = 'Event' " +
"ORDER BY SI_NAME";
the query is retrieving all the events, in that I want to trigger only the particular event which I am interested. For Ex I have created a event by name Test_custom in BO and I need to trigger only this event. how can I modify the query below??? and one more thing where can I find this table CI_SYSTEMOBJECTS in DB which contains info about the events?? I checked the Repository tables eight tables in DB, but i can't find this table. Need Help
Thanks & Regards,
yasar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Yasar,
The SYSTEMOBJECTS table does not exist in the CMS database as such, it is a virtual table which can only be queried through the Business Objects SDK.
You can find out how to use the BO Query Language here:
Developer Library home > BusinessObjects Enterprise SDK > Java developer guide > SDK Fundamentals > How do I use the query language to retrieve classes from the CMS repository?
http://devlibrary.businessobjects.com/BusinessObjectsXIR2/en/devsuite.htm
In this case, you would need to use a query such as the following:
"SELECT * FROM CI_SYSTEMOBJECTS WHERE SI_KIND = 'Event' AND SI_NAME='Test_custom'"
Cheers,
Fritz
Hi, here is a sample.
In future, please use for Java SDK related questions, you will get a quicker response here
import com.crystaldecisions.sdk.exception.SDKException;
import com.crystaldecisions.sdk.framework.CrystalEnterprise;
import com.crystaldecisions.sdk.framework.IEnterpriseSession;
import com.crystaldecisions.sdk.framework.ISessionMgr;
import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;
import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
import com.crystaldecisions.sdk.plugin.desktop.event.IEvent;
import com.crystaldecisions.sdk.plugin.desktop.event.IUserEvent;
public class triggerEvent {
public static void main(String[] args) {
String lUser = "administrator";
String lCMS = "servername";
String lPWD = "";
String lSecurity = "secEnterprise";
IEnterpriseSession lEnterpriseSession = null;
try {
//Retrieve the ISessionMgr object to perform the logon
ISessionMgr lSessionMgr = CrystalEnterprise.getSessionMgr();
//Logon to Enterprise
lEnterpriseSession = lSessionMgr.logon(lUser, lPWD, lCMS, lSecurity);
//Retrieve the InfoStore object from the Enterprise Session
IInfoStore lInfoStore = (IInfoStore)lEnterpriseSession.getService("", "InfoStore");
//Create the query to retrieve the all the events
String lQuery = "SELECT * " +
"FROM CI_SYSTEMOBJECTS " +
"WHERE SI_KIND = 'Event' " +
"ORDER BY SI_NAME";
IInfoObjects lInfoObjects = lInfoStore.query(lQuery);
//Display a message if no results were returned
if (lInfoObjects.isEmpty())
{
return;
}
//Go through each event returned and add it to the table
for (int lIdx = 0; lIdx < lInfoObjects.size(); lIdx++)
{
//Retrieve the current event object
IEvent oEvent = (IEvent)lInfoObjects.get(lIdx);
IUserEvent lUserEvent = (IUserEvent) oEvent.getEventInterface();
lUserEvent.trigger();
}
lInfoStore.commit(lInfoObjects);
} catch (SDKException e) {
e.printStackTrace();
} finally {
if (lEnterpriseSession!= null) {
lEnterpriseSession.logoff();
}
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.