Cannot complete task xxx: no process d

Not able to complete a task with Rest API. I get this message.

{
"type": "RestException",
"message": "Cannot complete task aa291bcd-ce6d-11eb-a651-00505690521a: no processes deployed with key 'null' and tenant-id 'null': processDefinition is null"
}

Task is very much there and I can close it with cockpit. This is the detail with Get task/{id}

 {
    "_links": {
        "assignee": {
            "href": "/user/demo"
        },
        "execution": {
            "href": "/execution/9dd04003-ce6d-11eb-a651-00505690521a"
        },
        "identityLink": {
            "href": "/task/aa291bcd-ce6d-11eb-a651-00505690521a/identity-links"
        },
        "processDefinition": {
            "href": "/process-definition/CollectionTopFlow:8:96d8a672-ce6d-11eb-a651-00505690521a"
        },
        "processInstance": {
            "href": "/process-instance/9dd04003-ce6d-11eb-a651-00505690521a"
        },
        "self": {
            "href": "/task/aa291bcd-ce6d-11eb-a651-00505690521a"
        }
    },
    "_embedded": {
        "identityLink": [
            {
                "_links": {
                    "task": {
                        "href": "/task/aa291bcd-ce6d-11eb-a651-00505690521a"
                    },
                    "user": {
                        "href": "/user/demo"
                    }
                },
                "_embedded": null,
                "type": "assignee",
                "userId": "demo",
                "groupId": null,
                "taskId": "aa291bcd-ce6d-11eb-a651-00505690521a"
            }
        ],
        "processDefinition": [
            {
                "_links": {
                    "deployment": {
                        "href": "/deployment/96d60e60-ce6d-11eb-a651-00505690521a"
                    },
                    "resource": {
                        "href": "/deployment/96d60e60-ce6d-11eb-a651-00505690521a/resources/CollectionTopFlow.bpmn"
                    },
                    "self": {
                        "href": "/process-definition/CollectionTopFlow:8:96d8a672-ce6d-11eb-a651-00505690521a"
                    }
                },
                "_embedded": null,
                "id": "CollectionTopFlow:8:96d8a672-ce6d-11eb-a651-00505690521a",
                "key": "CollectionTopFlow",
                "category": "http://bpmn.io/schema/bpmn",
                "description": null,
                "name": "Collection Top Flow",
                "versionTag": null,
                "version": 8,
                "resource": "CollectionTopFlow.bpmn",
                "deploymentId": "96d60e60-ce6d-11eb-a651-00505690521a",
                "diagram": null,
                "suspended": false,
                "contextPath": null
            }
        ],
        "user": [
            {
                "_links": {
                    "self": {
                        "href": "/user/demo"
                    }
                },
                "_embedded": null,
                "id": "demo",
                "firstName": "XYZ",
                "lastName": "User",
                "email": "demo@demo.com"
            }
        ]
    },
    "id": "aa291bcd-ce6d-11eb-a651-00505690521a",
    "name": "Review Demo",
    "assignee": "demo",
    "created": "2021-06-16T02:39:56.651-0400",
    "due": null,
    "followUp": null,
    "delegationState": null,
    "description": null,
    "executionId": "9dd04003-ce6d-11eb-a651-00505690521a",
    "owner": null,
    "parentTaskId": null,
    "priority": 50,
    "processDefinitionId": "CollectionTopFlow:8:96d8a672-ce6d-11eb-a651-00505690521a",
    "processInstanceId": "9dd04003-ce6d-11eb-a651-00505690521a",
    "taskDefinitionKey": "review-details",
    "caseExecutionId": null,
    "caseInstanceId": null,
    "caseDefinitionId": null,
    "suspended": false,
    "formKey": null,
    "tenantId": null
}```

Can you share the REST call that you’re using to complete the task?

I was using the usual task/{id}/complete, Niali,
Finally, I resorted to java implementation, that worked fine.
Just now when I tried to reproduce, I could not with a right input. I checked with wrong json format, I get this error back.
Looks like, I got tricked since the same wrong format goes well for closing a test task, difference I see is the test task PI has no process variable there. Interesting behavior.

Spoken too fast. Facing the issue again. Managed to see it again. Rest API, Java API/Cockpit

Hello @andypr ,

does the process call any other process in a call activity?

Jonathan

1 Like

yes. It does at some later step. could that been an issue. it takes the id as a variable from dmn before.
image

Hello @andypr ,

to resolve this issue, you could insert an “async before” at “Call Subprocess”. By this, the error that happens there will not cause the whole process to be rolled back.

If this error comes up then, you can handle it in the cockpit.

Hope this helps

Jonathan

1 Like

Makes sense about not propagating and in turn the rollback. Thank you, Jonathan for the insight. Wondering if this is an ‘error’ on my part or happens with this pattern.

1 Like

Hello @andypr ,

with your engine waiting at the error, you have the possibility to inspect the stacktrace, the variables and the result of your executed decision and maybe find the problem there.

Have fun :slight_smile:

Jonathan

1 Like