ODI: Use of Java BeanShell in Knowlegde Module

Hello,
I have an array defined pkCols in earlier steps of my IKM. It has assigned 4 values ('A', 'B','C','D').
I would like to parse all values into one string so I could save them during INSERT INTO ... SELECT statement.
Basically I would like to get a string 'A_B_C_D_' from my pkCols array.
So - I have created a step within SQL technology that looks like this:
INSERT INTO audit_table (...)
SELECT
col1, col2, col3,
'<@ for (i=0; i<pkCols.size(); i++); { @><@=pkCols.get(i)@>_<@ } @>*'* as col4, col5
FROM other_audited_table;
It works, but when I look into audit_table in col4 i see exacly the string:
<@ for (i=0; i<pkCols.size(); i++); { @><@=pkCols.get(i)@>_<@ } @>
and not string that I am expecting (A_B_C_D_)
What should I do to make it work and what mechanism I am not aware of ?
regards,
J.

Hi,
side and saving this work in
a flat file (java property file/xml file) at the
server side.
Could n e 1 suggest me that saving flat file at the
server side would work,
coz this file would share by multiple clients.And how
locking facility j2e gives whilesomebody is modifing
one file.Does "server side" mean EJBs? Is so, from the EJB 2.1 specs document, section 25.1.2 :
"An enterprise bean must not use the java.io package to attempt to access files and directories in the file system.
The file system APIs are not well-suited for business components to access data. Business components should use a resource manager API, such as JDBC, to store data."
Just make sure you use a resource manager to access files.
Kexkey

Similar Messages

  • How cud I run odi using a java application.

    HI,
    I need the location of the jar files that cud help me to run odi using a java application.
    I am unable to find jar file which is responsible for the invoking ODI using the classes in the package named
    "oracle.odi.sdk.invocation".
    I found this package name from doc
    regards,
    Palash Chatterjee

    It's going to depend on the application in question.

  • Retrieving ODI variable in Java Beanshell (Target Beanshell Source Oracle)

    Hi Guys:
    I'm facing a simple problem, but I'm not able to find the solution in the documentation or any post in this forum. I have a procedure where I use both tabs (Source and Target) and need to retrive the result of the "StrParam" (Oracle query) into a BeanShell variable (OracleMessageData).
    In the target tab I have these commands (Java BeanShell Techonology):
    <@
    import java.io.FileNotFoundException;
    import java.io.InputStream;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.io.UnsupportedEncodingException;
    import java.util.ArrayList;
    String OracleMessageData = "#strParam";
    String PathOfXMLFiles = "<%=odiRef.getSchemaName("LS_FILE_XMLFULL", "D")%>";
    @>
    In the Source Tab, I have this command (Oracle Techonology):
    SELECT MESSAGEDATA FROM <%=odiRef.getSchemaName("LS_ORACLE_ODI_WRK", "D")%>.CONTENT_RIB_MSGDATA strParam
    How can I retrieve the content of the Source Command into the variable in the Target? The line bellow doesn't work:
    String OracleMessageData = "#strParam";
    I'm using ODI_11.1.1.6.0_GENERIC_111219.1055
    Regards.
    Luiz Araujo
    Edited by: Luiz_Araujo on 25/07/2012 06:43
    Edited by: Luiz_Araujo on 25/07/2012 06:45

    Hi Luiz
    Use Below query on source tab.
    SELECT MESSAGEDATA STRPARAM FROM <%=odiRef.getSchemaName("LS_ORACLE_ODI_WRK", "D")%>.CONTENT_RIB_MSGDATA
    Then on target tab use
    String OracleMessageData = "#STRPARAM ";
    If it wont work try putting colon.
    String OracleMessageData = ":STRPARAM ";
    Thanks.

  • How to use standard Java file in custom module

    Hi All,        
    I want to use some CatalogItemImpl.java file in my custom DC but i was unable to find any entry in the standard component in businessobject.xml file as <businessObject name="XYZ" className="x"/>. Can anyone let me know how can we use the file file in my custom DC.
    Please provide your inputs......
    Regards,
    Rahul.

    Hi Rahul,
    You will not find the "CatalogItemImpl" in the 'businessobject.xml'. The 'businessobject.xml' is there to define session based API of modules. Those API have properties and web channel builder values injected when the user start a web session.
    For the "CatalogItem", you will have to use the Generic Factory concept. The Generic Factory is used to allocate instance given a configuration. If no configuration exists, the default implementation is used. By adding an entry in the Generic Factory you can choose to allocate your class instead of the default class.
    Within the catalog module, the alias to use for classes extending "CatalogItemImpl" is "com.sap.wec.app.common.module.catalog.businessobject.ext.interf.CatalogItemExtInterf".
    Please refer to the extension guide on how to manage the Generic Factory configuration file.
    Regards,
    Robin

  • Java BeanShell

    Hi again.
    Is it possible to use a java beanshell in jcreator???
    I use an option called "Interpret" in xemacs which enables me to test individual classes without having a main test class. Does jcreator have this facility??
    Thanx

    Ok i searched on the net and i downloaded a beanshell jar file. I have put the beanshell in the folder of the java files, but it says:
    // Error: Typed variable declaration : Class: Room not found in namespace: <at unknown location>
    i have set the environment variables.
    Anyone have any idea to use this beanshell in windows????
    Thanx

  • Java BeanShell expression in ODI

    hi experts,
    i am working on ODI 11 g (11.1.1)
    i have found java beanshell expression in standard ODI KM (IKM "IKM Oracle Slowly Changing Dimension", step 192 "Analyze integration table"):
    <%=odiRef.getTable("L","INT_NAME","A").replaceAll("","").replaceAll("..>",".replaceAll(odiRef.getInfo( \\u0022DEST_WORK_SCHEMA\\u0022 )+\\u0022.\\u0022,\\u0022\\u0022)?>")%>
    It translates, for example, "DWH_ETL.I$_SC_INTERMEDIARY" to "I$_SC_INTERMEDIARY"
    Please explain in detail how it works?
    specifically, i don't understand how works the expression:
    replaceAll("..>",".replaceAll(odiRef.getInfo( \\u0022DEST_WORK_SCHEMA\\u0022 )+\\u0022.\\u0022,\\u0022\\u0022)?>")
    Java function "replaceAll" (http://download.oracle.com/javase/6/docs/api/):
    public String replaceAll(String regex,
    String replacement)
    replaces each substring of this string that matches the given regular expression with the given replacement.
    What does mean the expression "..>" in this calling replaceAll?
    it looks like a nested call to the substitution API (http://www.business-intelligence-quotient.com/?p=812)
    thanks in advance

    HI,
    I have re configured as mentioned in your blog . But still getting same exception . Something I missed in my previous thread is below.
    <Sep 19, 2012 3:34:46 PM EDT> <Error> <HTTP> <BEA-101216> <Servlet: "AgentServlet" failed to preload on startup in Web application: "trellisagent".
    ODI-1400: Agent trellisagent start failure: JDBC connection error occurs while connecting to the master repository.
    Caused by: java.security.AccessControlException: access denied (oracle.security.jps.service.credstore.CredentialAccessPermission context=SYSTEM,mapName=oracle.odi.credmap,keyName=SUPERVISOR read)
    at oracle.odi.runtime.agent.servlet.AgentServlet.startup(AgentServlet.java:318)
    at oracle.odi.runtime.agent.servlet.AgentServlet.init(AgentServlet.java:226)
    at javax.servlet.GenericServlet.init(GenericServlet.java:242)
    at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    I am stuck in asituation here :(
    Ashish

  • How to refresh ODI variable as part of a Knowledge Module?

    Hi,
    I want to know how can i refresh a ODI varaible in a knowledge module using oracle Technology. EX: i have created a variable called VAR_TEST in ODI.
    In one of the knowledge module steps, i want to refresh as mentioned below:
    begin
    select colname into #VAR_TEST from tablename;
    end;
    Many thanks ....

    Hi Martin,
    Put the query in the refresh tab into the variable, generate a scenario from the variable and call the scenario thru "OdiStartScen" (Sunopsis API technology) from KM.
    In this case the variable needs to be "Last Value"
    An alternative is to use a Java variable instead.... Works better to KM's.
    Does it help you?
    Cezar Santos
    http://odiexperts.com

  • Variable from Java Beanshell procedure for usage in interface

    A variable from my package contains value: ' text',' text2',' text3',....etc.
    I need to use this variable in my interface as: 'text','text2','text3',...etc.
    So I wrote a Java beanshell procedure with following code and with this input variable as an option: forecastOrgCode
    String forOrgCode = "<%=odiRef.getOption("forecastOrgCode")%>";
    String orgCodeTrimmed = forOrgCode.replaceAll (" ","");
    Any other code between <@ or <? or <% gets me messed up because of the ' characters present in the variable, so I just chose the beanshell technology and this does the trick...
    However...how can I reach this orgCodeTrimmed variable from my interface?

    As you are directly passing the value in Option , why not lets do it directly inside interface
    Using ODI Variable
    Step 1. Set Variable = ' text',' text2',' text3','text4 '
    Step 2. Inside Interface
    '<@ out.print("#VAR".replace(" ", "").replace("'", "''"));@>'You will need to convert '(single quotes) to double single quotes else oracle will throw error ,similar to what we do in pl/sql
    Directly
    '<@ out.print("' text','  text2',' text3'".replace(" ", "").replace("'", "''"));@>'

  • HOW DO I REASSIGN A PACKAGE VARIABLE VALUE FROM WITHIN JAVA BEANSHELL PROC

    Hi all
    I am trying to something that I would consider quite normal in programming applications.
    create a variable - systemId
    create a procedure that runs some code (Java BeanShell), and then sets the varable to a value depending on that code
    create a second procdure that runs some code(Java BeanShell), but uses the value of the variable set from the previous stage
    In the package editor I have created a declare variable step, two procedures, and a flow: declare variable -> procedure 1 -> procedure 2
    If I declare the variable with a vue of 10 initially then try #systemId = 400, I get an error along the lines of '10 = 400'
    I am probably doing something basically wrong
    regards
    Terry

    My friend it depends on you. What ever you mentioned that can be achieved in package level but in procedure level.
    For example:
    Odi procedure: Java beanshell techonlogy
    <@
    String empname="ALEX";
    @>
    odivariable1: refresh mode in package
    select sal from emp where empname='<@=empname@>'
    Package diagram:
    ODIprocedure------ok--->ODIvariable inrefreshmode
    if you will execute this then the odivariable will have value 2000( alex salary)
    Till now it was easy to achieve. But tell me how to assign the alex salary inside the 1st procedure without taking the help of a package. You just have to execute only the procedure.Hmmm nail on your head ? you might be thinking of something like this #odivariable=<@=empname@> which is not correct.
    In this scenario you have update the snp_var_data table. So that the underlying value can be updated. Another approach could be to generate a scenario of the odi variable given above and invoke the scenario inside the procedure(this way you can refrsh it without using a package)
    Ok my friend. Seems to be a long explanation.
    Let me know if it is helpful or not.
    Bhabani
    http://dwteam.in

  • Using a java project in a web which is part of a ear

    hi
    i have an ear (jspkeepEAR) that includes a web project (jspkeep). The web project uses a java project (common).
    I don't want the EAR to know about the common, so i've added the common as a j2ee module to the web project.
    when publishing, i can see under
    C:\bea92\user_projects\w4WP_workspaces\Untitled\.metadata\.plugins\org.eclipse.core.resources\
    .projects\jspkeepEAR\beadep\workshop\jspkeepEAR
    the .beabuild.txt file:
    C\:/bea92/user_projects/w4WP_workspaces/Untitled/jspkeepEAR/EarContent/APP-INF/classes = APP-INF/classes
    C\:/bea92/user_projects/w4WP_workspaces/Untitled/jspkeep/WebContent = jspkeep.war
    C\:/bea92/user_projects/w4WP_workspaces/Untitled/jspkeep/build/classes = jspkeep.war/WEB-INF/classes
    C\:/bea92/user_projects/w4WP_workspaces/Untitled/jspkeep/build/jws/.src = jspkeep.war/WEB-INF/classes
    C\:/bea92/user_projects/w4WP_workspaces/Untitled/common = jspkeep.war/WEB-INF/lib/common.jar
    the problem is, when i'm surfing to a servlet in the web, i get NoClassDefFoundError for classes in the common.
    I've also noticed that if i publish the web project by itself (and not as part of the ear), it works fine.
    any idea?
    thanks
    yair
    Edited by reformy at 12/12/2006 2:24 AM

    Hi Yair
    It appears that WLS only supports mapping a directory to a jar in APP-INF/lib/
    C\:/runtime-New_configuration/Common/bin = APP-INF/lib/Common.jar
    but NOT to a jar in WEB-INF/lib.
    Engineering will look into it sometime to fix it.
    Workaround Suggested:
    As a workaround, you can include the Java/Utility project as part of the EAR and set as dependent J2EE module to the Web project.
    Hope this helps.
    Vimala-

  • Use Sun Java Studio 2 with Existing Java Application

    I have started using Sun Java Studio 2 and having fun and little difficulty creating a new Java web application from scatch. My question is where do I find information on Java Studio configuration to allow Java Studio to load up and modify Java server pages/forms in an existing Java application that I did not write?
    The Java application has been created with Javabeans and using BEA Weblogic version 7, with a SQL-Server 2000 database backend.
    Below is a bit of code out of one of the main Java forms.
    <%@ page buffer="256kb" autoFlush="false" errorPage="../../common/system/error.jsp"
    import="psdi.jsp.beans.*, psdi.jsp.common.*, psdi.jsp.app.wotrack.*, psdi.jsp.util.* , psdi.mbo.* , psdi.util.* "%>
    I have looked around and have not found what I need to setup in Java Studio to allow me to load up a form and view it in the Visual designer, I keep getting errors on the psdi. references and cannot load up any pages.
    I see on the server install ia folder under the main root <DIR> called <apps>, and inside the <apps> folder is a folder called <jsp> and in the <jsp> folder are sub folders for each main module within the application with all the related .jsp files. I have been manually editing the .jsp files using Windows Notpad and saving the changes. Then I rebuild the .ear file and my changes work fine. Since I have a lot of changes to make there has to be a better way than using Notpad.
    My hope is somewhere is a point-by-point document on what to so I can use Sun Java Studio 2 to make my changes in a visual IDE.
    Any assistance would really be appreciated.

    Hi Giri,
    Yep, this I know,b ut when I do I get errors messages and am looking for some form of point-bypoint instuction that better explains how to setup up custom libraries in Sun Java Studio, custom tags, etc.

  • JAVA BEANSHELL EXCEPTION HANDLING

    Hi
    still new to ODI
    I have created a java beanshell script in ODI which calls a simple java class, cars, then sets the no of seats to a value designed to raise an exception. Exception raised but procedure works OK,
    How can I register the fact that it has failed through exception handling? (It is possible that my java exception handling isn't quite right)
    The no of seats has no effect on the success/failure of the ODI procedure, but the log shows that the exception is caught !
    any assistance gratefully received.
    Regards
    Terry
    cars class: (added to agent start)
    ====================
    public class cars {
    private int seats;
    public void setSeats (int seats) throws tooManySeatsException {
    if (seats) < 100) {
    this .seats = seats;
    } else {
    throw new tooManySeatsException("Too many seats");
    public int getSeats () {
    return this.seats;
    class tooManySeatsException extends Exception {
    public tooManySeatsException (String msg){
    super();
    Java beanshell procedure in ODI
    ====================
    import cars;
    public class carsTest {
    public carsTest(){
    public void init(){
    cars c = new cars();
    c.setSeats(20);
    //c.setseats(200);
    try {
    carsTest ct = new carsTest();
    ct.init();
    } catch (Exception e) {
    throw Error (e);
    }

    Your code throws exception when you set value >100 but you are setting 20 thus it would not throw exception.
    In the procedure step you can uncheck "Ignore error" flag to let execution failed on throwing any exception from your code. If you check that flag then the execution would not fail rather lease the task in warning state.

  • Is it possible to use the JAVA Report Engine SDK to modify DESKI reports?

    Post Author: Nadine
    CA Forum: JAVA
    Hi, is it possible to add a complex filter to a DESKI report using the JAVA report engine sdk?
    In the developer tutorials for this API, I've only found references to WEBI in terms of modifying reports, though it seems to be possible to view DESKI reports with this sdk.
    I am a bit confused in terms of the scope of this API and how I would use it in regard to DESKI.
    Many thanks for any suggestions!
    Nadine

    Post Author: Ted Ueda
    CA Forum: JAVA
    Current (XI R2) version of ReportEngine API only supports refreshing/viewing functionality for Desktop Intelligence documents.  Document modification/creation is only supported with Web Intelligence documents.  Queries aren't modifiable for Deski using ReportEngine API - you can only do so using Desktop Intelligence Reporter SDK, which is COM based.Sincerely,Ted Ueda

  • How can I use Seeburger java functions on SAP XI's user defined functions?

    Hi All,
    As my title implies; how can I use Seeburger java functions on SAP XI's user defined functions?  I've tried searching over the net in tutorials regarding this topic but I failed to find one; can someone provide me information regarding my question? thanks very much.
    best regards,
    Mike

    Hi Mike !
    You should check your documentation about which java classes you need to reference in the "import" section of your UDF. And also deploy the java classes into the java stack or include them as a imported archive in integration repository...it should be stated in the seeburger documentation.
    What kind of functions are you trying to use?
    Regards,
    Matias.

  • How to Use the JAVA SCRIPT code in .htm page of the component

    Hi .
    In my requirement i have to use Java Script Function in .htm code ..how to use the java script code and functions in .htm???
    thank you
    B.Mani

    Check this document  [Arun's Blog|http://wiki.sdn.sap.com/wiki/display/CRM/CRMWebClientUI-TalkingwithJava+Script]
    Regards
    Kavindra

Maybe you are looking for

  • Popup iview inside an iView in portal

    Hi experts, Here I have an Iview with me which is capable of accepting data from me i.e i can add a row, name of a cleint etc etc. Now here I want to have a seperate popup opening within that iview to enter the data. once the data entering process is

  • My Ipad is stuck on safari pages

    My ipad is stuck on a safari page. I cannot close page. what can I do? I already turned ipad off, and still no luck

  • RMI & Web Start Client (ClassNotFound)

    Hi, I've been using RMI with a client application and it works find but now I have tried to run the same application via web start I'm getting RMI issues. I've fixed all sorts of other issues but Im stuck on the RMI one. I get a ClassNotFound excepti

  • [b]How to validate user's digital signature by ClientAuthentication?[u]HELP

    Hello, My Problem: By client-certificate-based authentication the first step is to prove "Does user�s public key validate user�s digital signature?". How can I prove this on the ServerSide manually, resp. I want to verify it with java classes on the

  • Integration of w2 form into ESS from tcode PU19

    Hi All, Please let me know How to integrate the  W2 form, from that  we see through TCODE: PU19 into ESS through webdynpro ABAP . Thanks.