GithubHelp home page GithubHelp logo

wicecrm-transformer's Introduction

wice-jsonata-transform-component NPM version Build Status Dependency Status

Dedicated Wice CRM data transformation component for Open Integration Hub platform based on JSONata

Authentication

This component requires no authentication.

How it works

The component supports two actions - Transform to OIH and Transform from OIH. This means that the component takes the incoming message body from the previous step and creates a new expression in a JSON format.

The new generated JSON object has specific properties which represent the input/output for the next/previous component in the flow.

The uses a fact that JSONata expression is a superset of JSON document so that by default any valid JSON document is a valid JSONata expression.

Let's see how the action Transform from OIH works. For example let's take this sample incoming message body from OIH Database component and transform it to a valid Wice object:

{
  "rowid": msg.body.applicationRecordUid,
  "tenant": msg.body.tenant,
  "name": msg.body.lastName,
  "firstname": msg.body.firstName,
  "salutation": msg.body.salutation,
  "birthday": msg.body.birthday
}

The result of that transformation will be the following JSON document:

{
  "rowid": "198562",
  "tenant": "617",
  "name": "Doe",
  "firstname": "John",
  "salutation": "Mr.",
  "date_of_birth": "04.11.1980"
}

The action Transform to OIH works the same way. Let's take this incoming message body from Wice component:

{
  "recordUid": msg.body.rowid,
  "oihLastModified": jsonata("$now()").evaluate(),
  "lastName": msg.body.name,
  "firstName": msg.body.firstname,
  "salutation": msg.body.salutation,
  "birthday": msg.body.birthday,
}

The result of that transofrmation will be the following JSON document:

{
  "recordUid": "198562",
  "oihLastModified": "2018-06-11T09:41:45.679Z",
  "lastName": "Doe",
  "firstName": "John",
  "salutation": "Mr.",
  "birthday": "04.11.1980"
}

License

Apache-2.0 © elastic.io GmbH

wicecrm-transformer's People

Contributors

shterion avatar zubairov avatar svenhoeffler avatar spyanev avatar zuker avatar jkopen avatar pnedelko avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.