I belief it would be very useful to everyone if there were more subscriber examples for agent.cfg mappings. Specifically, examples of using XPath and standard/user defined functions to derive the final field values for a subscriber hash map. A good example being - create a field called code that is composed of the first 4 letters of the first name + the last 4 characters of the last name.
Something like this:
<field name="code">concat(substring(Name[@Type="02"]/FirstName,0,5), substring(Name[@Type="02"]/FirstName,0,5))</field>
substring(
Is this type of processing possible for subscribers? How would custom methods be invoked? Any insights are appreciated.
thatz nice feature... but I think we can do that formatting programmatically as well correct by reading firstName & lastName separately and building the code as needed?
Thank you for your reply. Most everything and anything can be done by programing. The dev note on mappings did suggest that fields can be combined and that static methods can be accessed. Then you are confirming that those features are only available to provider and not subscriber agents? If these features do work for subscribers, then more examples and well as specific examples would be appreciated - particularly accessing custom static programs.
The syntax you are describing above is fully supported by the ADK. The ADK for Java uses the jxpath commons library. The .NET one uses the Microsoft XPathNavigator. Any functions supported by those libraries are supported by the ADK for *inbound* mappings, including the common XPath functions you describe above (concat, substring, etc).
Please see the javadoc at http://www.edustructures.com/dev/javadoc/com/edustructures/sifworks/tools/xpath/SIFXPathContext.html for more details.
The ADK exposes some of it's own functions in the ADKFunctions class (see the above javadoc for an example usage). You can define your own functions using JXPath function objects. To use them with SIFXPathContext, call the registerCustomFunctions(Functions) method.
registerCustomFunctions(Functions)
Andrew ElmhorstChief ArchitectEdustructures