Code Monkey home page Code Monkey logo

exp19-custom-plugins's Introduction

exp19-custom-plugins

This repo contains 2 examples of cutom plugins that are tied to different events.

ℹī¸ In the current examples I'm using the promise syntax as opposed to the async/await syntax, but either can be used.

Loan Change Audit

This plugin demonstrates how you can create a plugin to control the flow of a loan when the loan object is changed. In this case everytime an LO edits a field on a form, standard, custom or otherwise; the plugin captures that change and displays it in a popup as an audit log giving the ability to change the data.

Key Concepts

  • Subscribe to loan change events
     elli.script.subscribe('loan', 'change', <MyEventHandler>);
    
  • Accessing objects from the scripting framework
     elli.script.getObject('loan').then((loanObj) => { //do something with loanObj here });
    
  • Applying changes to a loan object via the scripting framework
     all()
     getField("<fieldId>")
     setFields(<fieldMap>)
     merge()
     isReadOnly()
     calculate()
    

Login Welcome Message

This plugin demonstrates how you can create a plugin to execute a custom flow during the login process. In this case when the LO logs in the plugin is making a call to a service to get a list of hot items that they should be focusing on for the day. These hot items are then dispalyed via a popup for the LO to see.

Key Concepts

  • Subscribe to application login event
     elli.script.subscribe('application', 'login', <MyEventHandler>);
    
  • Accessing objects from the scirpting framework
     elli.script.getObject("http").then((myHttpObj) => { //do something with myHttpObj here });
    
  • Using the HTTP object for making external calls via the scripting framework
     get("<url>", <headerObjOrAccessToken>)
     post("<url>", <contentObj>, <headerObjOrAccessToken>)
     patch("<url>", <contentObj>, <headerObjOrAccessToken>)
     put("<url>", <contentObj>, <headerObjOrAccessToken>)
     delete("<url>", <headerObjOrAccessToken>)
    

exp19-custom-plugins's People

Contributors

em-dmcginnis avatar

Stargazers

 avatar Ramu Pulipati avatar Spencer Simons avatar Aaron Lawrence avatar

Watchers

Anthony 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.