@villedemontreal/workit-bpm-client
Version:
Camunda BPM client for WorkIt that works with Camunda platform powered by TypeScript
42 lines • 1.54 kB
JavaScript
/*
* Copyright (c) 2025 Ville de Montreal. All rights reserved.
* Licensed under the MIT license.
* See LICENSE file in the project root for full license information.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.CamundaMapperProperties = void 0;
class CamundaMapperProperties {
static map(task) {
return {
activityId: task.activityId,
businessKey: task.businessKey,
processInstanceId: task.processInstanceId,
workflowDefinitionVersion: Number(task.processDefinitionId.split(':')[1]),
workflowInstanceKey: task.processDefinitionId,
workflowKey: task.processDefinitionKey,
bpmnProcessId: task.processDefinitionKey,
customHeaders: CamundaMapperProperties._getCustomHeaders(task),
jobKey: task.id,
retries: task.retries,
topicName: task.topicName,
workerId: task.workerId,
lockExpirationTime: new Date(task.lockExpirationTime),
};
}
static unmap(props) {
throw new Error('Not Implemented yet');
}
static _getMeta(task) {
return task.variables.get('_meta');
}
static _getCustomHeaders(task) {
const meta = CamundaMapperProperties._getMeta(task);
if (meta && meta.customHeaders) {
return meta.customHeaders;
}
return {};
}
}
exports.CamundaMapperProperties = CamundaMapperProperties;
//# sourceMappingURL=camundaMapperProperties.js.map
;