Thursday, May 13, 2010

FME and Smallworld Text Join fields

Smallworld ignores data from FME that is destined for text_join fields.

Smallworld has a data type called "text_join" which allows you to store a string of indefinite length on a Smallworld record. Under the hood, this data type is actually modeled as a join relationship to an internal table that stores chunks of finite-length strings that can be added to each other to emulate an indefinite-length string. So a text_join is actually considered a join field and not a physical field.

This becomes a problem when you want to copy data into one of these text_join fields. This is not an unusual requirement. Many Smallworld objects have at least one text_join field (e.g., Electric Office objects have a "Remarks" field; other datamodels might have a "Comments" field). Not being able to import attribute values via FME into those Smallworld objects is not an insignificant limitation.

I raised a case with GE about this recently and was told that this was a duplicate of a same case that I had raised a few years ago. I knew that there had been something familiar with this issue, but I couldn't remember that I had already encountered it a few years ago. Because there is no patch in sight any time soon for this issue, I present to you the fix I made. Like most of the FME/Magik tweaks I have had to make, the implementation is fairly easy.

(click on image to enlarge)


riho said...

Do you have a same kind of hack also for exporting text_join fields with FME? I believe this is a bit more complicated.

Alfred Sawatzky said...

@riho. I think the easiest way to do this would be to use the FME Pseudo Fields approach as described here. You could define the text_join field name as a FME Pseudo Field and that would be enough for FME to pick that text_join field up as a valid feature attribute.

Anonymous said...

Hi Alfred,

When the .value_from_string() method is called on my text join I get a :dd_value_conversion_failed. I tried this on all of my text joins and they all appear to have the same problem. Thoughts?


Anonymous said...

Hi Quince,

What version of Smallworld are you using?


Anonymous said...

I'm using 4.1.1.