UNPKG

@villedemontreal/workit-bpm-client

Version:

Camunda BPM client for WorkIt that works with Camunda platform powered by TypeScript

42 lines 1.79 kB
"use strict"; /* * 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 === null ? undefined : task.businessKey, processInstanceId: !task.processInstanceId ? undefined : 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 === null ? undefined : task.retries, topicName: !task.topicName ? undefined : task.topicName, workerId: !task.workerId ? undefined : 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 && typeof meta.customHeaders === 'object' && meta.customHeaders !== null) { return meta.customHeaders; } return {}; } } exports.CamundaMapperProperties = CamundaMapperProperties; //# sourceMappingURL=camundaMapperProperties.js.map