XI/PI dynamic change file er file name

Source: Internet
Author: User

Dynamic change file receiver file name

In actual business requirements, there are many file names that need to be dynamically changed, such as writing different file names based on some judgment logic,

There are several methods that can be used on the ID side using the XPath method. One of the methods is listed below, the UDF method,

Custom functions during message mapping,CodeAs follows:

Dynamicconfiguration conf = (dynamicconfiguration) container. gettransformationparameters (). Get (streamtransformationconstants. dynamic_configuration );

Dynamicconfigurationkey key = dynamicconfigurationkey. Create (

"Http://sap.com/xi/XI/System/File ",

"FILENAME"); // if you want to change the directory, replace filename.

String valuenew = "";

String valueold = Conf. Get (key); // obtain the name of the original file,

// If (valueold! = NULL) {// determine whether the original file name exists

Valuenew = "test"; // valueold. replaceall ("input", "output"); // change the file name to a new one.

Conf. Put (Key, valuenew );

//}

Return;

These start mapping, as long asNon-data field (non-leaf node)Mapping,

At this time, the development of the IR end is complete. The following is the ID end. The ID end is very simple. adapter-specific attributes,

Based on this idea, you can change the directory, file type, and other content.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.