AnsweredAssumed Answered

Not able to get the Updated Category Value while getting the Process Definitions by ID using Rest

Question asked by ram_jat on Nov 28, 2017

I have configured mssql database in db.properties file, activiti-rest war file taken from Activiti-5.22.0 and deployed on Tomcat Server 9.0.1.

db.properties file:

db=mssql
jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.url=jdbc:sqlserver://localhost;databaseName=ActivitiRestDB;integratedSecurity=true;DB_CLOSE_DELAY=-1
jdbc.username=activiti
jdbc.password=activiti

and put sqljdbc42 driver jar file into WEB-INF/lib.

 

First i tried PUT Request to updated category of process-definition and updated category also stored into db successfully.

 

Before updated process-definitions with get request:

Url:

http://localhost:8080/activiti-rest/service/repository/process-definitions/vacationRequest:1:31

Response Body:

{
"id": "vacationRequest:1:31",
"url": "http://localhost:8080/activiti-rest/service/repository/process-definitions/vacationRequest:1:31",
"key": "vacationRequest",
"version": 1,
"name": "Vacation request",
"description": null,
"tenantId": "",
"deploymentId": "20",
"deploymentUrl": "http://localhost:8080/activiti-rest/service/repository/deployments/20",
"resource": "http://localhost:8080/activiti-rest/service/repository/deployments/20/resources/VacationRequest.bpmn20.xml",
"diagramResource": "http://localhost:8080/activiti-rest/service/repository/deployments/20/resources/VacationRequest.png",
"category": "http://activiti.org/bpmn20",
"graphicalNotationDefined": false,
"suspended": false,
"startFormDefined": false
}

 

PUT Request:

Url:

http://localhost:8080/activiti-rest/service/repository/process-definitions/vacationRequest:1:31

Request Body

{

   "category":"UpdatedCategory"

}

Response Body:

{
"id": "vacationRequest:1:31",
"url": "http://localhost:8080/activiti-rest/service/repository/process-definitions/vacationRequest:1:31",
"key": "vacationRequest",
"version": 1,
"name": "Vacation request",
"description": null,
"tenantId": "",
"deploymentId": "20",
"deploymentUrl": "http://localhost:8080/activiti-rest/service/repository/deployments/20",
"resource": "http://localhost:8080/activiti-rest/service/repository/deployments/20/resources/VacationRequest.bpmn20.xml",
"diagramResource": "http://localhost:8080/activiti-rest/service/repository/deployments/20/resources/VacationRequest.png",
"category": "UpdatedCategory",
"graphicalNotationDefined": false,
"suspended": false,
"startFormDefined": false
}

 

 

 

 

But after performing Get Request on same process-definition with processdefinition ID_ i'm not getting updated category.

 

GET Url:

http://localhost:8080/activiti-rest/service/repository/process-definitions/vacationRequest:1:31

 

Response Body:

{
"id": "vacationRequest:1:31",
"url": "http://localhost:8080/activiti-rest/service/repository/process-definitions/vacationRequest:1:31",
"key": "vacationRequest",
"version": 1,
"name": "Vacation request",
"description": null,
"tenantId": "",
"deploymentId": "20",
"deploymentUrl": "http://localhost:8080/activiti-rest/service/repository/deployments/20",
"resource": "http://localhost:8080/activiti-rest/service/repository/deployments/20/resources/VacationRequest.bpmn20.xml",
"diagramResource": "http://localhost:8080/activiti-rest/service/repository/deployments/20/resources/VacationRequest.png",
"category": "http://activiti.org/bpmn20",
"graphicalNotationDefined": false,
"suspended": false,
"startFormDefined": false
}

 

And also if i GET Request without process definition id , i'm getting updated categrory with all definition  for the following url:

http://localhost:8080/activiti-rest/service/repository/process-definitions

 

 

Please tell me about this.Where i commit mistake any configuration or way to get updated category of process definition by ID.

Outcomes