Forum Discussion

FICO's avatar
FICO
Community Manager
9 years ago

get provider allowed values

I'm trying to retrieve list of allowed provider values for Value List programmatically using Prom/RMA API, but cannot find examples.

If I have access to NdRmaInstance is it possible to enumerate allowed values for a node? Should I use schema manager?

3 Replies

  • FICO's avatar
    FICO
    Community Manager

    Hi can you please provide more details? Are you using a custom provider? If yes, you can just call the getAllowedValues() method of your custom provider.

  • FICO's avatar
    FICO
    Community Manager

    Jeremy,

    I'm not using a custom provider, I was trying to find a way to call getAllowedValues() for standard Value list provider or any standard provider from: ruleset template's provider or global provider. Value list provider is just an example, I want to be able to pull data from instance of Database provider as well.

  • FICO's avatar
    FICO
    Community Manager

    Actually, was able to pull this up, here's an example:

    NdRmaInstance node = rmaTemplate.generateInstance(rulesetInstanceLocation, "one");

    // String basePath = nodegetFile().getSubInstancePath();

    String basePath = "Rulesets/one";

    NdInstanceElementNode valueHolder1 = ((NdInstanceElementNode)node.getInstanceElementNodes()[1]);

    node.setNodeValue(valueHolder1, "one");

    NdInstanceElementNode valueHolder2 = ((NdInstanceElementNode)node.getInstanceElementNodes()[3]);

    node.setNodeValue(valueHolder2, "two");

    NdInstanceElementNode valueHolder3 = ((NdInstanceElementNode)node.getInstanceElementNodes()[5]);

    // Returns list of possible options

    com.blazesoft.template.introspector.NdInstanceNodeImpl impl3 = (com.blazesoft.template.introspector.NdInstanceNodeImpl)valueHolder3;

    String[] valueOptions = impl3.getValueOptions();