I'm trying to schedule a WebI report and below is the code I'm using. What I'm unable to figure out is how to make this schedule Event based.
That is, I want the schedule to run when EVENT1 is triggered and then trigger EVENT2 after completion of the schedule. Can someone help me out with this?
Note : I know that PromptsUtil is deprecated but I'm on 3.1SP4 so it works and this is a temporary requirement.
IInfoStore iStore = (IInfoStore) eSession.getService("InfoStore");
ReportEngine reportEngine = (ReportEngine) eSession.getService("", "WebiReportEngine");
IInfoObjects objs = iStore.query("Select TOP 1 * From CI_INFOOBJECTS Where SI_KIND='Webi' and SI_CUID = 'some_CUID'");
IInfoObject obj = (IInfoObject)objs.get(0);
IWebi webi = (IWebi) objs.get(0);
DocumentInstance di = reportEngine.openDocument(webi.getID());
Prompts prompts = di.getPrompts();
Prompt prompt = prompts.getItem(0);
prompt.enterValues(new String[] { "some_text" });
PromptsUtil.populateWebiPrompts(prompts, webi);
webi.getWebiFormatOptions().setFormat(IWebiFormatOptions.CeWebiFormat.Webi);
ISchedulingInfo schedInfo = webi.getSchedulingInfo();
schedInfo.setRightNow(true);
schedInfo.setType(CeScheduleType.ONCE);
iStore.schedule(objs);Thanks a lot in advance! ![]()
-------------------------------------------------------------------------------------------
UPDATE :
-------------------------------------------------------------------------------------------
Never mind I figured it out.
Just needs to add below lines after fetching the SchedulingInfo object.
schedInfo.getDependencies().add(SI_ID of EVENT1);
schedInfo.getDependants().add(SI_ID of EVENT2);
Not deleting this post just in case someone else has the same doubt!