transformation.ts 2 KB
export default {
  title: 'Transform',
  description: 'Change message Payload and metadata',
  changeOriginator: {
    name: 'Change originator',
    details:
      'Related Entity found using configured relation direction and Relation Type. If multiple Related Entities are found, only first Entity is used as new Originator, other entities are discarded.<br/>Alarm Originator found only in case original Originator is <code>Alarm</code> entity.',
    description: 'Change Message Originator To Tenant/Customer/Related Entity/Alarm Originator',
    fields: {
      originatorSource: 'Originator source',
      relationsQuery: 'Relations Query',
    },
  },
  script: {
    name: 'Script',
    details:
      'JavaScript function receive 3 input parameters <br/> <code>metadata</code> - is a Message metadata.<br/><code>msg</code> - is a Message payload.<br/><code>msgType</code> - is a Message type.<br/>Should return the following structure:<br/><code>{ \'msg: <i style="color: #666;">new payload</i>,<br/>&nbsp&nbsp&nbspmetadata: <i style="color: #666;">new metadata</i>,<br/>&nbsp&nbsp&nbspmsgType: <i style="color: #666;">new msgType</i>\' }</code><br/>All fields in resulting object are optional and will be taken from original message if not specified.',
    description: 'Change Message payload, Metadata or Message type using JavaScript',
    fields: {
      jsScript: 'Transform',
      jsScriptButtonName: 'Test transfer function',
    },
  },
  toEmail: {
    name: 'To email',
    details:
      "Transforms message to email message by populating email fields using values derived from message metadata. Set 'SEND_EMAIL' output message type.",
    description: 'Transforms message to email message',
    fields: {
      fromTemplate: 'From Template',
      toTemplate: 'To Template',
      ccTemplate: 'Cc Template',
      bccTemplate: 'Bcc Template',
      subjectTemplate: 'Subject Template',
      mailBodyType: 'Mail body type',
      isHtmlTemplate: 'Dynamic mail body type',
      bodyTemplate: 'Body Template',
    },
  },
};