Developer forum

Forum » Integration » Script syntax table mapping

Script syntax table mapping

Ben Doorn
Reply

Does anyone know where to find documentation about the syntax of the script option for table mappings within the Integration Module. I can define constant values, but now I want to enter the date of today as the "constant" value. 

Integration-Mapping-Script.PNG

Replies

 
Jonas Krarup Dam
Reply

Hi Ben,

Currently, it is only possible to use the three options,"append","prepend" or "constant".

If this is a feature you absolutely need, let me know, and I'll add it as a feature request, and get it implemented as soon as we can.

 

Regards, Jonas

 

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

What would be really great is to have three additional options:

1. Inline script - this would work similar to how the dynamic values in Items work to insert things like a date or maybe even the value of a source column combined with something else (e.g. @OrderID + "Suffix" + @DateTime.Now would grab the OrderID column, and add Suffix and the current date to it.)

2. A custom field converter that you can select from a drop down (and that would be found by the extensibility API automatically). That converter would implement something like override ProcessInputField and could look like this:

public override ProcessInputField(object input, object output)
{

}

Inside the ProcessInputField I can access the source column and do whatever I want to update the output. Instead of a simple Object, this method could receive a richer structure for input and output that besides the field value also exposes column meta data.

3. A custom row converter that you can select from a drop down (and that would be found by the extensibility API automatically). That converter would implement something like override ProcessInputRow and could look like this:

public override ProcessInputRow(Dictionary<string, object> input, Dictionary<string, object> output)
{

}

Inside the ProcessInputRow I can access source columns from the dictionary and do whatever I want to update the output. This task would run for the whole row, possibly after the internal mapping has been completed. Instead of a <string, object>, the dictionary could expose richer types that would provide additional column meta data.

For some inspiration, take a look at how SQL Server Integration Services performs Script Transforms:

http://www.codeproject.com/Articles/441678/Getting-Started-With-SSIS-Script-transforms

Imar

 
Ben Doorn
Reply

Jonas, 

Due to the name script in the dialog I assumed it was possible to write some script calculate the "constant" value. For the moment I can work without it, and used a constant values instead of the current date. For this purpose (importing direct path records) this is no problem. But I really like the sugestions Imar has written in his post, this will make the module much more flexible and in a lot of situations takes away the need to write custom source and destination providers.

Kind regards,

Ben

 
Jonas Krarup Dam
Reply
This post has been marked as an answer

Hi Ben and Imar,

Thanks for the feedback - I'll add it to the feature queue, and try to get it  included in an upcomming release - probably either 8.5.1 or 8.6.

 

Regards, Jonas

Votes for this answer: 1
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Great, thanks, and please let me know if you need more input or want to discuss this further.

Imar

 
Ben Doorn
Reply

That would be great. Thanx.

 

You must be logged in to post in the forum