Skip to content

Commit

Permalink
fix(bpmn-service): fix description missing in model but present in mi…
Browse files Browse the repository at this point in the history
…grations (#343)

* fix(bpmn-service): fix description missing in model but present in migration

GH-340

* fix(bpmn-service): fix description missing in model but present in migrations

GH-340
  • Loading branch information
akshatdubeysf authored Sep 27, 2021
1 parent 6912bc2 commit bde58f7
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 10 deletions.
11 changes: 10 additions & 1 deletion packages/core/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,14 @@
"Pubnub returned with error ! {\"name\"": "\"PubNubError\",\"status\":{\"message\":\"Missing Channel\",\"type\":\"validationError\",\"error\":true}}",
"AWS SES Config missing !": "AWS SES Config missing !",
"invalid input syntax for type uuid": " \"{\"to\":[{\"id\":\"14335492-38b6-2520-f1ab-b1b73aa5214c\",\"name\":\"Admin User\",\"type\":0}]}\"",
"EntityNotFound": "EntityNotFound"
"EntityNotFound": "EntityNotFound",
"Invalid Credentials": "Invalid Credentials",
"Token Invalid": "Token Invalid",
"User not found !": "User not found !",
"Required parameter token is missing!": "Required parameter token is missing!",
"Token Expired": "Token Expired",
"Not Found": "Not Found",
"WorkflowVersionNotFound": "WorkflowVersionNotFound",
"[{\"instancePath\"": "\"/valueB\",\"schemaPath\":\"#/properties/valueB/type\",\"keyword\":\"type\",\"params\":{\"type\":\"string\"},\"message\":\"must be string\"}]",
"WorkflowNotFound": "WorkflowNotFound"
}
9 changes: 9 additions & 0 deletions services/bpmn-service/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@
},
"inputSchema": {
"type": "object"
},
"description": {
"type": "string"
}
},
"required": [
Expand All @@ -370,6 +373,9 @@
},
"inputSchema": {
"type": "object"
},
"description": {
"type": "string"
}
},
"required": [
Expand All @@ -392,6 +398,9 @@
},
"inputSchema": {
"type": "object"
},
"description": {
"type": "string"
}
},
"additionalProperties": true,
Expand Down
30 changes: 21 additions & 9 deletions services/bpmn-service/openapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ HTTPBearer
const inputBody = '{
"name": "string",
"bpmnFile": "string",
"inputSchema": {}
"inputSchema": {},
"description": "string"
}';
const headers = {
'Content-Type':'application/json',
Expand All @@ -219,7 +220,8 @@ const fetch = require('node-fetch');
const inputBody = {
"name": "string",
"bpmnFile": "string",
"inputSchema": {}
"inputSchema": {},
"description": "string"
};
const headers = {
'Content-Type':'application/json',
Expand Down Expand Up @@ -248,7 +250,8 @@ fetch('/workflow/{id}',
{
"name": "string",
"bpmnFile": "string",
"inputSchema": {}
"inputSchema": {},
"description": "string"
}
```

Expand Down Expand Up @@ -412,7 +415,8 @@ HTTPBearer
const inputBody = '{
"name": "string",
"bpmnFile": "string",
"inputSchema": {}
"inputSchema": {},
"description": "string"
}';
const headers = {
'Content-Type':'application/json',
Expand All @@ -439,7 +443,8 @@ const fetch = require('node-fetch');
const inputBody = {
"name": "string",
"bpmnFile": "string",
"inputSchema": {}
"inputSchema": {},
"description": "string"
};
const headers = {
'Content-Type':'application/json',
Expand Down Expand Up @@ -469,7 +474,8 @@ fetch('/workflow',
{
"name": "string",
"bpmnFile": "string",
"inputSchema": {}
"inputSchema": {},
"description": "string"
}
```

Expand Down Expand Up @@ -690,7 +696,8 @@ Workflow
{
"name": "string",
"bpmnFile": "string",
"inputSchema": {}
"inputSchema": {},
"description": "string"
}

```
Expand All @@ -704,6 +711,7 @@ NewWorkflow
|name|string|true|none|none|
|bpmnFile|string|true|none|none|
|inputSchema|object|true|none|none|
|description|string|false|none|none|

<h2 id="tocS_WorkflowDto">WorkflowDto</h2>
<!-- backwards compatibility -->
Expand All @@ -716,7 +724,8 @@ NewWorkflow
{
"name": "string",
"bpmnFile": "string",
"inputSchema": {}
"inputSchema": {},
"description": "string"
}

```
Expand All @@ -730,6 +739,7 @@ WorkflowDto
|name|string|true|none|none|
|bpmnFile|string|true|none|none|
|inputSchema|object|true|none|none|
|description|string|false|none|none|

<h2 id="tocS_WorkflowDtoPartial">WorkflowDtoPartial</h2>
<!-- backwards compatibility -->
Expand All @@ -742,7 +752,8 @@ WorkflowDto
{
"name": "string",
"bpmnFile": "string",
"inputSchema": {}
"inputSchema": {},
"description": "string"
}

```
Expand All @@ -756,6 +767,7 @@ WorkflowDtoPartial
|name|string|false|none|none|
|bpmnFile|string|false|none|none|
|inputSchema|object|false|none|none|
|description|string|false|none|none|

<h2 id="tocS_ExecuteWorkflowDto">ExecuteWorkflowDto</h2>
<!-- backwards compatibility -->
Expand Down
1 change: 1 addition & 0 deletions services/bpmn-service/src/__tests__/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const MOCK_CAMUNDA = 'https://mock-camunda.api/engine-rest';
export const firstTestBpmn: WorkflowDto = new WorkflowDto({
name: 'first-bpmn',
bpmnFile: JSON.stringify(['topic1', 'topic2']),
description: 'test description',
inputSchema: {
type: 'object',
properties: {valueA: {type: 'string'}, valueB: {type: 'string'}},
Expand Down
2 changes: 2 additions & 0 deletions services/bpmn-service/src/controllers/workflow.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export class WorkflowController {
name: workflowDto.name,
provider: workflowResponse.provider,
inputSchema: workflowDto.inputSchema,
description: workflowDto.description,
});

const newWorkflow = await this.workflowRepository.create(entity);
Expand Down Expand Up @@ -136,6 +137,7 @@ export class WorkflowController {
name: workflowDto.name,
provider: workflowResponse.provider,
inputSchema: workflowDto.inputSchema,
description: workflowDto.description,
});

await this.workflowRepository.updateById(id, entity);
Expand Down
5 changes: 5 additions & 0 deletions services/bpmn-service/src/models/workflow-dto.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ export class WorkflowDto extends Model {
})
inputSchema: AnyObject;

@property({
type: 'string',
})
description: string;

constructor(data?: Partial<WorkflowDto>) {
super(data);
}
Expand Down

0 comments on commit bde58f7

Please sign in to comment.