0

I have two schemas;

src.xsd
destination.xsd

src.xsd has 2 dates and 1 string

-FromDate (example: 2001-01-01)
-ToDate (example: 2002-01-01)
-Intervaltype (example: 'A long year')

dest.xsd has 1 string property

-Query

I would like to map this so that I achieve a concatenated string in the Query property in the destination schema, like:

"WHERE date1 >= 2001-01-01 AND date2 <= ToDate AND IntervalDescription = 'A long year'"

I've achieved this by using the "string concatenate" functoid.

The problem is that the dates are optional, and i would like to set "default" values in the mapping if none are supplied in src.xsd. In that case i would like

 FromDate to be the current date - 10days 

and

ToDate to be de current date

How can this be achieved?

Thanks for your help!

jonnep
  • 285
  • 3
  • 17
  • 2
    Just use Inline C# scripting functoid with 3 input parameters and use standard C# methods to manipulate strings. http://msdn.microsoft.com/en-us/library/ee267841(v=bts.10).aspx – kletnoe Feb 07 '14 at 09:17

1 Answers1

1

The solution was quite simple,

FromDate      -> LogicalDate -> ScriptingFunctioid -> StringConcatenate -> Destination
FromDate      ---------------->
ToDate        -> LogicalDate -> ScriptingFunctioid ->
ToDate        ---------------->
Intervaltype  -------------------------------------->
jonnep
  • 285
  • 3
  • 17
  • 1
    Note that the LogicalDate functoid doesn't guarantee that the date is in the format you expect, just that it can be parsed as a date. – Dijkgraaf Feb 13 '14 at 03:00