Uploaded image for project: 'OpenAM'
  1. OpenAM
  2. OPENAM-16869 Improve Scripting documentation
  3. OPENAM-16856

Scripted decision node's "accessing shared state data" documentation incorrect

    Details

      Description

      In the doc here  https://backstage.forgerock.com/docs/am/7/authentication-guide/scripting-api-node.html#scripting-api-node-sharedState  it says:

       

       

      Scripted Decision Node scripts can get access to the shared state within the tree by using the sharedState, transientState, and secureState objects using the getState method:

      And there is an example:

       

       

      var currentAuthLevel = getState("authLevel");

      When I tried to get the current "username" from the sharedState like this in a scripted decision (JS) node, it does not work (returns undefined).

      I had to use 

      var currentUsername = sharedState.get("username");

      which is how it works in 6.5.x.

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                chris.lee Chris Lee
                Reporter:
                sandeep.chaturvedi Sandeep Chaturvedi
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: