Reading cdt fields into plugin

Hello,

We have a plugin function which accepts a datatype number of a cdt as input and it returns the fields of that cdt, type of that fields and primary key of that cdt. We were achieveing this by utilizing the private jars of Appian like com.appiancorp.type.config.xsd.DatatypeXsdHelper and other. The plugin works in Appian Version 17.4 and lower but in 18.1 it is breaking and giving error :

Error while retrievingXSDSchema for datatype [uuid {urn:persistent:types:BCD}BC_Demo]::com.appiancorp.type.config.xsd.DatatypeXsdHelper.<init>(Lcom/appiancorp/suiteapi/type/Datatype;Lcom/appiancorp/suiteapi/type/TypeService;Lcom/appiancorp/type/model/DatatypeModelRepositoryProvider;)

Is there any other way to read the XSD for datatype in the plugin? Or, any other work aroung to access the cdt fields, their types and property when passed a datatype number as input.

Any help is appreciated!

Thanks

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    I don't have a working example, but I'm pretty sure you can do this through TypeService and retrieving and instance of a Datatype:

    TypeService ts <-- injected into your plugin
    Datatype dType = ts.getType(typeId);
    dType,getInstanceProperties();
    ....

    Needs some more spiking but that's where I would start. I think there may snippets you could pull from the Excel Tools plugin source since I know it does something similar to this for being able to map CSVs to CDTs.
  • 0
    A Score Level 1
    in reply to Justin Watts
    Yes, we have done this and getting the field names inside the cdt and their respective type. But along with this, we also need primary key field name. But not getting any method or properties from Datatype and DatatypeProperties class to get this information.
Reply Children