Skip to main content
Solved

Resolve domains option to output coded value rather than "null"


sammy
Supporter
Forum|alt.badge.img+16

Is there an option or setting that I have missed?

I have a reader pulling in data from a portal feature service. I set it to resolve domains.

I have a field that, for whatever reason, the coded value is not being resolved so the “_resolved” field is being populated as <null>.

Rather than having to add transformers to each of my workbenches to check each of my domain fields, I was wondering if there is a setting I am missing somewhere?

In this instance, I would rather have the coded values populate the “_resolved” field rather than it show up as “<null>”. Is there an option that I can set in the reader (or somewhere else) to be able to do this?

 

I am using Workbench 2023.1.

 

This post indicates that there was no option 3 years ago… hoping there’s been an update made?

 

Also, looks like no progress made on this request (from 4 years ago!) to at least add a warning in this type of situtaion. Please go upvote:

 

Best answer by joepk

AFAIK there is no setting you have missed. As a workaround I have used AttributeManagers with conditional values to move the contents of the coded column to the _resolved column if the value in the _resolved column is Null. I bet a PythonCaller could do this in a fancy dynamic way. 

I have upvoted the idea :)

View original
Did this help you find an answer to your question?

6 replies

joepk
Influencer
Forum|alt.badge.img+20
  • Influencer
  • Best Answer
  • March 7, 2024

AFAIK there is no setting you have missed. As a workaround I have used AttributeManagers with conditional values to move the contents of the coded column to the _resolved column if the value in the _resolved column is Null. I bet a PythonCaller could do this in a fancy dynamic way. 

I have upvoted the idea :)


sammy
Supporter
Forum|alt.badge.img+16
  • Author
  • Supporter
  • March 7, 2024

I added a new idea submission to add the option to bring over the original value (instead of just giving a warning in the original idea submission). Not sure if this is redundant but here is the link to upvote if you are so inclined:

 


geospatialize
Contributor
Forum|alt.badge.img+7

I've got a dynamic solution for you! I created the ResolvedDomainPopulator transformer and shared it on the FME Hub. You can check it out here: https://hub.safe.com/publishers/geospatialize/transformers/resolveddomainpopulator

I'm constantly trying to improve this transformer and make it more valuable for the FME community. If you have any feedback, suggestions, or ideas on how I can make it better or easier to use, please reach out to me.

Cheers!


sammy
Supporter
Forum|alt.badge.img+16
  • Author
  • Supporter
  • September 30, 2024
geospatialize wrote:

I've got a dynamic solution for you! I created the ResolvedDomainPopulator transformer and shared it on the FME Hub. You can check it out here: https://hub.safe.com/publishers/geospatialize/transformers/resolveddomainpopulator

I'm constantly trying to improve this transformer and make it more valuable for the FME community. If you have any feedback, suggestions, or ideas on how I can make it better or easier to use, please reach out to me.

Cheers!

@geospatialize I tried to use this transformer but it’s built in Workbench 2024 and I am not sure I can get my workbench updated from 2023 just yet. Do you have any advice on how I can accomplish this task in Workbench 2023?


geospatialize
Contributor
Forum|alt.badge.img+7
sammy wrote:
geospatialize wrote:

I've got a dynamic solution for you! I created the ResolvedDomainPopulator transformer and shared it on the FME Hub. You can check it out here: https://hub.safe.com/publishers/geospatialize/transformers/resolveddomainpopulator

I'm constantly trying to improve this transformer and make it more valuable for the FME community. If you have any feedback, suggestions, or ideas on how I can make it better or easier to use, please reach out to me.

Cheers!

@geospatialize I tried to use this transformer but it’s built in Workbench 2024 and I am not sure I can get my workbench updated from 2023 just yet. Do you have any advice on how I can accomplish this task in Workbench 2023?

Hello @sammy, I used a simple pythoncaller transformer to do this task! This is the script that I used: 

import fmeobjects


def FeatureProcessor(feature):
    attributes = feature.getAllAttributeNames()
    for attr_name in attributes:
        if not attr_name.endswith('_resolved') and not attr_name.startswith('fme') and not attr_name.startswith('multi'):
            resolved_attr_name = attr_name + '_resolved'
            original_value = feature.getAttribute(attr_name)
            resolved_value = feature.getAttribute(resolved_attr_name)

            if original_value is not None and (resolved_value is None or str(resolved_value).strip() == ''):
                feature.setAttribute(resolved_attr_name, str(original_value))
            elif original_value is None and (resolved_value is None or str(resolved_value).strip() == ''):
                feature.setAttribute(resolved_attr_name, '<null>')

    return feature

I have also attached a workspace (used Workbench 2023.2.4) so you can copy the configured transformer into your workbench 2023 workspace!

Hope this help :D


sammy
Supporter
Forum|alt.badge.img+16
  • Author
  • Supporter
  • October 10, 2024
geospatialize wrote:

Hello @sammy, I used a simple pythoncaller transformer to do this task! This is the script that I used: 

import fmeobjects


def FeatureProcessor(feature):
    attributes = feature.getAllAttributeNames()
    for attr_name in attributes:
        if not attr_name.endswith('_resolved') and not attr_name.startswith('fme') and not attr_name.startswith('multi'):
            resolved_attr_name = attr_name + '_resolved'
            original_value = feature.getAttribute(attr_name)
            resolved_value = feature.getAttribute(resolved_attr_name)

            if original_value is not None and (resolved_value is None or str(resolved_value).strip() == ''):
                feature.setAttribute(resolved_attr_name, str(original_value))
            elif original_value is None and (resolved_value is None or str(resolved_value).strip() == ''):
                feature.setAttribute(resolved_attr_name, '<null>')

    return feature

I have also attached a workspace (used Workbench 2023.2.4) so you can copy the configured transformer into your workbench 2023 workspace!

Hope this help :D

@geospatialize  Thanks! I was also in the process of writing a python script so this will be helpful! Thank you!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings