public String safeSubstr(String value, int startPos, int length, Container container)
throws StreamTransformationException {
/*
* @Author: Nicola Martella | www.nick4name.eu La funzione ritorna la
* sottostringa di value a partire da startPos (in base 0) per la lunghezza
* length. Es1: value: "ABCDEFGHIJ" startPos=6 length=3 ret: "GHI" Se la
* posizione di length a partire da startPos eccede la lunghezza di value, viene
* ritornata la sottostringa a partire da startPos per tutta la lunghezza
* rimanente. Es2: value: "ABCDEFGHIJ" startPos=6 length=10 ret: "GHIJ" Se la
* posizione di startPos e' maggiore della lunghezza di value, viene ritornata
* una stringa vuota. Es3: value: "ABCDEFGHIJ" startPos=11 length=3 ret: "" Se
* value è null, viene ritornata una stringa vuota. Es4: value: null startPos=0
* length=3 ret: "" Se length e/o startPos sono < 0 vengono posti a 0.
*/
if (value == null)
return "";
if (length < 0)
length = 0;
if (startPos < 0)
startPos = 0;
int toPos = startPos + length;
if (toPos > value.length()) {
toPos = value.length();
}
if (startPos > value.length()) {
startPos = value.length();
}
return value.substring(startPos, toPos);
}
Per i flussi verso JMS Web Logic occorre definire nella dynamic configuration l’attributo DCJMSCorreleationID. Dal momento che questo attributo non è esposto dalla ASMA occorre valorizzarlo da mapping con la seguente UDF.
UDF per ottenere il nome del file del communication channel file tramite la ASMA, Adapter-Specific Message Attribute, “http://sap.com/xi/XI/System/File” “FileName” delle Dynamic Configuration.
public String getDynConfFilename(Container container) throws StreamTransformationException{
/*
Ritorna la chiave "http://sap.com/xi/XI/System/File" "Directory" delle Dynamic Configuration.
*/
DynamicConfiguration dc = (DynamicConfiguration) container
.getTransformationParameters().get(
StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey k1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File",
"Directory");
return dc.get(k1);
}
This website uses technical cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptRead More
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.