Skip to content

Commit

Permalink
fix(bpmn-service): changed logger
Browse files Browse the repository at this point in the history
  • Loading branch information
akshatdubeysf committed Apr 17, 2021
1 parent c3a48d8 commit 8f8fbd5
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 5 deletions.
81 changes: 81 additions & 0 deletions services/bpmn-service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions services/bpmn-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@
"@types/camunda-external-task-client-js": "^1.3.1",
"ajv": "^8.0.5",
"camunda-external-task-client-js": "^2.1.0",
"loopback-connector-postgresql": "^5.3.0",
"loopback4-authentication": "^4.1.0",
"loopback4-authorization": "^3.2.0",
"prom-client": "^13.1.0",
"tslib": "^2.0.0"
},
"devDependencies": {
Expand Down
9 changes: 7 additions & 2 deletions services/bpmn-service/src/models/workflow-version.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ import {Workflow} from './workflow.model';
})
export class WorkflowVersion extends Entity {
@property({
type: 'number',
type: 'string',
id: true,
generated: false,
defaultFn: 'uuid',
})
id?: string;

@property({
type: 'number',
required: true,
})
version: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {inject, Provider} from '@loopback/context';
import {IWorkflowServiceConfig, WorkerImplementationFn} from '../types';
import {Client} from 'camunda-external-task-client-js';
import {Client, logger} from 'camunda-external-task-client-js';
import {WorkflowServiceBindings} from '../keys';
import {AnyObject} from '@loopback/repository';
import {ILogger, LOGGER} from '@sourceloop/core';
Expand All @@ -12,11 +12,12 @@ export class WorkerImplementationProvider
@inject(WorkflowServiceBindings.Config)
config: IWorkflowServiceConfig,
@inject(LOGGER.LOGGER_INJECT)
private readonly logger: ILogger,
private readonly ilogger: ILogger,
) {
if (config.workflowEngineBaseUrl) {
this.client = new Client({
baseUrl: config.workflowEngineBaseUrl,
use: logger,
});
} else {
throw new Error('Invalid workflowEngine Config');
Expand All @@ -28,7 +29,7 @@ export class WorkerImplementationProvider
this.client.subscribe(topic, ({task, taskService}) => {
cmd.operation({task, taskService}, (result: AnyObject) => {
if (result) {
this.logger.info(`Worker task completed - ${topic}`);
this.ilogger.info(`Worker task completed - ${topic}`);
}
});
});
Expand Down

0 comments on commit 8f8fbd5

Please sign in to comment.