Skip to Content
0
Former Member
Jun 26, 2009 at 08:04 PM

XI R2 WebI storage token management / webi.properties question - RWI 00323

44 Views

Hello,

I have a bit of Java code that is assigning prompt values, and after all values have been assigned I create a new instance of the webi report with using these values. This logic works OK, but in the process of setting my prompts I am really updating the default prompt values for the core report (which I'd like to avoid if possible...).

To avoid permanently updating the default prompt values, I am trying to:

1) open Webi

2) retrieve and store document storage token

3) assign all prompts (using ReportEngine)

4) schedule instance of report

5) retrieve original document storage token, and save using this token

I am receiving a RWI 00323 error when trying to save with the original token, and I understand this can be avoided by increasing the WID_STORAGE_TOKEN_STACK_SIZE value in the webi.properties file. I have updated this value (both to 40 and to 0 - unlimited?), re-started Tomcat and all BOXI services, but I still see the storage_token_stack_size = 10 in my program, and am still receiving the RWI 00323.

Any ideas? Sorry for the novel, just trying to thouroughly explain... Any help appreciated.

Here's some of my code:

doc = wiRepEngine.openDocument(reportIDInt); //open the report by SI_ID
                                System.out.println("ID: " + reportID + " found in BOXI.");

                                //get report storage token
                                String storageToken = doc.getStorageToken();

                                Properties documentProperties = doc.getProperties();
                                Prompts docPrompts = doc.getPrompts();
                                int numPrompts = docPrompts.getCount();
                                System.out.println("# prompts found in report:" + numPrompts);
                                int promptValuePosition = 0;

                                String tempStorageToken = null;

                                for (int i=0; i<numPrompts; i++)  //for each prompt in report  THIS PROCESS SETS DEFAULT VALUES FOR THE CORE REPORT
                                {
                                    Prompt prompt = docPrompts.getItem(i);

                                    //check for multiple prompt values
                                    String inputDelimiter = ";";

                                    if (inputPromptValuesArray[promptValuePosition].indexOf(inputDelimiter) != -1)  //if multiple values found in inputfile (a;b;c)
                                    {
                                        System.out.println("multi value prompt found");
                                        String [] multiValueArray = null;

                                        multiValueArray = inputPromptValuesArray[promptValuePosition].split(inputDelimiter);

                                        for(int e=0;e<multiValueArray.length;e++)
                                        {
                                            System.out.println("multi value array item: " + e + " is: " + multiValueArray[e]);

                                            String [] multipleValue = {multiValueArray[e]};
                                            prompt.enterValues(multipleValue);

                                            tempStorageToken = doc.getStorageToken();  //this changes as prompt values are applied
                                            System.out.println("temp storage token: " +tempStorageToken);
                                            System.out.println("B is token valid?" + wiRepEngine.isStorageTokenValid(tempStorageToken));

                                        }
                                        promptValuePosition++;  
                                    }
                                    else  //single value prompt
                                    {
                                        System.out.println("single value prompt found.");

                                        String [] singleValue = {inputPromptValuesArray[promptValuePosition]};
                                        System.out.println("single value: " + singleValue[0]);
                                        prompt.enterValues(singleValue);
                                        promptValuePosition++;
                                    }
                                }
                                doc.setPrompts();
                                doc.save();
                                doc.closeDocument();


                                //new prompt values have been set, now try to run the schedule the report now to create new instance 
                                IInfoObjects reportInfo = iStore.query("SELECT * FROM CI_INFOOBJECTS WHERE SI_KIND = 'Webi' AND SI_ID = " + reportID);
                                if (reportInfo.getResultSize() > 0) //result found in BOXI
                                {
                                    IInfoObject report = (IInfoObject) reportInfo.get(x);
                                    report.getSchedulingInfo().setType(0);
                                    IWebi webi = (IWebi) report;
                                    webi.schedule();  //push report instance to BOXI
                                    System.out.println("Report successfully scheduled.");
                                }

                                //now revert to the original webi document prior to any changes being made, and save
                                DocumentInstance webiOriginalState = wiRepEngine.getDocumentFromStorageToken(storageToken);

                                 System.out.println("storage token attempting to retrieve: " + storageToken);
                                 System.out.println("stack size : " + wiRepEngine.getStorageTokenStackSize());
                                 System.out.println("valid token? " + wiRepEngine.isStorageTokenValid(storageToken));
                                  DocumentInstance webiOriginalState = wiRepEngine.getDocumentFromStorageToken(storageToken); 
                                  
                                webiOriginalState.save();
                             }

Edited by: Brian Yaremych on Jun 26, 2009 10:05 PM