Skip to main content
March 17, 2024
Question

How to inject Service to custom function

  • March 17, 2024
  • 2 replies
  • 0 views

Hi ,

As pe the  Function Plug-ins - Appian 22.2 , We can inject the service ( ContentService ) as a argument to the custom functions. When I try to inject as  below

public String dowork(@Parameter String para, ContentService cs) {

}

I am getting below error.

: Unable to find a required instance of ContentService.

Is there any other annotation or setting ?

Thanks & Regards,

Chaminda

2 replies

davidj137213
May 30, 2024

Could you share your code please?

davidj137213
May 31, 2024

Try with the definition in this format.

@Function
public String doWorkd(ContentService cs,
@Parameter String parameter,
) throws AppianException {