cancel
Showing results for 
Search instead for 
Did you mean: 

Parameterized Java Mapping - Where to get the class?

former_member434498
Participant
0 Kudos

Hello Team,

I have an existing Java Mapping that I need to modify to have dynamic values or parameters.

I followed the instructions given in this link -

Now, may problem is the Java code and the class.

1) Can you please tell me where can I get the class for com.sap.aii.mapping.api.InputParameters?

    While compiling the java program, I get an error saying this import is missing.

2) Can you also check if below code is correct?

public class JAVA_AddTimeStamp implements StreamTransformation{

                private Map objMapParameter = null;
                public void execute(InputStream isInput, OutputStream osOutput)

                                                throws StreamTransformationException {


                                String strTrgtFileName                                   = null;
                                Date dteCurrDate                                                            = null;
                                SimpleDateFormat sdfDateFormat          = null;
                                DynamicConfiguration objDynConf          = null;
                                final String SFTP_PATH                                  = "http://sap.com/xi/XI/System";
                                final String SFTP_PROPERTY      = "FileName";
                                final String FILEEXTN                                       = ".pgp";
                      

                                // access dynamic configuration
                                objDynConf = (DynamicConfiguration)


                                                objMapParameter.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

                dteCurrDate = new Date();        

                sdfDateFormat = new SimpleDateFormat("MMddyyyy.hhmmssSSSSSS");


                                String inParam = isInput.getInputParameters().getString("ACCOUNT_NAME");


                                strTrgtFileName = inParam + ".PS00020." + sdfDateFormat.format(dteCurrDate) + FILEEXTN;

Accepted Solutions (0)

Answers (3)

Answers (3)

iaki_vila
Active Contributor
0 Kudos

Hi Carlo,

What is your PI version?, you can develop your java mappings directly in the ESR and you won't need to find out where the SAP jar is. Also you have more advantages, like to have your source java in the ESR. Check this Sunil Chandra's blog

Regards.

marksmyth
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello,

See the note 1763011 Where to find jar files for PI mapping/adapter development.

Regards
Mark

former_member181985
Active Contributor
0 Kudos

Hi Carlo,

You can download the jar file from your PI system using browser,

http://<XIServerHost>:<PORT>/rep/repository/com.sap.xpi.ib.mapping.lib.jar

//BR,

Praveen Gujjeti