Search code examples
informatica-powercenter

informatica-powercenter Mapping variable in Java


How do I access a mapping parameter ($$myvariable) from a Java Transformation in Informatica Powercenter?

What I want to do is to make a Java transformation reusable by making a part of it configurable, and a variable seemed suitable for that, however I haven't been able to access (read) a variable from the Java code.


Solution

  • I see three options

    • use an expression transformation with a variable port that passes the variable into an input port defined in the java transformation

    • Use shell variables and get them with the Java 'System.getenv' call for example:

      final String myconfig = System.getenv("MYCONFIG");

    • use a Java expression to get to the variable

      Integer getEmpID() throws SDKException { return (Integer)invokeJExpression("SETCOUNTVARIABLE($$MyVar)", new Object [] {} ); }