Aller au contenu principal

Update 5.45 - 12 May 2025 - Set property and for each items validation

Commentaires

12 commentaires

  • Ken Lyon

    Hmm, this is an interesting one.

    In the For Each activity, the type of the “item” output is meant to come from the type of the “items” input.

    For example, if you provide a string[] as the “items” then “item” would be a string.

    As far as the type information goes, if it's not an array, the only other type we detect is Record<string, T> which means an object with strings for property names (which is normal) but all of the properties being the same type.

    For example, if this was the items input:

    {
      a: 1,
      b: 2,
      c: 3
    }

    Then the item would be of type number.

    However, if the properties are all different types that could get complicated. I'm not sure what it would do there.

    What do you have in your “items" input?

    0
  • Tyson Schoepflin

    The items are objects; features or geometry from query results, or other custom objects.  Object($forEach1.item) does remove the validation error, but not sure that is a good solution here.  Wondering what the best practice before making 138 changes.

    0
  • Tyson Schoepflin

    In the screenshot example above this array is the for each input:  =[{"val1":1},{"val1":2}]

    In other settings one might expect a type option on the for each activity.

    0
  • Ken Lyon

    The easiest fix would be to change the “object” input of “Set Property” to type “any”. That would address the immediate problem, although there are 10 other activities that also have an input of type “object” that might be similarly affected in future.

    It does seem that Set Property is dramatically impacted, though, so I might consider a hotfix for this, along with the new warnings you get for not specifying a property on the “object” input.

    0
  • Ken Lyon

    Tyson Schoepflin  I have made some changes that will address this. There is a new Item Type input to the For Each activity, and it will be “any” by default, so you shouldn't need to supply it to get Set Property to work, however you could use it if you want the type information elsewhere.

    We hope to get this out by the end of next week.

    1
  • Ken Lyon

    Tyson Schoepflin The new version of the designer is now live. You should see some improvements in the areas we discussed. I will be making a proper announcement once everything else has been updated.

    0
  • Tyson Schoepflin

    Thank you!

    0
  • Alison Mynsberge

    Is this an update available for on-prem installs of VertiGIS Workflow?  Is there any other workaround?

    0
  • Alison Mynsberge

    I am seeing the error in version 5.41.0 where the ForEach is returning .item type as “undefined” instead of “any” in the validation.  The ForEach.items in this case consists of features returned by a query.

    0
  • Alison Mynsberge

    This isn't for the Set Property, but for Set Feature Attribute.  The input is the features returned by a query.  A workaround would be preferable to an update (for example, is there a way to define the $ForEach.item WITHIN the ForEach loop?)

     

    0
  • Ken Lyon

    Alison Mynsberge 
     

    1. For on-premises, you can download the latest installer from here:
      https://support.vertigis.com/hc/en-us/articles/10257654556306-VertiGIS-Studio-Workflow-Downloads
    2. The behaviour you see in 5.41.0 of the For Each >Item input being “unknown” has now been changed to “any” in 5.45.1. You can also use the new “Item Type” input to specify a different type if you want.
    3. You could in theory change $ForEach.item within the for loop, but its purpose is to give you the current item from the collection.
    0
  • Alison Mynsberge

    I realized that the validation error does not seem to actually impede the function of the workflow, so we left it as-is and are training new workflow developers on the exception for now.

    0

Vous devez vous connecter pour laisser un commentaire.