How to link a button to the failed outcome?

I am currently developing a script that is deployed in a Tree using the Scripted Decision node.

My code has used the Action.send and now I want to proceed and use the Action.goTo. However this always results in a login failed generic error message.

“action = fr.Action.goTo(“False”).build();” does not work and always breaks the code.

var fr = JavaImporter(
org.forgerock.openam.auth.node.api,
org.forgerock.openam.auth.node.api.Action,
javax.security.auth.callback.TextOutputCallback,
javax.security.auth.callback.ConfirmationCallback
)
///some API Requests and processing
var response = httpClient.send(request).get();
var data = JSON.parse(response.getEntity().getString());

var nodeConfig = {
BUTTONS: [“OK”]
};

if (data.resultCount == 0) {
logger.error(“has no value”);
outcome = “False”;
} else {
var uid = data.result[0]._id;
var status = data.result[0].status;
if (uid && status == “Active”) {
outcome = “True”;
} else {
var infoMessage = "Sorry your account status is: " + status;
var level = fr.TextOutputCallback.INFORMATION;
action = fr.Action.send(
fr.TextOutputCallback(level, infoMessage),
fr.ConfirmationCallback(fr.ConfirmationCallback.INFORMATION,nodeConfig.BUTTONS,0)
).build();
//action = fr.Action.goTo(“False”).build();
}
}
//outcome = “False”;

Are you using the old scripting engine or the next-gen scripting engine? There are some changes in syntax with the next-gen engine as highlighted here. Next-generation scripts :: ForgeRock Identity Cloud Docs

As for how to link a failed outcome, you need to specify the expected outcomes in the scripted node configuration.

image

Also @Teng_Aldrich can you paste here the exception?

Sorry, I forgot to mention that my setup is on-premis. Not Identity Cloud. I dont think I can use the Next-Generation Scripting in the On-Premis version.

As for how to link a failed outcome, you need to specify the expected outcomes in the scripted node configuration.

action = fr.Action.goTo(“False”).build() This is how I planned to complete the script but the button that I have does not link to the failed outcome. But it looks like I cannot have 2 actions simultaneously. If I comment the fr.Action.send… and uncomment the .goTo it works will work but the text and button will not be displayed anymore.

Here. But Im not sure if this is related to the script or because a mapping is running.

ERROR: Unrecognized token ‘scope’: was expecting (JSON String, Number, Array, Object or token ‘null’, ‘true’ or ‘false’)

WARN: objectChanged called with an empty name
c.s.i.i.IdRepoListener: 2023-11-22 09:36:40,735: Thread[OpenDJ LDAP SDK Client Worker(37)]: TransactionId[9535b1a0-1c1e-45cb-b40c-e6da228159b4-951143]
WARN: objectChanged called with an empty name
c.s.i.p.p.UserSelfCheckCondition: 2023-11-22 09:36:41,073: Thread[https-jsse-nio-8443-exec-10]: TransactionId[a29fcbf1-d74e-405c-a263-74913db33057-857405/0]