Specify multiple CDT as input for a custom smart service

Hello Everyone,

 

I am creating a custom Smart Service.

My Smart Service would require that the user pass a multiple CDT as input.

I am not sure how to set this input and the proper annotation to use. In effect, I need that my custom smart service take a CDT Array or CDT list as input.

Please take a look at the code below. I am not sure if it is correct way.

Here 'FormattingPerElemTypeObj' is a CDT defined in my plugin(it has also been specified in appian-plugin.xml). I would like the smart service to take multiple CDTs of this type.  Could anyone confirm if the below code is the proper way to take such an input? Do I need a type annotation?

 

@Input(required = Required.ALWAYS)

@Name("ListOfFormattingPerElement")

// @Type() -- maybe its not required

public void setFormattingPerElemTypeObjs(FormattingPerElemTypeObj[] formattingPerElemTypeObjs) {

 this.formattingPerElemTypeObjs = formattingPerElemTypeObjs;

}

 

 

Regards,

Chetan

  Discussion posts and replies are publicly visible

  • Hello Chetan

    Did it worked? Theoretically it is valid. I haven't seen that kind of configuration when using smart services, and I guess it makes sense.
    When using the eclipse plugin to create it didn't allowed, to set parameters . which are not "Basic types", Documents, user folder, Number, String.

    Jose
  • 0
    A Score Level 1
    in reply to josep
    For now I have instead used JSON. So, I take text input (as JSON) and then convert to java objects.
    I was facing some other issues with the plugin. Strangely it was complaining that I have not defined namespace for CDTs (although I did). So , to keep things simple I used JSON as input.

    I will try with the CDT array approach. Note that in past I have created appian expression functions plugins and they accept the above syntax. But, not sure if it is same case with a smart service.