Sunday, April 28, 2024

VBCS - provisioning visual builder instance

There is two ways we can provision visual builder istance. 

One: create an OIC integration instance and enable visual builder 

Two: subscribe visual builder instance without having oic integration instance.


Here we will see how to do with the integration instance:

Login to OCI instance >> navigator >> developer services >> integration under application integration >> choose component >> create integration instance >>open the created instance and enable visual builder and >> click service console 






Saturday, April 27, 2024

VBCS - constituents of a web application

Here, we will discuss different parts of a web app.following are the parts:

main: 

It has the main flow or node and a main-start default page.

Fragments:

It is responsible to create reusable code, like portion of a web page - shell-footer, shell-header. We can use the fragments in all the pages.

Resources:

Under resources, we can see actions, components, we can write our own CSS, can import out own images, javascript files, strings(localizing and generalizing )

Root Pages

Root pages is a shell page , responsible to create skalaton of a page. Whatever we create in a shell, it will be showing across all the pages. Like header and footer of the pages. By default the shell page settings is set to main flow that means, if the web app is live, it will start with the main flow. We can change the default flow from main to any other flow if required. Similarly from main flow >> setttings , we can change the default page main-start to any other page.




VBCS - important parts or tools under Navigator

The vertical toolbar is the navigator. It has following parts:

Web applications
Services
Business Objects
Layouts
Components
Processes
Source


Web applications:

We can create multiple web apps within our visual application. Each web app is independent, but they can all use the data sources defined in the visual application.

Services:

With the help of service connections, connect to REST APIS, to any back end systems like database ORDS system, fusion applications etc which has exposed as a rest. If we need to connect a soap connection. Then better to use oic integration to connect soap service, then from vbcs servics, we can the rest integration service as servicr catalog.

Business Objects:
  • A business object is just a resource for example, en employee or address. It has fields to hold the data for your application. A business object is like database table. In fact, business objects are stored in a database.
  • The web application accessess the business objects through their rest endpoints.

Layouts & Components:
 It has all the available oracle JET tools , we can install them and use in our web pages such as about page, calender, attachments viewer, data grid , dynamic table etc.

Processes: 
using this section, we can connect to PCS service like any human intervention workflow.

Source:
It stores all the sources of the components we drag and drop in the web app pages. As VBCS is a low code developement environment, it stores all the sources here with visual-application.json, package.json, gruntfile.json etc. Files.

Friday, April 26, 2024

VBCS - access and secure business objects

1. Role based security control:

  • By default, the business objects in your application are accessible to all users that can access the application. 
  • To secure the data stored in objects, you can use user roles to restrict a user’s access to view, create, update, and delete operations by configuring role-based access for each operation. Users can only perform the operations and interact with the business objects associated with the role that the user has been assigned.
  • To allow anonymous access to the data in a business object, for each operation you must explicitly set the permissions granted to the Anonymous User authentication role.

To enable role-based security for a business object:

Select the business object you want to secure >> Open the Security tab of the business object.



  1. Click the Role-based security icon to enable security for the object.
    When you enable role-based security for a business object, you see a matrix of the existing user roles and the business operations that can be performed. 
  2. By default, when you enable security, all existing user roles are permitted to perform all operations. If you create a new user role, permissions to perform operations are disabled for the new role and must be enabled manually.
  3. Select the operations that can be performed by each authentication and user role. You can enable or disable permission for each operation.
You can further define security at the row level for View, Update, and Delete operations by using a query builder to define conditions. To specify which users the conditions apply to, select the user role in the table. You can select Allow if user created the row from the action menu to limit an operation to the user who created the row. The menu also has Cut and Copy options for you to move conditions from one role or operation to another.


2. Allow external access to your business objects:

When configuring security, you can allow external clients to access the business objects in your application through their REST endpoints. For example, you might want an external service like Process Automation to update a business object after a process is complete, say change a status field from "requested" to "approved".

To do this, you need to retrieve the API for the catalog of endpoints exposed by your application's business objects, found in the Catalog API panel in the Business Objects tab of your application's Settings editor:


Description of settings-catalog-api.png follows

Accessing the catalog APIs requires authentication. To set up security options for allowing access to the business object APIs:
  1. Open the Business Objects tab in the visual application’s Settings editor.
  2. Under Security, select an authentication option:
    • Allow anonymous access to business objects describe end point
    • Enable basic authentication for business object REST APIs
If you choose to allow anonymous access to the Describe endpoint, external clients accessing the endpoint will still need to add the header "Authorization: Public" to the request. The header is injected automatically for requests sent from your visual applications.


Wednesday, April 24, 2024

VBCS - Understand actions and action chains

  1. An action chain is made up of one or more individual actions, each of which represents a single asynchronous unit of work. Action chains are triggered by events.
  2. An action chain, like a variable, has a scope: 
    1. it can be defined at the application level : You can call an application-scoped action chain from any page.
    2.  the page level.  You can call a page-scoped action chain only from the page on which it is defined.
  3. To create an action chain, you can define your own actions and can also use predefined actions. Actions within a particular chain run serially, and multiple action chains can run concurrently. Action chains simplify the coordination of asynchronous activities.
  4. A single event may simultaneously trigger multiple action chains. For example, the page enter event may trigger multiple data fetch action chains simultaneously.
  5. An action is a specific function that performs a task. In JavaScript terms, an action is a Promise factory. An action can exist only within an action chain, not independently.
  6. An example of an action chain is one that makes a REST call (first action), then takes the result of that and stores that in a variable (second action).
  7. Action chains have a well-defined context and contract: an action chain orchestrates its underlying actions, coordinating state flow and the execution path. The action chain can define input parameters and local variables that are only available in that context.
  8. Visual builder comes with a set of builtin or predefined actions  for an action chain used for example, navigation or assigning variable values, we can use if and switch actions that take an expression and offer multiple different chain continuations depending on the result

Action chains are defined at the application or page level and triggered by a specific event, such as onValueChange (for a variable), or vbEnter. An event may include a payload, which can then be used within the action chain. A payload may be passed into an action chain through the input parameters. The Visual Builder user interface can help you create action chains automatically (with appropriate input parameters) based on a particular event.

VBCS - Understand variables

  1. A variable is the basic buildig block for managing client state. It is of specific type and exists in a specific scope.
  2. A variable type can be primitive(string, boolean, number, etc), a structured(an array or object), dynamic type(any) or a builtin type(service data provider or array data provider).
  3. It stores intermidiate state on the client between the visual  builder user interface and the rest services. Components are principally bound to these variables and the behavior of the variables is governed by actions.
  4. Intial value of a variable is determined using the defaultValue property set on the variable.
  5. When a variable value changes, a variable emits an event, this event may trigger an action chain. 
  6. Constants are a type of variable of the constants namespace and are used to store values tgat do not need to change  over time such as company name or measurement conversion value.
  7. We can use a variable to pass a parameter between the pages. We can mark a page variable as an input, specifying how it becomes part of the contract in order to navigate to that page.
A Scope defines the lifecycle of a variable and teh framework automatically creates and destroys tge variable depending on the semantics of the scope.

Page scope: state is accessible only wihin the context of the specified page.
Application scope: state is accessible in all parts of the application and in all pages.
Flow scope: state is accessbile in all pages contained in the current flow.
Action chain scope: state is accessible in the current action chain.

A variable triggers >> onValueChanged event whenever it is modified. >> the event can trigger a user defined action chain

Monday, April 22, 2024

VBCS - typical visual application workflow


  • A visual application is a collection of resources that you use to develop web (and mobile) apps. 
  • It includes metadata in JSON files that describe data sources (business objects and services) as well as the HTML and JavaScript files of your web (and mobile) apps.
  • To develop your application, you define its data sources and design an interface for users to work with.
  •  Visual Builder does not impose any specific order for building your application. How you proceed is personal preference and determined by the way you planned your application. If you already know the data sources that you will use, or the structure of objects that you have, you might want to start by defining the service connections and business objects. However you decide to proceed, you always start with a visual application.

High-level description of the tasks that you typically perform when building your application:

  1. Create a new visual application
  2. Create servicr connections
  3. Create business objects
  4. Add web (and mobile) apps
  5. Develop the web (and mobile ) apps
  6. Secure the application
  7. Stage and test the application
  8. Import real data and check schema
  9. Publish the application

Sunday, April 21, 2024

VBCS - task18 - publish the application

Usecase: here, we will see how to publish your application to live when we have successfully tested the staged application. The live application will be visible to users with proper credentials.

Detailed steps:

Cilck menu >> select publish >> Include data from stage >> publish 



In the header, we can see its showing live.


Menu >> open published application.


Also, we can go back to the all application >> locate your application >> select live web app to open the app.



Once the web app is published, we wont be able to make any changes to it, to do that, we will need to create a new version from the application's options menu on the visual application page. This will create a dev version of the app for us to work while the published version stays live. Once we are ready to go live with our updates, need to restage and republish the new version.




Open the live app url to mobile device >> install the app >> we will be prompted to add to our phone home screen as well.






VBCS - task17 - stage the application and import data into the application

Stage the application:

Click the Menu  in the header >> select stage >>select business object data option and click stage >> click Menu again >> select Open stage application 





Import data into your application:

If we need to add more records to our data in the staging database, we follow the below steps:

Have a zip file containing csv files for each business object >> click the business object under the navigator >> click Menu ...>> data Manager >> select staging from the drop down list in the upper right corner >> click import from file >> select zip file and import. >> open the any object like departments >> data tab >> select staging , we can see the imported data.







Note: visual builder provides different databases for the development, staging and live phases of an application. We can use empty database for the staging or live phase, we can transfer data from one to another or we xan import specific data for each.

VBCS - task16 - Enable the web app as a PWA

Usecase: Here we will show how to enable the web app as a PWA.

  1. Once all the web app development work done, as a final step before we stage the app, we can enable it to rub as a Provressive Web App or PWA. 
  2. PWAs are designed to be capable, reliable, and provide a platform specific look and feel.
  3.  When we enable a web app as a PWA, it can be installed ditectly from a browser on a user's device, including Android and iOS mobile devices.

Navigation and steps:

Web apps >> click hrwebapp node >> settings >> PWA >> toggle Enable Progressive web app(PWA).>> review the Manifest setting(app name, short name, theme color) >> under resources >> click create next to the offline fallback page .

App name: to be displayed when we are prompted to install the app.

Short name: The short name is used on the Home screen, launcher, and other places where space is limited.

Offline Fallback page: To add page  that is displayed when the user pefforms an action in the PWA that requires a connection , but the device is offline.







Saturday, April 20, 2024

VBCS - task15 - access data from an external REST service using service connection - Define by endpoint option

Usecase: we will show how to access data from an external REST service using service connection - Define by endpoint option.

Highlevel steps:

  1. Create a service connection to an external rest endpoint
  2. Create a type and variable from the rest endpoint
  3. Add fields to the employees edit page to display country data
  4. Bind the created country avatar, input fields to the created country type variables.
  5. Assign data to variables
  6. Test the employee's country details

Implementation steps:

Step1: create a service connection to an external rest endpoint

Web apps >> Services >> click + service connection >> wizard will show 3 options >> select define by endpoint >> select method, provide URL and select action >> create backend

Here, we have mentioned below details:

Method: get

URL: https://restcountries.com/v2/alpha/{code}

action: Get one




In the backend spwcfication step >> enter backend name : countries, select authentication if any. Contion type as Dynamic the service supports CORS. >> next


In create service connection page, provide service name and title and click test


Provide value >> click send request >> save as example response >> create




Step2: create a type and variable from the rest endpoint:

Types tab >> click + type >> select from endpoint >> expand services >> countries >>select GET /alpha/{code} endpoint >>next >> select the fields to display from the response. >> finish





Right click on the newly created countryType >> select create variable 




Step3: add fields to the employee's edit page to display country data 

We will change the edit employee page to show information about an employee's country.

Web applications >> open the main-editemplyee page >>> drag and drop heading component from component pallet to the page   at the end of the form layout. >> change the text field value to country info and move the slider H1to H6. >> drag and drop form layout from component pallet.  >> now add avatar and input text fields for timezone and region







Step4:Bind the created country avatar, input text fields to the countryType variable

Go to the page designer >> select avatar >> click data tab >> src field >> select the created country type variable and flag >> sameway for region and timezone and src >> add the variables




Step5: assign data to the variable

Select country field data >> add on value event that triggers an action chain >>>> from where we use rest call action and select the endpoint service >> assign input parameter >> expand employee under page and map country to code. >> drag and drop assign variable >> select countrytypevar >> which maps to callrest response  body





Step6:  test
Go to preview and test with country data IN or IE ETC.



Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...