Send payload over http connector

HI

I want to send payload over rest http connector to invoke ansible job.

I am using following javascript.

var processInstanceId = execution.getProcessInstanceId();
var ansiblePayload = S(‘{}’);

var extra_vars = S(‘{}’);
extra_vars.prop(‘camunda_process_instance_id’, processInstanceId);

ansiblePayload.prop(‘extra_vars’, extra_vars);

execution.setVariable(‘ansiblePayload’, ansiblePayload);

I am able to invoke the ansible job, however the job fails as the extravars is empty.

please help to address this issue.

Regards
Prabhu

@pvalluri You can refer these examples:

Hi Aravindhrs

Thanks for the reply…

my requirement is camunda task to invoke external ansible job via http connector.

Regards
Prabhu

Hi All

I want to invoke Ansible job from the camunda process along with pay load over http connector .
for this I am using javascript. pls find the bpmn and js file attached.InvokeAnisble.bpmn (3.7 KB) prepareAnsiblePayload.txt (295 Bytes)

I followed the below article to deploy the js file and bpmn , however i am ending up the resource not found error.

Deploying External Scripts with Camunda REST API | by Stephen Russett | Medium

error details when i run the process.

The process could not be started. : Cannot instantiate process definition Ansible:1:93dc3273-c6a0-11ea-a3d7-0242ac12000c: ENGINE-09024 Unable to find resource at path prepareAnsiblePayload.js

please suggest , how this can be addressed?

also please advise me if this can be achieved by any other method.

Regards
Prabhu