Building Satellite Rollbase Applciation for an existing OpenEdge application

Similar documents
Building Hybrid mobile apps for Rollbase application using PDO

Kendo UI Builder. For Business Apps, UI/UX Reigns Supreme

ROLLBASE ACCESS TO ABL BUSINESS LOGIC VIA OPENCLIENT

PROGRESS OPENEDGE PRO2

5 KEY REASONS FOR USING TELERIK PLATFORM MBAAS

OpenEdge Change Data Capture and the ETL Process WHITEPAPER AUTHOR : LAKSHMI PADMAJA

Provide Real-Time Data To Financial Applications

AUTHORIZED DATA TRUNCATION

Ebay Integration User Guide 0.0.1

Progress OpenEdge. > Getting Started. in the Amazon Cloud.

Advanced ODBC and JDBC Access to Salesforce Data

Accessing the Progress OpenEdge AppServer. From Progress Rollbase. Using Object Script

This guide outlines how to Search for products/services, and send requisitions for approval to become purchase orders.

Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services

USER MANUAL. MageMob Admin TABLE OF CONTENTS. Version: 1.0.0

USER MANUAL. Calendar 365 TABLE OF CONTENTS. Version: 4.0

Ebay Integration User Guide 0.0.1

Delete Personally Identifiable Information About a User from Sitefinity CMS

Catch Integration - User Guide

Magento Integration Manual (Version /15/2017)

Kendo UI Builder by Progress : Using Kendo UI Designer

Eclipse Business Connect XML. Release (Eterm)

My Publications Quick Start Guide

TeamViewer User Guide for Microsoft Dynamics CRM. Document Information Version: 0.5 Version Release Date : 20 th Feb 2018

Magento 2 Extension. ( Version ) STORE.DCKAP.COM

COTY PROJECT USER MANUAL

Fyndiq Magento Extension

Better Translation Technology. XTM Connect for Drupal 8

Magento 2 Integration Manual (Version /10/2017)

Oracle Cloud. Using the Google Calendar Adapter Release 16.3 E

Custom SharePoint Workflows

Work 365 Help. User Guide IOTAP MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT.

Sage ERP Accpac Online 5.5

Sears-Magento Integration Guide 0.0.1

Oracle Cloud Using the Eventbrite Adapter. Release 17.3

Kendo UI. Builder by Progress : Using Kendo UI Designer

Using Script Modules. Using Script Modules. This chapter contains the following sections: Using Script Modules, page 1

Buyers Work Centre: Amending Orders

Oracle Taleo Cloud for Midsize (Taleo Business Edition) Release 17B2. What s New

Partner estore. User Guide 24/7 Partnering Solutions

RingCentral for Microsoft Dynamics CRM. Installation & User Guide

Requester Quick Reference

HP Project and Portfolio Management Center

Connector for OpenText Content Server Setup and Reference Guide

openedge 11.0 Progress OpenEdge

Administrator Manual. Last Updated: 15 March 2012 Manual Version:

Menu Analysis Application Tour Guide for Customers

Visual Workflow Implementation Guide

Okta SAML Authentication with WatchGuard Access Portal. Integration Guide

Easily communicate with customers using up-to-date, customized templates. Allow customers to return products as an existing customer or guest.

Salesforce Enterprise Edition Upgrade Guide

Adobe Document Cloud esign Services. for Salesforce Version 17 Installation and Customization Guide

Newegg Elite Seller Program Guide

Oracle Express CPQ for Salesforce.com. What s New in Spring 16

Entrust Cloud Enterprise. Enrollment Guide

MIGRATING MOBILE APPS. How to migrate Rollbase and OpenEdge Mobile Apps to the Telerik Platform

Custom Stock Status. Magento Extension User Guide. Official extension page: Custom Stock Status. User Guide: Custom Stock Status

Microsoft Office SharePoint. Reference Guide for Contributors

Internet Data Exchange - General Navigation - View and Confirm Purchase Orders and Scheduling Agreements

AWS Service Catalog. User Guide

easysourcing Bid Line Item Reference Guide

What's New in ActiveVOS 7.1 Includes ActiveVOS 7.1.1

Bomgar PA Integration with ServiceNow

Oracle Cloud Using the Google Calendar Adapter. Release 17.3

18B. Integrating Oracle Commerce Cloud and Oracle Responsys

Fyndiq Prestashop Module

Jet-Magento Integration Guide

Oracle Big Data Cloud Service, Oracle Storage Cloud Service, Oracle Database Cloud Service

Requisitioner Training Manual

Product Labels User Guide

PTC Windchill Quality Solutions Extension for ThingWorx Guide

V2 Premiums and Fulfillment

Act! Marketing Automation

Administrator Manual. Last Updated: 15 March 2012 Manual Version:

Office Adapters for Quark Publishing Platform

User Guide. Document Version: 1.0. Solution Version: 365_102017_3_4

Oracle Cloud Using the MailChimp Adapter. Release 17.3

Installation and Configuration Manual

IMPLEMENTING SINGLE SIGN-ON (SSO) TO KERBEROS CONSTRAINED DELEGATION AND HEADER-BASED APPS. VMware Identity Manager.

Country Clipper Dealer Help Guide

Setting Up Salesforce

CPSM MEDITECH Inventory Requisition Options. Page 1 of 49. Created: April 30, 2015 Revised: April 10, 2018

Shopping Basket and Order Requirements

CUBuyplusR. Browser s Guide

Purchase Order Creating a Manual Purchase Order

Developer Cockpit. Introduction 1. Prerequisites 2. Application Lifecycle in MindSphere 3. User interfaces "Developer Cockpit" 4

Flex Supplier Portal How to use Flex Supplier Portal

Microsoft Dynamics GP. Extender User s Guide

Oracle Financial Services Governance, Risk, and Compliance Workflow Manager User Guide. Release February 2016 E

Entitlement Management Implementation Guide

8. To return to the Profile screen, click My Profile on the top left of the page, above your name.

VERINT EFM 8.0 Release Overview

SharePoint 2013 Power User EVALUATION COPY. (SHP version 1.0.1) Copyright Information. Copyright 2013 Webucator. All rights reserved.

Info Input Express Network Edition

All About Catalog. Contents. West Virginia University Information Technology Services. ecommerce End User Advanced Guide

Bonanza Integration - User Guide

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

ishipdocs User Guide

Oracle Adapter for Salesforce Lightning Winter 18. What s New

Stock Notification Magento2 Extension

Transcription:

Building Satellite Rollbase Applciation for an existing OpenEdge application Authors: Ganesh Cherivirala Dr Ganesh Neelakanta Iyer 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.

In this whitepaper, we describe one use case for understanding how to build a satellite application in Rollbase for complementing an existing OpenEdge application. Problem Statement: For an existing OpenEdge application point of sale system (e.g. Subway, Post Office), we want to build a Satellite Stock Replenishment Rollbase application for the items sold in the point of sale system. The schema of the existing Rollbase application looks as below: The stock replenishment app s schema is as below: 2

Note: The above schemas are just samples to understand the high level picture. We might use some different names/fields in the following example. Application run time flow is illustrated below. 3

For the above application to be functioning, the development flow for the Satellite application is as illustrated below: In the rest of this document, we are going to build the application for which the broad steps are illustrated below: 4

Pre-requisites: OpenEdge Data object service is ready using table for the ITEMS and accessible using Catalog URI (JSON) Kendo UI, which is acting as POS (point of sales system) is available and using OpenEdge Data object service (Using ITEMS table) in a browser. 5

Start building the Rollbase application Start creating Rollbase New Application using below option in Rollbase. Click on hamburger menu Choose New Application option. Create a New application dialog popup, select let me build it my way option. 6

Fill up the Application Name (Stock Replenishment) then save. A new application is created. Click plus icon select a new object (with Tab) from external metadata in What do you want to create? dialog. 7

Click create button and select OpenEdge Service option. Click on Browse button and provide the Catalog URI of existing OpenEdge Service. Catalog URI: http://hostname:port/items/static/itemsservice.json Click on Open button and wait for a while until it loads. Provide a service URI as: http://hostname:port/<service name> Click on NEXT button until Create Button is visible and then click. Now an OpenEdge object (aka OESO object) in Rollbase is created successfully. Click on Return to <Application name> link at top right to access the created object. Access the object definition 8

Click Edit option and navigate to OpenEdge Service section, set Clear List Cache After to 0 from 5 and save the object. Click on Return to <Application name> link at top right to access the object. Access the records in Kendo UI and cross check the records in OESO object and notice both are identical. Start creating the Rollbase native object with below integration name. Click PLUS icon and select A new Object (with TAB) and provide application name as below. Object Name/ Singular Name Stock Management Integration Name Stock_Management Scroll down to navigate to Advanced Attribute Description under Object attributes. Integration Name: Rollbase identifies everything in Rollbase uniquely using the concept of Integration Name. Whenever you refer to anything in Rollbase (including app name, object name, field names, relationship names etc, you should always refer via the integration name. Select the Workflow checkbox. Click on save and then following save button. Navigate to object definition of Stock Managements and start creating the required fields as below. 9

Click on Fields. Click on New Field, while creating the select All under views Field Type Field Name Integration Name Other details Auto number Stock Management ID Stock_Management _ID_SM Display Format as SM#{YYYY}- {0000000} Starting Number as 1 Text ITEM NAME ITEM_NAME_PUG Text QUANTITY QUANTITY_PUG Text CATEGORY CATEGORY_PUG Text SUBCATEGORY SUBCATEGORY_PUG Text OUTLET INFO OUTLET_INFO_PUG Integer ITEMID ITEMID_PUG Picklist SUPPLIER NAME SUPPLIER_NAME_PUG Provide the values as e.g. Cargil Sysco Email SUPPLIER EMAIL SUPPLIER_EMAIL_PUG Navigate to the top of the page. Adding business logic for an email notification whenever a new record is created in this object It consists of two steps. Create an email template and then create an email trigger. 10

Creating a template: Select Templates option Click on NEW EMAIL TEMPLATE button. Give the name as New Stock request mail, subject as New Stock Request and provide the mail template. E.g. Mail template Hi, There is stock request raised for the item {!ITEM_NAME_PUG#value} under the category {!CATEGORY_PUG#value}. Please ship ASAP at {!OUTLET_INFO_PUG#value}. Quantity requested is: {!QUANTITY_PUG} Regards, POS ({!OUTLET_INFO_PUG#value}) NOTE: The template tokens in the above sample (e.g. {!ITEMNAME_PUG#value}) needs to be modified as per the tokens in your application. Then, save the mail template. Creating an email trigger Select Triggers option. Click on NEW TRIGGER button to send an email, whenever we have a new stock request. 11

Select Send Email and click NEXT button. Check After Update under Timing section Give the Trigger Name (Trigger mail for stock request), chose the available Email Template (i.e. Stock request mail) Give the send to address and save. Click on Return to <Application name> link at top right to access the object. Click on viewing drop down and select filter option. Remove the createdby, createdat etc, Include Workflow action, workflow status and save the view. 12

Adding required business logic in OpenEdge: Requirement: Access OpenEdge environment and start consuming the Rollbase rest API to get the login session followed by creation of record in Rollbase object, when Item Quantity goes less than 10. Open the OpenEdge Developer Environment. Expand the Item service project in development environment and right click on App server. Select New option, create a procedure file with Name check.p 13

Copy the code in below block paste in created Itemcheck.p file and save. Also make sure, highlighted code of lines are properly specified based on requirement. /*------------------------------------------------------------------------ File : Itemcheck.p Purpose : Syntax : Description : This procedure file contains the logic to create a new record in Rollbase application, whenever the items quantaty goes below 10. Author(s) : Ganesh Cherivirala Created : Tue Jun 28 12:35:36 PDT 2016 Notes : There are two Rollbase APIs used in this code. Provide the parameters as appropriate. They are highlighted. ----------------------------------------------------------------------*/ /* *************************** Definitions ************************** */ BLOCK-LEVEL ON ERROR UNDO, THROW. /* ******************** Preprocessor Definitions ******************** */ /* *************************** Main Block *************************** */ USING OpenEdge.Core.WidgetHandle FROM PROPATH. USING OpenEdge.Net.HTTP.ClientBuilder FROM PROPATH. USING OpenEdge.Net.HTTP.IHttpClient FROM PROPATH. USING OpenEdge.Net.HTTP.IHttpRequest FROM PROPATH. USING OpenEdge.Net.HTTP.IHttpResponse FROM PROPATH. USING OpenEdge.Net.HTTP.RequestBuilder FROM PROPATH. USING Progress.Json.ObjectModel.JsonObject FROM PROPATH. USING Progress.Json.ObjectModel.ObjectModelParser FROM PROPATH. USING Progress.Lang.Object FROM PROPATH. DEFINE VAR oclient AS IHttpClient. DEFINE VAR oreq AS IHttpRequest. DEFINE VAR oresp AS IHttpResponse. DEF VAR httpurl AS CHAR. DEFINE VARIABLE hxmldoc AS HANDLE NO-UNDO. 14

DEF VAR oentity AS Object NO-UNDO. DEFINE VARIABLE hdataset AS HANDLE NO-UNDO. DEFINE VARIABLE hdataset2 AS HANDLE NO-UNDO. DEFINE VARIABLE h_sessionid AS CHAR NO-UNDO. DEFINE VARIABLE Qty AS INTEGER NO-UNDO. DEF VAR l1 AS LONGCHAR. DEF VAR JsonObj AS JSOnObject. DEFINE VARIABLE myparser AS ObjectModelParser NO-UNDO. DEFINE VARIABLE rbsessionurl AS CHARACTER INITIAL "https://www.rollbase.com/rest/api/login?loginname=<username>&password=<password>". /* change the "i" file name to reflect the available I file*/ {"items.i"} DEFINE INPUT PARAMETER DATASET FOR dsitems. DATASET dsitems:write-json ("file","c:/temp1.json",true). FOR EACH Itemscheck: DISPLAY QUANTITY. MESSAGE "in checkitem - " QUANTITY VIEW-AS ALERT-BOX. IF QUANTITY < 10 THEN // Dynamic dataset handles used for reading the XML CREATE DATASET hdataset. CREATE DATASET hdataset2. // JsonObject to store the XML to JSON JsonObj = NEW JsonObject(). // ObjectModelParser to parse the longchar while casting it to JSONObject myparser = NEW ObjectModelParser(). //base HTTP URL while performing GET operation //httpurl = "https://www.rollbase.com/rest/api/login?loginname=user1_prod&password=jv02eo02". httpurl = rbsessionurl. //Perform a GET Request oclient = ClientBuilder:Build() :Client. oreq = RequestBuilder :Get(httpURL) :Request. oresp = oclient:execute(oreq). oentity = oresp:entity. 15

//If the response entity is XML then read individual elements IF TYPE-OF(oEntity, WidgetHandle) THEN DO: hxmldoc = CAST(oEntity, WidgetHandle):Value. hdataset:read-xml("handle",hxmldoc,"empty",?,?,?). hdataset:write-json ("longchar",l1,true). JsonObj = CAST(myParser:Parse(l1),JsonObject). //Check if the status is OK. If yes, then look for the sessionid IF(JsonObj:GetJsonObject("NewDataSet"):GetJsonArray("resp"):GetJsonObject(1):GetCharact er("status") = "ok") THEN h_sessionid = JsonObj:GetJsonObject("NewDataSet"):GetJsonArray("resp"):GetJsonObject(1):GetCharacter( "sessionid"). ELSE RETURN ERROR "Failed while performing GET operation ". END. //Append the dynamic sessionid to the httpurl before performing the POST operation MESSAGE "In Side IF block - " QUANTITY VIEW-AS ALERT-BOX. httpurl = "https://www.rollbase.com/rest/api/createrecord?sessionid=" + h_sessionid + "&objname=stock_management1&useids=false&outlet_info_pug=" + String (OUTLETNAMEITEMS) + "&QUANTITY_PUG=" + String(QUANTITY) + "&CATEGORY_PUG=" + String(CATEGORY) + "&ITEM_NAME_PUG=" + String(NAME). oclient = ClientBuilder:Build() :Client. oreq = RequestBuilder :Post(httpURL,JsonObj) :Request. oresp = oclient:execute(oreq). 16

oentity = oresp:entity. //If the response entity is XML then read individual elements IF TYPE-OF(oEntity, WidgetHandle) THEN DO: hxmldoc = CAST(oEntity, WidgetHandle):Value. hdataset2:read-xml("handle",hxmldoc,"empty",?,?,?). hdataset2:write-json ("longchar",l1,true). JsonObj = CAST(myParser:Parse(l1),JsonObject). //Check if the status is OK. If yes, then extract the individual elements IF(JsonObj:GetJsonObject("NewDataSet"):GetJsonArray("resp"):GetJsonObject(1):GetCharact er("status") = "ok") THEN DO: MESSAGE "id is - " + JsonObj:GetJsonObject("NewDataSet"):GetJsonArray("resp"):GetJsonObject(1):GetJsonArray ("data"):getjsonobject(1):getcharacter("id") VIEW-AS ALERT-BOX. MESSAGE "objname is - " + JsonObj:GetJsonObject("NewDataSet"):GetJsonArray("resp"):GetJsonObject(1):GetJsonArray ("data"):getjsonobject(1):getcharacter("objname") VIEW-AS ALERT-BOX. MESSAGE "Msg is - " + JsonObj:GetJsonObject("NewDataSet"):GetJsonArray("resp"):GetJsonObject(1):GetJsonArray ("data"):getjsonobject(1):getcharacter("msg") VIEW-AS ALERT-BOX. END. ELSE DO: MESSAGE "Post operation failed for the httpurl " + httpurl. RETURN ERROR "Post failed". END. END. CATCH e AS Progress.Lang.Error : DEFINE VARIABLE iloop AS INTEGER NO-UNDO. DO iloop = 1 TO e:nummessages: PUT UNFORMATTED 'ERROR: ' e:getmessage(iloop) SKIP. END. END CATCH. END. 17

Till now, we have written the code in procedure file to get the Rollbase user session followed by record creation in stock request object in Rollbase using REST APIs. It s time to invoke the procedure file. As we all know that the BE/.cls is the acting as an interface for the service for client communication (Kendo UI). My interface have the submit method, I will call the procedure file using RUN comment with input as DATASET. NOTE: If there is no submit method in BE, we need to call procedure file in the methods (e.g. Update, create). Open the *.cls file under app server and update the submit method to call above created file. /* RUN itemcheck.p (INPUT DATASET dsitemscheck BY-REFERENCE). */ Wait until changes are published to server. Navigate to servers view and confirm the server status is published. Access OpenEdge Item service in the Kendo UI and update any item quantity to have less than 10. Access the Purchase request object in Rollbase and notice a new record is created with the details of quantity, category, sub category, soon. 18

Additional Business Logic in Rollbase Great! Record has been created automatically. As a next step, we would like to add some more business logic in Rollbase to help the stock replenishment team to create an order in an automatic way and notify the supplier about the same. Click PLUS icon and select A new Object (with TAB) and provide details as below, Save Object Name/ Singular Name Order Integration Name Order_PUG Navigate to object definition and start creating the required fields. Field Type AUTO NUMBER Field Name Integration Name Other details ORDER ID ORDER_ID_PUG Display Format as OR#- {0000000}. Starting Number as 1. Text ORDER NAME ORDER_ NAME_PUG Text Text Email ORDER QUANTITY SUPPLIER NAME SUPPLIER EMAIL ORDER_QUANTITY_PUG SUPPLIER_NAME_PUG_OR SUPPLIER_EMAIL_PUG_OR 19

Create one order one purchase request Relationship. Navigate to top and select the relationship. Click New Relationship Select Purchase Request radio button and then click on NEXT. Select one order one Stock Management in Cardinality and save. In order to create an Stock request based on user click, we need have a trigger. With little coding. Click on Return to <Application name> link at top right to access the object. Click on Stock Management object Click Object definiation. Navigate to top of the page and click on TRIGGERS option. 20

Click on NEW TRIGGER. Select OBJECT SCRIPT Radio option, and click NEXT. Give the Name as Place the Order Use below code in FORMULA RETUN FIELD and save var x = new Array(); x["order_quantity_pug"]="{!quantity_pug#value}"; x["order_name_pug"]="{!item_name_pug#value}"; x["supplier_name_pug_or"]="{!supplier_name_pug#value}"; x["supplier_email_pug_or"]="{!supplier_email_pug}"; var newid = rbv_api.createrecord("order_pug1", x); rbv_api.attach("r248177719", "Stock_Management1", {!id}, "Order_PUG1", newid); NOTE: The template tokens in the above code (e.g. "Stock_Management_ID_OR", "{!Stock_Management_ID_SM}", R247279297 etc) needs to be modified as per the tokens in your application. Details of how to use these APIs can be found here. In this we are setting the quantity of item as the quantity given while requesting the stock.. while placing the order along with Supplier name, Email. Creating a new record in ORDER OBJECT (rbv_api.createrecord). later we are attaching the created object to Stock management object to view. Navigate to top of the page and click on Workflow STATUSES Click Edit and modify the Status Name as Stock Request made from DEFAULT. SAVE. Click New Status button and create another status Order placed. Navigate to top of the page, Click WORKFLOW ACTIONs option Click on NEW WORKFLOW ACTION. Select Run Trigger radio button and click on NEXT button. Give the name as Place Order, 21

Select Change status to as Order request made, Select NONE radio option for USE WEB PAGE Select place the Order trigger in the Available Triggers and move to Selected Triggers the save the action. Navigate to top of the page and click on Workflow STATUSES Click Edit for the Stock Requested. Select place the Order trigger in the Available action and move to Selected actions. SAVE. Access the item service in Kendo UI (which we are treating as POS). Update the existing record quantity t have less than 10 and update. As per the todays use-case, A new email reach with subject <Mail subject> e.g. Stock request. A new record as been created under purchase request RB object with an option to create the order. Access the order object and check for record count. Back to purchase request and click on Create Order with success message. Access order object and check for the new record. 22

We assume vender delivered the order quantity at inventory and quantity is updated accordingly. We can update the quantity in Kendo UI and same will be reflected item object in Rollbase. Summary: Rollbase is an ideal platform for creating enterprise productivity applications rapidly with low code Ideal for satellite applications for existing OpenEdge applications The power of Rollbase is 80% mouse clicks and 20% coding for building any enterprise productivity application About Progress Progress (NASDAQ: PRGS) is a global leader in application development, empowering the digital transformation organizations need to create and sustain engaging user experiences in today s evolving marketplace. With offerings spanning web, mobile and data for on-premise and cloud environments, Progress powers startups and industry titans worldwide, promoting success one customer at a time. Learn about Progress at www.progress.com or 1-781-280-4000. Worldwide Headquarters Progress, 14 Oak Park, Bedford, MA 01730 USA Tel: +1 781 280-4000 Fax: +1 781 280-4095 On the Web at: www.progress.com Find us on facebook.com/progresssw twitter.com/progresssw youtube.com/progresssw For regional international office locations and contact information, please go to www.progress.com/worldwide Progress, Progress Rollbase and Telerik are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. Any other trademarks contained herein are the property of their respective owners. 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. Rev 16/05 60322-0091 23