Quantcast
Channel: SCN : All Content - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 7030

Get value in UDF dynamically

$
0
0

Hi Gurus,

 

I have an importstructure which can be enhanced dynamiccaly hence not all fields are defined and available in the mapping. Now there is a field which is not defined in the importstructure that contains a value I want to read.

I'm trying to create an UDF which reads a value from a structure dynamically. The path of this field is given as an inputparameter (KVK).

 

public String Bepaal(Container container) throws StreamTransformationException{
Document doc = null;
String value = null;
try {    String inParam = container.getInputParameters().getString("KVK");    //Bouw document op o.b.v. intpustream    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();    factory.setNamespaceAware(false);    DocumentBuilder builder = factory.newDocumentBuilder();    doc = builder.parse(<How do I get the inputstream??>);                //Bouw xpath expressie t.b.v. het ophalen van de base64 gecodeerde waarde    XPathFactory xFactory = XPathFactory.newInstance();    XPath xpathExpr = xFactory.newXPath();    XPathExpression expr = xpathExpr.compile(inParam);    Object result = expr.evaluate(doc, XPathConstants.NODESET);                //Bepaal gevonden node(s) en bepaal de waarde van de eerstgevonden waarde in de lijst    NodeList nlList = (NodeList) result;    value = nlList.item(0).getNodeValue();
} 
catch (Exception e) {    container.getTrace().addWarning(e.toString());    return "";
}
return value;
}
return value
;

The problem is, how do I get the inputstream? I only have a container element.


Viewing all articles
Browse latest Browse all 7030

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>