cancel
Showing results for 
Search instead for 
Did you mean: 

Add Custom Event to Publication - Java SDK

Former Member
0 Kudos

Hello Everyone,

I have created a Publication with couple of Crystal reports in it. I have created a Custom Event as well. How to I attach the Custom Event to the Publication via the Java SDK API calls similar to how it's done in the "Events" tab under "Publication --> Properties" via the GUI.

This is BO 3.1 using Enterprise Java SDK.

Thank you!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sandesh,

Use the following code snippet:

IInfoObjects oInfoObjects = (IInfoObjects)infoStore.query("SELECT * FROM CI_INFOOBJECTS WHERE SI_NAME='<publication name>' and si_recurring=1");
for(int i=0;i<oInfoObjects.size(); i++)
{
  IInfoObject oInfoObject = (IInfoObject) oInfoObjects.get(i);

// For events that this schedule waits for:
  oInfoObject.getSchedulingInfo().getDependencies().clear();
  oInfoObject.getSchedulingInfo().getDependencies().add(<new event SI_ID>);

// For events that this scheducle triggers

oInfoObject.getSchedulingInfo().getDependents().clear();
oInfoObject.getSchedulingInfo().getDependents().add(<new event SI_ID>);

}
infoStore.commit(oInfoObjects);

Hope it helps.

Regards,

Anchal

Former Member
0 Kudos

It works!! Thank you very much Anchal!

Quick question about the "si_recurring=1". If I am not having a "Recurring Schedule" defined for my publication then I believe I can exclude this condition?

Thanks again!

Former Member
0 Kudos

Yes, if you do not have a recurring publication instance then you can remove this portion in the query.

Regards,

Anchal

Answers (0)