Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public static wrap(payload: { task: IVariablePayload; taskService: any }): [IMessage, ICamundaService] {
const { task } = payload;
const properties = CamundaMapperProperties.map(task);
const messageWithoutSpan = {
body: task.variables.getAll(),
properties: properties as IWorkflowProps
};
// TODO: create a CamundaMessage builder
const msg = ProxyFactory.create({
body: messageWithoutSpan.body,
properties: messageWithoutSpan.properties
});
return [
msg,
// TODO: create a CamundaService builder
{
hasBeenThreated: false,
/**
* Acknowledge the message to Camunda platform
* Variables will be updated if change has been detected
*/
async ack(message: IMessage) {
if (this.hasBeenThreated) {
return;
}