SmartsIntegrator Support and Discussion Forums

Forum Topics > SmartsIntegrator Best Practices > Is the string replace functoid the right one to use? > Post a Reply to this Thread

Is the string replace functoid the right one to use?

Share/Bookmark: Add this Thread to Digg Digg   Add this Thread to StumbleUpon Stumble Upon   Add this Thread to Del.icio.us Del.icio.us   Add this Thread to Reddit Reddit   Add this Thread to Facebook Facebook
RE: Is the string replace functoid the right one to use?
by benj on Fri, Nov 21 2008 11:30 AM
Hi J

The next release is now available from the usual location.

Regarding your query, using the string replace functoid will indeed work, but as you infer it’s possibly not the best way of doing things, especially if the list of values could change over time or potentially overlap. There are alternatives in the form of a database lookup functoid (although this then introduces potential portability issues and another point of failure), or a code lookup (a code functoid with a switch / case statement), or indeed a sequence of If functoids (again a little undesirable). My preferred solution would be to go for a Literal Xml functoid with an XPath lookup functoid – let me know if you want any help with this.

Many thanks,

Ben.
Ben Jackson
SmartsIntegrator Technical Support
benj
benj
Joined: Thu, Feb 7 2008
Posts: 96
Is the string replace functoid the right one to use?
by portedquery on Fri, Nov 21 2008 11:29 AM
Ben,

While awaiting the next release, I do have a question. The reason that I’m using the string replace functoid is as follows:

There exist 5 activity codes that I need to transform from their current values to values that will be accepted by a database table. When I worked with datagate (egate) several years ago, I used a lookup function and table provided by that application to interrogate the current value then replace it with the destination value. I’m not certain if my decision to use the string replace functoid is the appropriate one, especially since there are 5 codes to check, hence 5 instantiations of the string replace functoids, assuming they will work in that fashion. I’m asking to check validation of my process, as well as checking to see if there is a better way of implementing this action.

Your advice is most welcome.

J
portedquery
Joined: Wed, Jul 2 2008
Posts: 72