Thursday, May 2, 2024

VBCS - Load data before the page load in oracle visual builder | vbEnter event in VBCS

Working...

VBCS - work with events and events listeners

  • An event occurs when something happens in your application.
  • Some examples are when a page loads (lifecycle event), a button is clicked (component event), and when a variable's value changes (variable event). 
  • An event's type depends on how it is triggered; for example, a button or a menu would trigger a component event

Type of events:

Component events:

  • An event associated with a UI component in a page, including those in dynamic components.
  • It’s possible to choose which event the component triggers, but available events will depend on the component. For example, an event like ojAction is available to a button but not to an input text field.

Variable events:

  • An event specific to a variable that occurs when the value stored in the variable changes.
  •  The only available variable event is onValueChanged.

Custom events:

  • A user-defined event that can only be triggered by the Fire Event action (fireCustomEventAction) in an action chain.
  • You use custom events to trigger an action chain from another action chain or JS function.

Lifecycle events:

Predefined events that are automatically triggered during a page’s lifecycle:

  • vbBeforeEnter is triggered before navigating to a page.
  • vbEnter is triggered when all flow or page variables have been initialized.
  • vbBeforeExit is triggered before leaving a page.

    The vbBeforeExit event optionally allows navigation to be canceled (say, when a page has unsaved changes) by returning an object with the property cancelled set to true. When using the browser (back or forward button), the event's payload is an object containing default parameter values. 

  • vbExit is triggered before leaving a flow or page.
  • vbAfterNavigate is triggered when navigation to the page is complete.

You can associate action chains with these events to augment a page or flow's default lifecycle. For example, if you want to initialize some component variables when a page opens, you can create an event listener in your artifact that listens for the vbEnter event, then set the event listener to trigger an action chain that assigns values to the component's variables.


Reference:

https://docs.oracle.com/en/cloud/paas/app-builder-cloud/visual-builder-developer/define-events-your-application.html







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.

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