use of org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsWritableParameters in project carbon-identity-framework by wso2.
the class GraphBasedSequenceHandler method executeFunction.
private void executeFunction(String outcomeName, DynamicDecisionNode dynamicDecisionNode, AuthenticationContext context, Map<String, Object> data) {
SerializableJsFunction fn = dynamicDecisionNode.getFunctionMap().get(outcomeName);
FrameworkServiceDataHolder dataHolder = FrameworkServiceDataHolder.getInstance();
JsGraphBuilderFactory jsGraphBuilderFactory = dataHolder.getJsGraphBuilderFactory();
JsGraphBuilder jsGraphBuilder = jsGraphBuilderFactory.createBuilder(context, context.getSequenceConfig().getAuthenticationGraph().getStepMap(), dynamicDecisionNode);
JsGraphBuilder.JsBasedEvaluator jsBasedEvaluator = jsGraphBuilder.new JsBasedEvaluator(fn);
jsBasedEvaluator.evaluate(context, (jsConsumer) -> jsConsumer.call(null, new JsAuthenticationContext(context), new JsWritableParameters(data)));
if (dynamicDecisionNode.getDefaultEdge() == null) {
dynamicDecisionNode.setDefaultEdge(new EndStep());
}
}
Aggregations