Contract data from a user form is not available for operations

1
0
-1

I have a bonita form that is sending the form data properly:

curl 'http://127.168.0.1:8080/bonita/portal/resource/taskInstance/Support%20Ticket/3.5.0/Support%20Request%20Details/API/bpm/userTask/1234567/execution' \
  -H 'Connection: keep-alive' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'DNT: 1' \
  -H 'X-Bonita-API-Token: blahblahblah' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H 'Cookie: bonita.tenant=1; JSESSIONID=blahblahblah; X-Bonita-API-Token=blahblahblah; BOS_Locale=en' \
  --data-binary '{"supportRequestInput":{"updated_date_time":"2020-08-05T19:34:09.536Z","due_date_time":"2020-08-10T19:34:09.536Z","completed_date_time":null,"requester":"John Doe","requestor_id":7,"public_request":true,"status":"New","title":"SUPPORT-MEDIUM-1596656049027","notes":"Comment form the bonita portal","description":"New support request description\r\nType: support\r\nService: Portal\r\nLocation: portal ","priority":"medium","internal_priority":"medium","type":"support","request_type":"support","request_method":"portal","process_id":272784,"customer_id":"99999","user_id":7,"jira_ticket":"JIRA-001","location":"portal selected","impact_to_customer":"Medium","impact":"Low","assignees":[],"related_tickets":[],"request_log":[],"comments":[],"attachments":[],"notifications":[],"related_services":[],"test_results":[],"resolution_notes":"","billing_details":[],"outage_details":[],"general_support_question_type":"","general_support_question":"","general_support_equipment":"","service":"Portal","record_id":0}}' \
  --compressed \
  --insecure

The first operation is a script that gets the assigned task users name and prepends to a comment made. It returs a string and applies it to the comment database field value.

import org.bonitasoft.engine.api.IdentityAPI;
import org.bonitasoft.engine.identity.User;
IdentityAPI identity = apiAccessor.getIdentityAPI();
def processInstance = apiAccessor.processAPI.getProcessInstance(processInstanceId)
User user = identity.getUser(taskAssigneeId);
return user.firstName + ' ' + user.lastName.take(1) + '. - ' +supportRequestInput.notes

The error states "org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: Expression supportRequestInput.notes with content = < [[quoted groovy code]] depends on supportRequestInput is neither defined in the script nor in dependencies.

For the life of me I can't figure out why the supportRequestInput would not be defined or accessible when it is contract input value and the form is executing the task with that value.

1 answer

1
0
-1

Never mind. I have no idea what it was. I just redeployed the process and restarted. Seems like some caching perhaps.

Notifications