3 Replies Latest reply: Jan 10, 2013 3:56 PM by Vijay Nimmakuri RSS

    Passing parameter (order header_id ) to my Oracle configurator extension.

    Vijay Nimmakuri
      Hi,

      Can any once tell me how to pass a parameter to the Oracle configurator extension.

      In my case when the user enters the product model on the sales order line, and hits the configure button on sales order form, a query in my java CIO extension will pull the data(model.options string ex : ProductModel.Option1.Option2.Optiopn3 and populate it to the configurator UI, query: "select oola.USER_ITEM_DESCRIPTION from apps.oe_order_lines_all oola where oola.header_id=15062oe_order". Here i need to pass the order header_id and line_id to get the appropriate data and populate the config UI.

      Below is my java method, When iam creating extension rule i could bind the iRuntimenode to Arg1 and for Arg2 i need to pass order_id and line_id. I am little confused how to bind these values to Arg2.

      public String getModelOptions(IRuntimeNode irn, Long orderid)

      Can any one tell which argument specfication to use and how to bind order_id to Arg2
      I have (event parameter, literal, Model node or property, system parameter ) in LOV while creating bindings in extension rule.



      Thanks in advance,
      -Vijay
        • 1. Re: Passing parameter (order header_id ) to my Oracle configurator extension.
          Vijay Nimmakuri
          Hi All,

          Iam posting this cos it may help others.

          This how we get the sales order header, line_id and application_id


          NameValuePairSet initParams = rootNode.getConfiguration().getUserParameters();

                    String paramValue = (String) initParams.getValueByName("calling_application_id"); // Getting the calling application id
                    if (paramValue != null)
                    mApplicationId = Long.valueOf(paramValue);
                    paramValue = (String) initParams.getValueByName("client_header"); // If calling is OM this is how we get Order header_id
                    mOrderHeaderId = Long.valueOf(paramValue);
                    paramValue = (String) initParams.getValueByName("client_line"); //If calling is OM this is how we get Order line_id
                    mOrderLineId = Long.valueOf(paramValue);

          Regards,
          Vijay
          • 2. Re: Passing parameter (order header_id ) to my Oracle configurator extension.
            Vijay Nimmakuri
            initParams.getValueByName("client_line") its returning null. and the page is erroring out

            Configuration config = irn.getConfiguration();


            // 1. Get the parameters in the initialization message
            NameValuePairSet initParams = config.getUserParameters();
            String paramValue = null;

            // 2. Get the value of the parameter "client_line"
            paramValue = (String)initParams.getValueByName("client_line");
            if (paramValue != null) {
            mOrderLineId = Long.valueOf(paramValue);
            } else {mOrderLineId = (long) 17010;}

            When i passing hard coded value 17010, its working fine. Not able to trace out whats going wrong.

            -Vijay
            • 3. Re: Passing parameter (order header_id ) to my Oracle configurator extension.
              Vijay Nimmakuri
              Question Answered:

              Need to test by publishing to and configuring in Order Management.

              To test locally, you can use the Custom Initialization Parameters under Preferences->Configurator section. To be able to do this, you need to have a sample order in your local CZ instance.

              Ex: "< param name="client_line">12345</param >"

              This comes in handy when trying to debug or quickly test Rules.