Skip to main content
New Participant
Mar 17, 2024 12:35 PM UTC
Question

How to inject Service to custom function

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
Brainy
May 30, 2024 10:53 PM UTC

Could you share your code please?

davidj137213
Brainy
May 31, 2024 7:29 AM UTC

Try with the definition in this format.

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