using progress openedge, corticon, rollbase and node.js...

29
Track 1: The Empowered Business Using Progress OpenEdge, Corticon, Rollbase and Node.js to create a dynamic, rule- and model-driven Web-UI» Mike Liewehr, AKIOMA Software » Frank Hilhorst, Progressive Consulting

Upload: dangtu

Post on 21-Mar-2018

254 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Track 1: The Empowered Business

“Using Progress OpenEdge, Corticon, Rollbase and Node.js to create a dynamic, rule- and model-driven Web-UI”

» Mike Liewehr, AKIOMA Software » Frank Hilhorst, Progressive Consulting

Page 2: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Agenda

The Idea

The Solution

Technical overview

Architecture explained on a live sample

2

Detailed technical explanation

Q&A

Page 3: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

The Idea

3

“Building web based configuration forms for self service sales of complex products without coding”

Page 4: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

The Idea

4

Build complex, web based configuration forms without coding Examples:

…Car configurator

…Complex custom-built machines

…Online Insurance Enrollment

Technically these are all similar

Page 5: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

The Concept

Page 6: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress
Page 7: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

…code rules

…code and design UI

…build database structure

Page 8: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Dramatically reduced time-to-market

Lower costs

No errors

Page 9: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Requirements and challenges

9

Data definitions vary greatly (cars, machines, people, policies…) • Need a way to define data definition by end-user

Rich Browser-based UI • UI has to be very flexible and dynamic, support for rich

components

Complex rules, that are fully customer driven • Allow to define complex rules without coding

Performance! • UI has to adapt in realtime

Challenges that came up when building the solution…

Page 10: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

challenges

10

Challenges that came up when building the solution… …and the Products to solve them:

Data definitions vary greatly (cars, machines, people, insurance…) • Progress Rollbase

Rich UI which has to be very flexible and dynamic • AKIOMA HTML5-Client

Complex rules, that are fully customer driven • Progress Corticon

Performance! -> UI has to adapt in realtime • Node.JS / Socket.IO / node4Progress / ABL (and some magic… )

Page 11: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Solution Live Demo

11

Page 12: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Technical details

12

Server

• Rulesheet • Vocabulary

Corticon Rulesengine • Socket.IO • Node4Progress

Node.js

Client

• HTML5 • JavaScript • SWAT UI • Socket.IO

Webbrowser

• screenDS • AKIOMA

UIConnector

OpenEdge Appserver

Page 13: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Technical details

13

Server

Client

A B C D

1 3

- HTML 5 - JavaScript - SWAT UI - Socket.IO

OE Appserver - ScreenDS - AKIOMA

UI Connector

Node.js - Socket.IO - Node4Progress

Corticon Rules Engine - Rule Sheet - Vocabular

8

2 4

4

8

Page 14: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Detailed technical explanation

14

Detailed explanation of the Architecture

Page 15: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Introduction to Node & Node4Progress

15

About Node Server side javascript engine Lightweight, scalable and fast Implements non-blocking programming model

Involves using callback procedures

Allows you to build web applications with features that cannot be accomplsihed any other way

Hot technology Microsoft is going Node, Progress is going Node,

everybody is going Node

About node4progress Bridge for accessing business logic on appserver

directly from Node

Page 16: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Node4Progress Mission

16

Provide flexible and fast way to access business functionality of the appserver

Without additional effort to support new appserver

procedures Minimizing the number of middleware components

needed (e.g. Tomcat)

Page 17: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Node4Progress Features and characteristics

17

Small foot print (4MB) Fast Easy to install Npm install node4progress

Communicates with appserver through Java OpenClient

Supports 2 methods for calling an appserver procedure Calling a handler Dynamic appserver call

Employs dataset object modelled after Progress ProDataset

Page 18: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Converting output parameters of an Appserver procedure into a JSON structure

18

{"output":{ "OutputParametes-1" : ".....", "OutputParametes-2" : ".....", "dsCustomer" : {...}, “ErrMsg" : "" }, "error": "“ }

Root level output tag contains output parameters

parameters from appserver procedure Root level error tag contains error message if

execution of appserver procedure failed

Page 19: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Calling a handler

19

var node4progress = require("node4progress")(null); var handler = "handlers/CustomerHandler.p"; var inputPars = "NumCustomersToPull=2";

node4progress.callHandler(handler, inputPars, function(err,result){ console.log(result); });

Page 20: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Approach to calling any appserver procedure dynamically

20

Define appserver procedure to call Node4progress.setAppSvrProc(....);

Define each parameter Node4progress.setParameter(......);

Define callback procedure Invoke appserver procedure Node4progress.invoke(callback);

Page 21: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Calling appserver procedure dynamically (example)

21

var node4progress = require("node4progress")(null); node4progress.setAppsvrProc("handlers/CustomerHandler.p","",false,true); node4progress.setParameter( "InputPars", "longchar", "input", "NumCustomersToPull=5&batchNum=2",""); node4progress.setParameter("OutputPars","character","output","",""); node4progress.setParameter("dsCustomer","dataset-handle","output","",""); node4progress.setParameter("ErrMsg","character","output","","");

node4progress.invoke(function(err,result){ if(err){ console.log("ERROR->"+err); }else{ console.log(result); result=JSON.parse(result); } });

Page 22: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Parameter types supported

22

Data-types Character Integer Int64 Decimal Longchar Date/Date-time Table-handle Dataset-handle

Modes Input Input-output Output (append)

Page 23: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Challenges of working with data

23

When passing data as input Data needs to be formatted exactly right

i.e. In read-json format Working directly with raw JSON structure is error prone

Solution The node4progress dataset and temp-table objects

Page 24: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

The node4progress dataset object

24

Getting the data in a dataset object

dataset = node4progress.getDataSet( “dsCustomer”,

AppSvrOutputJson);

Objects provided Dataset TempTable Buffer BufferField

Method provided at the dataset level copyDataset, emptyDataset, writeJson

Methods provided at the TempTable level forEach, bufferCreate, bufferCopy, bufferDelete, copyTempTable,

emptyTempTable, findFirst, findLast, writeJson

Methods provided at the buffer level Display, writeJson

Page 25: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

The node4progress dataset object

25

Getting the data in a dataset object

dataset = node4progress.getDataSet( “dsCustomer”,

AppSvrOutputJson);

Navigating the data in a temp-table

dataset.$(“ttCustomer”).forEach(function(ttCustBuf){

custNum=ttCustBuf.$(“cust-num”).$(“bufferValue”); name=ttCustBuf.$(“name”).$(“bufferValue”);

});

Creating a new record in a temp-table

ttCustBuf = dataset.$(“ttCustomer”).bufferCreate().

Populating the fields in a newly created temp-table record

ttCustBuf.$(“Cust-num”).bufferValue(100); ttCustBuf.$(“name”).bufferValue(“frank Hilhorst”);

Page 26: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

The node4progress dataset object (continued)

26

Buffer-copy data into a temp-table buffer data = {“cust-num”: 1180, “name”:”Frank Hilhorst”,”City”:”Miami”};

ttBuf = dataset.$(“ttCustomer”).findFirst();

ttBuf.bufferCopy(data);

Sending updated dataset as input

var jsonStr = dataset.writeJson(); node4progress.setAppsvrProc("AppProc.p”."",false,true); node4progress.setParameter( "dsCustomer", "dataset-handle", "input-output", “dsOrderSchema.p”, jsonStr);

Page 27: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Summary

27

Progress offers great products

Combined they provide even more value

The whole is more than the sum of its parts

Node.JS is here to stay and provides great value for Progress partners

Page 28: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Questions?

28

Questions?

Page 29: Using Progress OpenEdge, Corticon, Rollbase and Node.js …media.progress.com/...using-progress-openedge-corticon-rollbase... · Track 1: The Empowered Business “Using Progress

Get session details & presentation downloads

Complete a survey Access the latest Progress product

literature www.progress.com/exchange2014

Visit the Resource Portal