Using token-attr or token-dest-attr Not return value

Hi.

We are using token-attr or token-dest-attr for return the value from Vault, but the value is nothig.

Ist a Text Driver only for update workforceID, Given Name and Surname.

The update works fine, but I need to condition in case the employeeStatus does not meet a condition.

We need query a attribute that not set on filter.

The filter is:

 

Then in a Match Policy I need validate if the employeeStatus equal to D.

I try to return the value attribute using Nouns Attribute or Destination Atribute, but any way return data.

I am using  "trace message" to debug values

It is the log:

PT:    Applying rule 'Validate employeeStatus'.
PT:      Action: do-trace-message("Attr: "+token-attr("employeeStatus")+"- Dest Att:"+token-dest-attr("employeeStatus",class-name="User")).
PT:        arg-string("Attr: "+token-attr("employeeStatus")+"- Dest Att:"+token-dest-attr("employeeStatus",class-name="User"))
PT:          token-text("Attr: ")
PT:          token-attr("employeeStatus")
PT:            Token Value: "".
PT:          token-text("- Dest Att:")
PT:          token-dest-attr("employeeStatus",class-name="User")
PT:            Token Value: "".
PT:          Arg Value: "Attr: - Dest Att:".
PT:Attr: - Dest Att:

Do I need to set some before use its Nouns?

Best,

  • Suggested Answer

    0  

    Hi Cesar

    I can see some logical issues in your code.

    1. You can query any attributes, even if they are not included in your filter.

    2.token-attr("employeeStatus") (source attribute "employeeStatus") return no value. Maybe you don't have "employeeStatus" in your source?

    3. If you are trying to check the destination value before matching policy (association didn't exist yet), the engine will not be able to complete the operation (token-dest-attr("employeeStatus",class-name="User")) correctly.

    I'm not sure if OpenText DelimitedText driver is capable of processing token-attr("employeeStatus") (back query to CSV file) as you expected.

    I recommend to check Stefaan’s Generic File Driver, which has better functionality than the "native" DelimitedTaxt driver. (Stefaan, thank you very much for your hard work and contribution to the community!) 

    https://community.microfocus.com/cyberres/iga/idm/w/tips/24868/generic-file-driver-for-idm---update

    https://www.novell.com/coolsolutions/tools/18671.html

    https://github.com/scauwe/Generic-File-Driver-for-IDM?tab=readme-ov-file

    Stefaan’s Generic File Driver can make a "back query" to CSV, even it not really required in your case.

    Then in a Match Policy I need validate if the employeeStatus equal to D.

    You can use token-op-attr instead token-attr.

    Personally, I prefer to use local variables, where I store the results of the queries and use them later.

    It makes code more readable and simplifies troubleshooting. (Just personal preference)

    Example of the code that doing your validation:

    <rule>
    <description>Status check</description>
    <conditions>
    <and>
    <if-op-attr name="employeeStatus" op="available"/>
    </and>
    </conditions>
    <actions>
    <do-set-local-variable name="lvStatus" scope="policy">
    <arg-string>
    <token-op-attr name="employeeStatus"/>
    </arg-string>
    </do-set-local-variable>
    <do-if>
    <arg-conditions>
    <and>
    <if-local-variable mode="nocase" name="lvStatus" op="equal">D</if-local-variable>
    </and>
    </arg-conditions>
    <arg-actions>
    <do-trace-message>
    <arg-string>
    <token-text xml:space="preserve">Status: </token-text>
    <token-local-variable name="lvStatus"/>
    </arg-string>
    </do-trace-message>
    </arg-actions>
    <arg-actions/>
    </do-if>
    </actions>
    </rule>