cancel
Showing results for 
Search instead for 
Did you mean: 

Process Instance Post throwing error -no processes deployed with key

lambav
Champ in-the-making
Champ in-the-making
Hi

When I hit the url : http://host/activiti-rest/service/runtime/process-instances with request body
{
    "processDefinitionKey": "enablements",
    "variables": [
        {
          "name":"requestId",
          "value":"1"
        },
         {
          "name":"raisedBy",
          "value":"Vivek"
        },
        {
          "name":"termsConditions",
          "value":"Online"
        },
        {
          "name":"paperSigned",
          "value":true
        }
    ]
}

It gives me an error :
{
    "errorMessage": "no processes deployed with key 'enablements'",
    "statusCode": 400
}


But when I hit the url : http://host/activiti-rest/service/repository/process-definitions

It returns me :

{
            "id": "enablements:1:204",
            "url": "http://delmw14392.fm.rbsgrp.net:8080/activiti-rest/service/repository/process-definitions/enablement...",
            "key": "enablements",
            "version": 1,
            "name": "Enablements",
            "description": null,
            "deploymentId": "201",
            "deploymentUrl": "http://delmw14392.fm.rbsgrp.net:8080/activiti-rest/service/repository/deployments/201",
            "resource": "http://delmw14392.fm.rbsgrp.net:8080/activiti-rest/service/repository/deployments/201/resources/Enab...",
            "diagramResource": "http://delmw14392.fm.rbsgrp.net:8080/activiti-rest/service/repository/deployments/201/resources/Enab...",
            "category": "http://www.activiti.org/test",
            "graphicalNotationDefined": true,
            "suspended": false,
            "startFormDefined": false
        }

It clearly says the key is "enablements"

And if I change the key to Id , it works for me .. Any clue ?
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
I have no clue… We have thorrough testing for this (org.activiti.rest.service.api.runtime.ProcessInstanceCollectionResourceTest:159


/**
   * Test starting a process instance using procDefinitionId, key procDefinitionKey business-key.
   */
  @Deployment(resources = {"org/activiti/rest/service/api/runtime/ProcessInstanceResourceTest.process-one.bpmn20.xml"})
  public void testStartProcess() throws Exception {
    ClientResource client = getAuthenticatedClient(RestUrls.createRelativeResourceUrl(RestUrls.URL_PROCESS_INSTANCE_COLLECTION));
    ObjectNode requestNode = objectMapper.createObjectNode();
   
    // Start using process definition key
    requestNode.put("processDefinitionKey", "processOne");
    Representation response = client.post(requestNode);
    assertEquals(Status.SUCCESS_CREATED, client.getResponse().getStatus());
   
    ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().singleResult();
    assertNotNull(processInstance);
   
    JsonNode responseNode = objectMapper.readTree(response.getStream());
    assertNotNull(responseNode);
    assertEquals(processInstance.getId(), responseNode.get("id").getTextValue());
    assertTrue(responseNode.get("businessKey").isNull());
    assertEquals("processTask", responseNode.get("activityId").getTextValue());
    assertFalse(responseNode.get("suspended").getBooleanValue());

Any change you made a typo in the key when you tried it?