diff --git a/spiffworkflow-backend/bin/run_process_model_with_api b/spiffworkflow-backend/bin/run_process_model_with_api index c62e43ad..a0ab07bc 100755 --- a/spiffworkflow-backend/bin/run_process_model_with_api +++ b/spiffworkflow-backend/bin/run_process_model_with_api @@ -30,7 +30,7 @@ modified_process_model_identifier=$(tr '/' ':' <<<"$process_model_identifier") function check_result_for_error() { local result="$1" error_code=$(jq '.error_code' <<<"$result") - if [[ -n "$error_code" ]]; then + if [[ -n "$error_code" && "$error_code" != "null" ]]; then >&2 echo "ERROR: Failed to run process instance. Received error: $result" exit 1 fi @@ -58,7 +58,7 @@ function process_next_task() { access_token=$("${script_dir}/get_token" "$username" "$password" "$realm_name") curl --silent -X POST "${BACKEND_BASE_URL}/v1.0/login_with_access_token?access_token=${access_token}" -H "Authorization: Bearer $access_token" >/dev/null result=$(curl --silent -X POST "${BACKEND_BASE_URL}/v1.0/process-instances/${modified_process_model_identifier}" -H "Authorization: Bearer $access_token") -process_instance_id=$(jq '.id' <<<"$result") +process_instance_id=$(jq -r '.id' <<<"$result") if ! grep -qE '^[0-9]+$' <<<"$process_instance_id"; then >&2 echo "ERROR: Did not receive valid process instance id when instantiating process model. result was ${result}" exit 1