The SIF® Zone
creating, assimilating, and promoting excellence in SIF® agent development

Subscriber mappings

rated by 0 users
Not Answered This post has 0 verified answers | 3 Replies | 2 Followers

Top 10 Contributor
28 Posts
Points 510
Bombay posted on 11-30-2009 11:25

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>

Is this type of processing possible for subscribers?  How would custom methods be invoked?  Any insights are appreciated.

 

  • | Post Points: 45

All Replies

Top 10 Contributor
21 Posts
Points 305

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?

  • | Post Points: 25
Top 10 Contributor
28 Posts
Points 510

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.

  • | Post Points: 5
Top 10 Contributor
215 Posts
Points 5,055

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.

 

 

Andrew Elmhorst
Chief Architect
Edustructures 

  • | Post Points: 5
Page 1 of 1 (4 items) | RSS
Copyright ©2006-2009 sifzone.com
Sponsored by Edustructures
We Connect the Systems that Power Education
 
SIF and Schools Interoperability Framework are trademarks of the Schools Interoperability Framework Association.