POST request via camunda

Hello,

I am trying to model a workflow where a POST request is made. This workflow is supposed to create a new employee record using the data from the payload. The model looks like this.

diagram_19.bpmn (8.6 KB)

I am getting an error when the flow reaches to Add employee.

On postman the call gets executed with no issues.
I can confirm that the url is correct and authentication is done on the server side. I can see that the POST request from the workflow is logged on the server but no mention of any issue.

The error I see on operate is,

{
  "name": "GeneralError",
  "message": "Cannot read property 'id' of undefined",
  "code": 500,
  "className": "general-error",
  "data": {},
  "errors": {},
  "status_code": 500,
  "reason_code": "Internal Server Error"
}

I suppose what i am trying to find out is if i have modelled the workflow correctly specifically when it comes to setting up the JSON payload.

The json payload as retreived from operate looks like,

{
    "employmentType": "",
    "onboardingCheck": false,
    "middleName": "",
    "permittedDependents": "",
    "personalEmail": "bisous@mail.com",
    "businessRoleId": 1,
    "lastName": "Gama",
    "gradeId": "",
    "leaveGroupId": 1,
    "businessPhone": "",
    "leaveAllowance": 0,
    "personalAddress": "",
    "employeeCode": "",
    "dateOfBirth": "1978-08-08",
    "firstName": "Alpha3",
    "citizenship_countryId": "",
    "nationality": "Afghan",
    "salutation": "Mr",
    "personalPhone": "",
    "maritalStatus": "",
    "leaveApprover": 1,
    "residencyVisaLocation": "",
    "workingPatternId": 1,
    "businessEmail": "Alpha3@mail.com",
    "preferredName": "Alpha3",
    "projectedEmploymentDate": "1978-08-08",
    "startDate": "2021-05-30",
    "currentYearLeaveAllocation": 0,
    "gender": ""
}

Thank you

Hi Bisoux,
thanks for contacting the forum!
I’ve a couple of questions:

  1. Which is exactly the error you get?

  2. the “Add employee” is a service task, you called the Task Definition Type: “legacy”.
    I guess you have created a worker that makes the post call right? can you share the code?

Thanks!