Java Code to trigger Custom Based Event in BO XI Release

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, 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();

Similar Messages

  • Trigger Customer master event

    Hi All,
    Does anybody know how to trigger customer master event?
    because after customer has been created, i need to send out the idoc file to other system.
    I try to find out some business object to trigger event. it seems can't do.
    Please advise.
    Regards,
    Luke

    Hi,
    Don't try to make things too complicated. You don't possibly need any events, etc. And as far as I see this has not much to do with workflow.
    1) Use change pointers or
    2) use some customer exit to trigger the IDOC
    3) Google "site:sap.com customer IDOC" - you hardly are doing something that is not discussed before
    Regards,
    Karri

  • To trigger Time-based events upon user's click

    Hi,
    I have series of images to be pop up when the audio is played. However this is to be triggered when user clicks on a button.
    Please advise.
    Thank you.
    Irene

    Not sure that I understand your question correctly, but have a look at the example in this blog post: Blog after Posterous? - ClickClick - Captivate blog
    These would be my steps:
    for the introductory audio (before first click): add it as slide audio
    for the audio associated with an image: attach it as object audio to the image
    follow the work flow described in the blog post: whenever an image appears audio will play.
    There is one drawback: if the user clicks again before the audio clip ends on the previous image, both audio clips will play at the same time. To avoid that:
    don't attach the audio to the image but
    add the statement 'Play ....' to the (shared or advanced) action that is triggered by the click
    contrary to object audio, whenever this statement 'Play....' is executed, any previous audio will be stopped.
    More info: Audio Objects: Control them! - Captivate blog
    Lilybiri

  • ADF Faces: Making a selectOneChoice in java code?

    I need to make a selectOneChoice to reuse in my pages (country selection) but can't seem to find how to do it on the web?
    here is what i've attempted with the error output...
    -------------------- the java code:
    public void contextInitialized(ServletContextEvent event)
    ServletContext servletContext = event.getServletContext();
    Utils.log(servletContext, "Initializing Supply Chain Management System...");
    // intitilize selectOne component
    CoreSelectOneChoice countrySelectOne = new CoreSelectOneChoice();
    List countrySelectItems = new ArrayList();
    CountryCoordinator countryCoordinator = new CountryCoordinator();
    try
    List all = countryCoordinator.getAllCountries();
    Iterator i = all.iterator();
    for(;i.hasNext();)
    Object object = i.next();
    CoreSelectItem item = new CoreSelectItem();
    item.setValue((Country)object);
    item.setLabel(((Country)object).getCountry_name());
    countrySelectItems.add(item);
    // place the list of select items into the selectOne component
    countrySelectOne.setValue(countrySelectItems);
    servletContext.setAttribute("countrySelectOne", countrySelectOne);
    Utils.log(servletContext, "Initializing Countries [SUCCESS]");
    } catch(Exception e)
    Utils.log(servletContext, "Initializing Countries [FAILED]");
    Utils.log(servletContext, "Initialization complete...");
    ------------------------------ the JSP:
    <af:selectOneChoice label="#{bundle.ADDRESS_COUNTRY}:" required="#{region_entity_address.required_entity_address_country}" binding="#{applicationScope.countrySelectOne}"/>
    ------------------------------ the error:
    15:36:48,984 INFO [STDOUT] Sep 16, 2005 3:36:48 PM oracle.adfinternal.view.face
    s.renderkit.core.xhtml.SimpleSelectOneRenderer _getSelectedIndex
    WARNING: Could not find selected item matching value "CoreSelectItem[UINodeFaces
    Bean, id=null]" in CoreSelectOneChoice[UIXEditableFacesBeanImpl, id=_id30]
    ....

    That's right. JSF produces such IDs. They are causing problems with JAAS login forms, so we should use plain JSPs for login, but for the rest of the tasks such IDs are okay.
    What I meant is that currenty the buttons are not rendered as
    <input type="button" ... />but as pictures embedded in hyperlinks (&lt;a>).
    It's possible, though not likely, that in some future version of ADF Faces some component will be rendered as an HTML element that doesn't support tab ordering (although I haven't really considered if there are such elements). Then the trick with manually setting the tabIndex of the parent HTML element won't work.
    Of course, I deeply appreciate the fact that you take the time to help us on this forum. In fact, I will go ahead and do just that -- I will dynamically set the tabIndex via JavaScript. I was simply wanting to make sure that I wasn't taking such a hack-like approach, if there was a better method.
    Thank you again.
    Best regards,
    Bisser

  • Setting Windows Envirnoment variables within Java code!!

    Hello All,
    How to setup Windows envirnoment variables within Java code dynamically.
    int customer = jList1.getSelectedIndex();
    System.out.println(customer);
    switch (customer)
    case 0:
    System.out.println("HOME1");
    break;
    case 1:
    System.out.println("HOME2");
    break;
    case 2:
    System.out.println("HOME3");
    break;
    case 3:
    System.out.println("HOME4");
    break;
    default:
    System.out.println("HOME5");
    break;
    }

    set windows %HOME% variableWhat is it?
    A system-wide resource? Something pertinent to the processes of a given user? Or does it apply only to your Java process?

  • Class compiling/executing JAVA-Code??

    Hi!
    Stupid question: ;-)
    Is there a possibility to "parse" Java-Code into a JAVA-Class or to give JAVA-Code to a class that compiles the code and execute it?
    Thanks for answering!
    Mark Hauchwitz.

    background: we're running servlets and simply need to "parse" specialized/customized java-code for every customer into the servlet code. Source: database or whatever...
    How to get started?

  • FRM-40735: WHEN-CUSTOM-ITEM-EVENT trigger raised unhandled exception ORA-06502.

    Hi Expert,
    Forms Version : 11.1.2.1.0
    Client JRE : 1.6.0_45-b06 Java HotSpot(TM) Client VM
    Run webutil_demo form, http://host:9001/forms/frmservlet?form=webutil_demo.fmx&config=webutil
    it appears following error.
    FRM-40735: WHEN-CUSTOM-ITEM-EVENT trigger raised unhandled exception ORA-06502.
    No error logged in java console client side.
    I've try to re-compile webutil_demo.fmb
    Unattaching and then re-attaching the plsql library webutil.pll to forms using a 11g Forms Builder (instead of earlier version) and then loading the form to the server and compiling form but error still exist.
    Will you please help to give any suggestion?
    Is there any trace can be enabled to find some more details?

    Welcome to OTN
    Before posting on this forum please read
    FRM-40735: WHEN-CUSTOM-ITEM-EVENT trigger raised unhandled exception ORA-06502.
    you'll get some hint here
    Oracle/PLSQL: ORA-06502 Error

  • How to trigger tree table from java code

    Trying to trigger tree table from java code, using :
    AdfFacesContext.getCurrentInstance().addPartialTarget(treeTableComponent);
    But its not working. Am i using the correct approach?

    Sorry for the incomplete information,
    I have a tree table in a region and that region i am including inside a jspx file. In the region i have one popup and based on the input taken from the popup i want to trigger the table to show the data.
    For that i am trying :
    FacesContext context = FacesContext.getCurrentInstance();
    UIComponent component = findComponent( context.getViewRoot(),"treeTableID");
    if(component != null){
    AdfFacesContext.getCurrentInstance().addPartialTarget(component);
    public static UIComponent findComponent(UIComponent base, String id)
    if (id.equals(base.getId()))
    return base;
    UIComponent children = null;
    UIComponent result = null;
    Iterator childrens = base.getFacetsAndChildren();
    while (childrens.hasNext() && (result == null))
    children = (UIComponent) childrens.next();
    if (id.equals(children.getId()))
    result = children;
    break;
    result = findComponent(children, id);
    if (result != null)
    break;
    return result;
    Model is getting data before i use : AdfFacesContext.getCurrentInstance().addPartialTarget(component);
    But table is not calling getData() in model to show the populated data on UI.

  • Ttrigger Event Sub-Process from Java code.

    Hi All,
    Is there any way to trigger Event Sub-Process from Java code.
    My requirement is to trigger an Event SubProcess when a Approver clicks on REJECT button in HUMAN TASK.
    One way of achieving this is by placing a gateway after the human task and by validating the human task outcome and there by triggering a call to Event SubProcess.
    But we dont want to put a gateway after the human task. But instead we would like to trigger the Event SubProcess from the ADF task forms itself. ie, by calling a JavaCode.
    Please give me some pointers on achieving this task.
    Thanks
    Parker.

    Hi  jtahlborn, mohan
    yes the process is created from my java code. 
    in my code iam creating a process like below and if it is running for a long i need to kill it from java.
    For that " Runtime.getRuntime().exec("taskkill /F /PID " +  7408); " is working fine.
    7408 is my process id in taskmgr created from java and iam manually passing the PID it to kill it.
    But i need to get the PID from java code.
    Thanks for your suggestions.
    Sample Code:
    public static void main(String args[])
            try {
              Process process = Runtime.getRuntime().exec(new String[]{"cmd.exe","/c","start"});        
              Field f = process.getClass().getDeclaredField( "handle");
              f.setAccessible( true);         
              long procHandle = f.getLong( process);
              System.out.println( "prochandle: " + procHandle );
              //Runtime.getRuntime().exec("taskkill /F /PID " +  procHandle);
            } catch( Exception e) {
              e.printStackTrace();

  • FRM-40735 WHEN-CUSTOM-ITEM-EVENT trigger raised unhandled exception ORA-065

    Please help....This error is comming when opening the form. The form is running on oracle 11g 64bits web logic.
    "FRM-40735 WHEN-CUSTOM-ITEM-EVENT trigger raised unhandled exception ORA-065"

    Welcome to OTN
    Before posting on this forum please read
    FRM-40735: WHEN-CUSTOM-ITEM-EVENT trigger raised unhandled exception ORA-06502.
    you'll get some hint here
    Oracle/PLSQL: ORA-06502 Error

  • How to use a variable of jsp custom tag in my java code?

    hi folks,
    i got a folderList tag like this:
    ArrayList list = new ArrayList(20);
    %>
    <foo:folderList path="${attributes.newsPath}" var="year" contentType="folder">
    <%
              list.add(${year.contentEntryName});   // of course, this doesn't work
    %>
    </foo:folderList>I think, its clear what I want to do. I am just wondering how I can use my Variable "year" in the Java code between <% %>...

    <% list.add(year.getContentEntryName()); %>
    You have to have defined in the custom tag that "var" relates to a scripting variable that you want defined.
    <tag>
      <variable>
        <name-given>var</name-given>
        <variable-class>myPackage.myClass</variable-class>
        <declare>true</declare>
        <scope>NESTED</scope>
      </variable>
    </tag> Cheers,
    evnafets

  • Java code based on a javascript variable

    Hi,
    Based on click of a either linkA or linkB I set a javscript variable (say vA or vB).
    After this I reload the browser.
    My page on the browser in a jsp which gets texts from a properties file (say prop.properties).
    But now based on vA or vB I wish to load vAprop.properties or vBprop.properties.
    I know I cannot access javascript variables in Java code. Please let me know a work around for this.
    I need it very badly.
    Thanks in advance.

    Have your javaScript open the link with a parameter
    yourFile.jsp?param=A
    yourFile.jsp?param=B
    in your JSP do a
    request.getParameter("param");
    You can also use javaScript to post the values if you dont want them to appear in the URL.

  • [Best practice] How to call a service from custom Java code

    Hi all,
    I'm wondering what the best method is to call a standard service from custom Java code?
    In a specific situation iDoc script is extended with custom functions with a custom component. There's Java code mapping to these functions that is executing these functions. The iDoc script functions are called from a workflow entry script.
    In the Java code that runs when the custom iDoc functions are called, I want to call a standard Content Server service. I don't think that the m_service variable is available, so filling the binder and using m_service.executeService() probably isn't possible.
    Also, if it were possible (that is, if I want to call a standard service from my own custom service Java code), what would then be the best method to do so?
    Regards, Stijn

    Hi Sapan,
    Let me explain a bit further.
    I'm an UCM consultant trying to solve a problem that occured at a client when they installed the CS10gR35CoreUpdateBundle.
    Content items are entered into a Workflow when they are checked in. Part of one of the entry scripts of the a workflow step is that related content to the content item in the workflow is (re)submitted for conversion.
    To achive this, a custom component provides an iDoc script extension. This iDoc function (resubmitForConversion) is implemented in Java (the class extends ScriptExtensionsAdaptor).
    In this Java method, first the related content items are fetched. Then the service RESUBMIT_FOR_CONVERSION should be called for all dID's in of the related content.
    Thus, at a certain point in the custom Java code, a native Content Server service must be called. Of course the class of this Java code does not extend the Service class, so the m_service object isn't available.
    The thing is: before installed the 10gR35CoreUpdateBundle everything worked OK. This code was used to execute the service:
            Workspace workspace = CommonUtils.getSystemWorkspace();
            String cmd = binder.getLocal("IdcService");
            if (cmd == null) throw new DataException("!csIdcServiceMissing");
            ServiceData serviceData = ServiceManager.getFullService(cmd);
            if (serviceData == null) throw new DataException(LocaleUtils.encodeMessage("!csNoServiceDefined", null, cmd));
            Service service = ServiceManager.createService(serviceData.m_classID, workspace, null, binder, serviceData);
            UserData fullUserData = CommonUtils.getFullUserData(userName, service);
            service.setUserData(fullUserData);
            binder.m_environment.put("REMOTE_USER", userName);
            ServiceException error = null;
            try {
                service.setSendFlags(true, true);
                service.initDelegatedObjects();
                service.globalSecurityCheck();
                service.preActions();
                service.doActions();
                service.postActions();
                service.updateSubjectInformation(true);
                service.updateTopicInformation(binder);
            } catch (ServiceException e) {
                error = e;
            } finally {
                service.cleanUp(true);
                if (!CommonUtils.isWorkspaceConnectionInTransaction(workspace)) {
                     workspace.releaseConnection();
            }the first problem was that the CS began to complain that a transaction was started within another transaction. So I suspect that the 10gR35 update wrapped a transaction around a workflow script entry.
    With some decompiling I figured out how a service is called from iDoc with the <$executeService()$> command. So I replaced the code above with:
                  String cmd = binder.getLocal("IdcService");
                ServiceData serviceData = ServiceManager.getFullService(cmd);
                if (serviceData == null) throw new DataException(LocaleUtils.encodeMessage("!csNoServiceDefined", null, cmd));
                Workspace workspace = CommonUtils.getSystemWorkspace();
                Service service = ServiceManager.createService(serviceData.m_classID, workspace, null, binder, serviceData);
                UserData fullUserData = CommonUtils.getFullUserData(userName, service);
                service.setUserData(fullUserData);
                binder.m_environment.put("REMOTE_USER", userName);
                service.initDelegatedObjects();
                service.executeSafeServiceInNewContext(cmd, true);This solved the transaction problem but introduces another problem: !csUnableToResubmitItem,(null)!csIllegalScriptAccess,RESUBMIT_FOR_CONVERSION
    The Service Reference Guide says that the access level for RESUBMIT_FOR_CONVERION is 33 (Read, Scriptable). However, in shared/config/resources/std_services.htm the access level is specified as 2 (write).
    Thus, my question still is:
    What is the best method to call a standard Content Server service from any Java code (so without extending the Service class, or having the m_service object available)?

  • Returning User Password in Java code for custom reports

    Hi I'm doing a custom report and for the life of me I can't seem to find the password field in the database. :(
    Anyways I'm thinking maybe I can use java code to return the password and then using the decrypt password function. Could someone please shed some light on this!!!
    Note: I need to return the User password using java code and not XPRESS code. It would be best if someone either shows me how you can get the password using a java method or tell me where the User password is stored as I'm going crazy trying to find it in the DB!!!
    Thanks in advance!!!

    well... not sure what your Java code does. But if you can get the WSUser object for each user, you could call getPassword on the object to get the user's password

  • Java SAX parser. How to get raw XML code of the currently parsing event?

    Java SAX parser, please need a clue how to get the raw XML code of the currently parsing event... needed for logging, debugging purposes.
    Here's and example, letting me clarify exactly what i need: (see the comments in source)
    public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
         //..Here... or maybe somewhere elsewhere I need on my disposal the raw XML code of
         //..every XML tags received from the XML stream. I need simply to write it down
         //..in a log file, for debugging purposes, while parsing. Can anyone give me a suggestion
         //..how can i implement such logging while the SAX parser only returns me the tagname and
         //..attributes. While parsing I want to log the XML code for every tag in
         //..its 'pure form', like it is comming from the server directly on the
         //..socket's input reader.
         if ("p".equals(qName)) {
              etc...
    }Than you in advance.

    YES!
    I've solved my problem using class RecordingInputStream that wraps the InputStream
    here is the class source code:
    import java.io.ByteArrayOutputStream;
    import java.io.FilterInputStream;
    import java.io.InputStream;
    import java.io.IOException;
    * @author Unknown
    class RecordingInputStream  extends  FilterInputStream {
         protected ByteArrayOutputStream sink;
        RecordingInputStream(InputStream in) {
            this(in, new ByteArrayOutputStream());
        RecordingInputStream(InputStream in, ByteArrayOutputStream sink) {
            super(in);
            this.sink = sink;
        public synchronized int read() throws IOException {
            int i = in.read();
            sink.write(i);
            return i;
        public synchronized int read(byte[] buf, int off, int len) throws IOException {
            int l = in.read(buf, off, len);
            sink.write(buf, off, l);
            return l;
        public synchronized int read(byte[] buf) throws IOException {
            return read(buf, 0, buf.length);
        public synchronized long skip(long len) throws IOException {
            long l = 0;
            int i = 0;
            byte[] buf = new byte[1024];
            while (l < len) {
                i = read(buf, 0, (int)Math.min((long)buf.length, len - l));
                if (i == -1) break;
                l += i;
            return l;
        byte[] getBytes() {
            return sink.toByteArray();
        void resetSink() {
            sink.reset();
    } Then here is the initialization before use with SAX:
    this.psock = new Socket(this.profile.httpServer, Integer.parseInt(this.profile.httpPort));
    this.out = new PrintWriter(this.psock.getOutputStream(), true);
    this.ris=new RecordingInputStream(this.psock.getInputStream());
    this.in=new BufferedReader(new InputStreamReader(this.ris));
    try {
         this.parser = SAXParserFactory.newInstance().newSAXParser();
         this.parser.parse(new InputSource(this.in),new XMLCommandsHandler());
    catch (IOException ioex) {  }
    catch (Exception ex) {  }Then the handler class looks like this (it will be an inner class, so you can access ris, from the parent class):
    class XMLCommandsHandler extends DefaultHandler {
         public void startDocument() throws SAXException {
              //...nothing
         public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
              // BEGIN - Synchronized logging of raw XML source code in parallel with SAX parsing :)
              byte[] bs=ris.getBytes();
              logger.warn(new String(bs));
              ris.resetSink();
              // End logging
              if ("expectedTagThatTriggersMeToDoSomething".equals(qName)) {
                   //...Do smth.
    }Edited by: patladj on Jul 3, 2008 12:30 PM

Maybe you are looking for

  • Some questions on S60 features

    I'm planning a Flash based project for the S60 platform. Since I haven't been able to test this myself yet I have the following questions: - if a user is accessing a flash application in the S60's browser and a call comes in, what happens to the data

  • If I don't resubscribe will I loose all my uploaded Music?

    I want to purchase iTunes Match but am worried that if one year I forget/don't want to resubscribe I'll loose any music that has been uploaded (not purchased in iTunes). Does all my music wait for me to resubscribe or does it just all get removed?

  • IN clause in DB Adapter  - Problem in retrieving results

    Query builder in the Oracle Database Adapter doesn't give an option to include IN clause in the SQL. If I include that in the SQL directly say like the following SELECT XREF_CODE, SOURCE_VALUE, TARGET_VALUE FROM XREF_LOOKUP WHERE (XREF_CODE IN ( #XRE

  • Not executing the step

    hi , im using loop in workflow. in loop i have used 3 steps. while i was watching the log i found that  one particular step was not executed and its going to the next step  even i have given the steps sequentially in the loop.due to that condition is

  • Linking text file for credits

    Hello All, OK maybe this question was already answered in another thread, can't find it. Is there a way to link a formatted text file (rtf) and use it as end credits? Thanks.