cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Java Event

Former Member
0 Kudos

We are trying to create a Java event that runs after a report is scheduled (or published). 

I'm basing a few assumptions from articles, so I would like some feedback on the feasibility of the approach.  I can create a Program File like discussed here:

I can create a custom Event based on a Program File, like discussed here:

I'm assuming that the program file will receive the DocID as a parameter, based on the example of IProgramBaseEx here:

(see thisPOInfoObject)

So, user creates a webi document of reports, schedules the document to run nightly, adds the custom event, and in the java code, we get access to the docID for processing.  Is this possible?

This is BO 4.1 sp6.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Yes, you can create schedule events which can trigger other objects on success, failure. The object in your case would be your java program object(program file).

I did not get your last question though, can you please elaborate.

So, user creates a webi document of reports, schedules the document to run nightly, adds the custom event, and in the java code, we get access to the docID for processing.  Is this possible?


Which docID you want, are you referring to the schedule report instance id?

The java program file can take any number of parameters as an argument. The arguments are passed from the Program file properties in CMC.


Thanks,

Prithvi

Former Member
0 Kudos

Prithvi,

Thank you for the response.  I think I see how it is supposed to work.

I create a new event "ReportFinished," and that to the "Events to trigger on completion:" of the document schedule.  Then I add the same event to my Program File object in the "Events to wait for:."  That makes sense! 

However, my question still remains regarding the DocID.  In the program file, you have the following function:

public void run(IEnterpriseSession boSession, IInfoStore infoStore,

          IInfoObject thisPOInfoObject, String thisPOInstanceID,

          String[] args)

So, when the event fires, will it pass the ID of the document that triggered the event?  Or possibly the Event ID, so I can trace back to the document?

Thanks again,

Darin

Former Member
0 Kudos

Also, you mentioned passing the arguments in CMC.  I want to create a generic Event and Program File for all documents, so passing the document ID as an argument would not be practical.  I want to be able to get back to the Document without user intervention.

Thanks,

Darin

Former Member
0 Kudos

You don't have to provide a doc id in the run method. The method takes below parameters

void run(IEnterpriseSession enterpriseSession, IInfoStore infoStore, java.lang.String[] args) throws SDKException

This method gets called by the backend to run the Java program.

Parameters:
enterpriseSession - A valid IEnterpriseSession object.
infoStore - A valid IInfoStore object.
args - A String[] array specifying any relevant arguments that need have been set for this program to run.
Throws:
SDKException - Throws an exception if the process is unsuccessful.



The same can be found from the api reference guide available at

http://help.sap.com/businessobject/product_guides/sbo41/en/sbo41sp6_bipjava_apiRef_en.zip

Thanks,

Prithvi

Former Member
0 Kudos

I understand that I could add the docID to the arguments section of the Program File.  However, I have hundreds of documents which run at different frequencies.  We would like to run a process after each document executes which updates a database with the DocID that has completed.  As far as I can tell, the only way to do this is to create a program file for each document, with the DocID specified?  This isn't a scalable solution, as we have new reports every week.  We would have much preferred being able to determine the lineage to the doc - program file instance (passed by thisPOInfoObject) -> program file -> event -> documentID.  Is this possible?

Without some way to get back to the docID, the only thing I can think of is to use auditing, as I also have the sessionID, but I am not sure about the feasibility of this approach.

Former Member
0 Kudos

Whelp.. looks like I am out of luck:

I will still poke around in the auditing to see if I can work my way back that way, but it looks like my initial approach will not work.

Answers (0)