Notify task completion using javascript in execution listener

Hello Team,

I am using http-connector to call external REST api using inline script. Is it possible to call another Rest endpoint using javascript in the execution listener part to notify the external system that the service task is completed.

Is there any other way to notify an external api that the the service task/user task etc is completed via script?

@priyank see Replacing Http-Connector with Jsoup usage

Thanks @StephenOTT . I will look into the Jsoup

But is it possible to call a rest endpoint from execution listener using javascript?

Yes. But you need a http lib or you need to use java.net libs from within JS.

1 Like

Hello,

I am using Camunda engine with a .NET application and I need to write a script that calls an API when a task is assigned. I created a task listener for assignement but I get the error: “org.graalvm.polyglot.PolyglotException: ReferenceError: XMLHttpRequest is not defined’”

I tryed fetch but I got the same error. Even with jquery I got a similar message.

Is there any example on how to do this? I searched for java.net libs but I reached a dead end. Do I have to change anything in Camunda’s configuration to be able to use the usual javascript methods?

Thank you

Hi @pigaia88,

This is a really old thread - so perhaps you can create a new topic and maybe even upload the script you’re running as well as explaining what version of camunda and java you’re running.

-Niall

1 Like