Unable to assign Attributes to a microflow parameter.

0
This is my domain model.   Why I am unable to assign name attribute of Resource entity to the ResourceName parameter[ my aim is to ensures that we only retrieve the resource with the selected name] , while retrieving the resource entity? Though while retrieving ordersheet,I am able to do something like this
asked
2 answers
1

Hi,

Two different enumerations being used: "MyFirstModule.Name" and "MyFirstModule.ResourceName". The issue you mentioned is related to a comparison between these two enumerations.

 

To resolve this issue, you'll need to convert the enumeration value from "MyFirstModule.ResourceName" to "MyFirstModule.Name" before performing the comparison.

 

This conversion ensures that the values are of the same type and can be properly evaluated against each other.

 

Hope it helps!!!

answered
1

Hi Sanjukta,

The reason that this doesn't work is that the parameter ResourceName is an enumeration as type. You are trying to compare it to $resource/name, which is a string. This is not possible.

 

You have two options here:

  1. Change your parameter to string. If you want to use the enumeration you can set the parameter as string and fill it with getCaption(ResourceName)
  2. In your xPath change the constraint to [Name = getCaption($ResourceName).


Generally I would recommend the first. Also I can't look into your application, but it seems odd that you want to save a resourcename as an enumeration, since this means you will have a limited number of options which you have to set in your code.

 

Hope this helps!

answered