Access to connector variable in java expression

I use http-connector plugin to call some rest api in my process. In javascript inline script I access to the response by connector.getVariable("response") script. I want to use connector in java expression but I got below error:
org.camunda.bpm.engine.ProcessEngineException: Unknown property used in expression: ${documentParser.parse(connector.getVariable("response"))}. Cause: Cannot resolve identifier 'connector'

The output parameter element type is text:
<camunda:outputParameter name="documentModel">${documentParser.parse(connector.getVariable("response"))}</camunda:outputParameter>

Hi @Mohammad_Mahdavi,

You can set response as the output parameter of Connector and use it directly: ${logUtil.taskCompleted(taskId,statusCode,response)}

The response in my work is so large. So I don’t want to store the response as a variable in process. Instead of this this I clear the response and save the cleaned response in process. Is there any way to pass the response of connector to java delegate task?

@Mohammad_Mahdavi, Could you explain your scenario a bit? One thing you can do is call the expression from Script task of Output Parameters of Connector. This way the response wouldn’t persist.

I want to do exactly that. How can I call the java delegate code or Spring Bean in script task?

You cannot call a Java Delegate from Script. Refer to the below image for using bean.