Outsystems : A simple questions and answers.
Discussion

Service Studio:

Service Studio is the visual development environment for OutSystems Platform, used to design web and mobile applications including their user interfaces, process flows, business logic, web services, and security policies.

Controls:

Web server controls are objects on Web pages that run when the page is requested and that render markup to a browser. Many Web server controls resemble familiar HTML elements, such as buttons and text boxes. Other controls encompass complex behavior, such as a calendar controls, and controls that manage data connections like List records or table records.

Container control

Place holder

Expression control

If condition control

List records or table records : 

Table Records doesn't provide a flexible layout, since it’s mainly used to display the data in a table based layout.

List Records a very flexible and customizable layout., since it’s mainly used to display the data in any layout. Provides facility to insert another control inside it but table records doesn’t.

Editable Table: Allow to edit a single/multiple record in tabular format.

Edit Record: Allow editing a single record in tabular format.

Show Record:  Shows a single record in tabular format.

Text box

Check box

Radio button

Combo box: A dropdown list to select single value from list

List box: A dropdown list to select multiple values from list.

Buttton

Components:

There are more than 500 components found for Web application, some are below:

Silk UI WEB

Google Map

Location

Advance Excel

Html 2pdf converter

Excel packages

PayPal connector

Date Picker

Widgets

Popup

Input autocomplete :

Place a textbox with input_autocomplete.
 
Place an action for autocomplete widgets.
Here get all items on behalf of search text that needed to bind with “Input_AutoComplete_ShowList” action list widget.

Feedback Ajax Wait

Shows a message if Ajax calls take too much time to show.

Input Set Focus

Sets the focus on the specified Input or Input Password widget when the screen loads.

Popup Upload

A page to be used in a Popup_Editor to upload files.

Remove Popups

Prevents the page from appearing inside a popup.

 
Place an action for textbox change at textbox destination , in which assign the selected identifier into a variable using autocomplete action “Input_AutoComplete_GetIdentifier”

Popup_InfoBalloon

FakeNotifyWidget

Tabs_ClientSide

Extension : is a simple way to create our own code with .net/java

Integration studio

Integration studio providing such facility to create and compile extainsion on specific server. After compilation and publishing of extension we add this extension to our page by adding reference.

Integration

With OutSystems Platform, integration is easy. Developers manage the configurations of integration without the need to write custom code, significantly reducing time and effort and eliminating errors. Integration with SOAP and REST services and SAP systems is built in, and OutSystems Platform generates all the methods and data structures to integrate with the external system. Developers can then use them visually in the application logic. From a developer's perspective, there is almost no difference between invoking an OutSystems method, a REST API, or an SAP BAPI.

API OutSystems Platform provides you APIs that you can use to extend the capabilities of your applications. With these APIs you can integrate your applications with external systems, and have programmatically access to the features of the platform.

 

Crypto API ->(cryptographic lib Providing authentication encryption )compare password,compute hash ,encrpt and decrpt

'DBCleaner_API' ->For Platform Version 9.0.1.4. Allows freeing-up database space.

Charts APIà> The OutSystems Platform API for plotting charts.

          To use this API simply reference the Charts eSpace using the References Window in the development environment.

       Chart Widgets:

     The charts available to use are:

AreaChart

BarChart

ColumnChart

LineChart

PieChart

         Life Time API –

               With LifeTime you have full visibility of all applications across all environments in your      infrastructure.

REST

It is simple Stateless architecture tht generally run over Http

      REpresentational State Transfer

Determined to make the integration with REST APIs as simple as possible, OutSystems has introduced an entirely new way to automate the consumption of a REST API.

There is no contract in REST APIs, Simply typing the address for the REST API will enable OutSystems Platform to automatically discover the underlying structure present. It then creates an interface that can be dragged around in the visual logic as if it were any other piece of business logic or web service. Users just need to fill in the parameters and start using the API.

OutSystems Platform creates all the required structure to support impact and change analysis throughout the app. If the API changes, everything is updated, automatically healed and checked for impact

To consume a REST API, a developer needs to provide the service end-point URL, and an example of the service request and response in JSON. Most services include a JSON sample request and response in their documentation and it can be pasted into the OutSystems Platform IDE. OutSystems Platform generates everything needed to invoke the REST service.. /PhoenixBilling/rest/RESTAPI1

Web service - > to Access data frm different sources like web software app

SOAP

      Simple object  Access Protcal based on XML so it easy to read

                 To consume a SOAP web service, developers simply provide the location of the     WSDL (Web Services Description Language) file. OutSystems Platform IDE inspects the WSDL and generates everything needed to invoke the web service methods.

https://172.16.32.28/Login/GlobalUsers.asmx?wsdl

Exposing SOAP web services is done by exposing the methods. OutSystems Platform will automatically create the WSDL and URL that can be consumed by any application with Internet connectivity.

SSL (Secure Sockets Layer) is the standard security technology for establishing an encrypted link between a web server and a browser. This link ensures that all data passed between the web server and browsers remain private and integral.

Timer

To execute asynchronous logic, use Timers. This is useful to execute batch tasks like sending emails at a predetermined time, or to execute logic to configure an application after its deployment.

A timer can be awaked in three different ways:

On a predetermined time;

After the application has been published;

Either programmatically or manually.

Processes

A Process is an element that allows you to integrate your business processes into your applications. A process is designed in a process flow, which usually represents the activities that have to be carried out during an entity life cycle.

Elements

Entitiy

An entity is an element which allows you to keep business information in a persistent way. The information is stored in Attributes. Entities are used to represent and manage your data base model.

Static Entities

A static entity is an entity that has static data associated to it. This static data is then managed in design time and you use it directly in the business logic design of your application thus benefiting from strong typing. You can think of Static Entities as enums that are stored in the data base

Multi-tenant

To create a multi-tenant application with OutSystems Platform, every eSpace of the application has to be marked as multi-tenant. This is done by simply setting the "Is Multi-tenant" property of the eSpace to "Yes." This isolates data, end-users, sessions and processes per tenant and alerts other developers to the fact that the eSpace is multi-tenant ready.

Since an end-user uniquely belongs to a tenant, the OutSystems Platform infers which tenant from the username, during the login process. Then, the end-user is bound to the tenant and all simple and advanced queries are automatically filtered to only return data from that tenant

Steps of upload and download release

First tack all the dependent eSpace modules references in our module Open service center and go to factory menu then go to Solutions sub menu then click on new Solutions link

Click Publish Steps

Save (optional): this is an optional step that is performed only if your module was opened from a file or was already saved to a file.

Upload: uploads the module to the Platform Server you are connected to.

Compile: this is executed in the Platform Server you are connected to and involves translating the oml file, handled by the development environment, into a set of Microsoft .NET or Java files.

Deploy: the last step of the 1-Click Publish operation which updates the published version of the module.

LifeTime

LifeTime fully automates DevOps processes, and manages the staging of your applications from development to production across cloud, on-premises or hybrid environments.

Real-time performance monitoring is built-in for all your applications and available in LifeTime. You’ll be able to see how each web and mobile application is performing on your users' devices.

LifeTime also enables you to define your IT team's access and control over applications and their components, across all environments.

Service Center

Service Center is OutSystems Platform web console that offers a comprehensive set of functionality to manage all operational aspects of your applications, including all logging and monitoring information needed for performance tuning, and for configuration of horizontal scalability.

What is Agile?

Agile is a time boxed, iterative approach to software delivery that builds software incrementally from the start of the project, instead of trying to deliver it all at once near the end.

It works by breaking projects down into little bits of user functionality called user stories, prioritizing them, and then continuously delivering them in short two week cycles called iterations/Sprints.

Deployment process:

 
 
 
SAP Integration                                                                      

Site property-One of the benefits of using site properties, is that you can change its value at runtime using the environment management console.

Outsystem 9 bali : Analytics: OutSystems Platform Bali takes mobile and web application performance management to a new level by providing innovative, holistic, analytics across the application portfolio.:

Model

The default value for the session time-out depends on the application server:

.NET: 20 minutes and this value can be configured in machine.config file;

J2EE: 60 minutes and this value can be configured in /etc/.java/.systemPrefs/outsystems/prefs.xml file

A vendor management system (VMS) is a Web-based application that allows an organization to secure and manage staffing services on a temporary, permanent or contract basis. It helps centralize the complex issues that surround the staffing.

A VMS generally involves the following:

Job requisition or staff ordering

Automatic billing

Business intelligence (BI) functionality

Management reporting

Workflow engines

Getting Help 

Enterprise Customers 

Maintenance and Operations 

Designing the architecture of your OutSystems applications 

The 4 Layer Canvas (4LC) is an OutSystems architecture tool to make the design of Service-Oriented Architectures (SOA) simple. It promotes the correct abstraction of reusable (micro)services and the correct isolation of distinct functional modules, in cases where you are developing and maintaining multiple applications that reuse common modules. A typical medium to large OutSystems installation will support 20+ mission critical applications and 200+ interdependent modules.

The 4 layers

Each layer sets a different nature of the functionality to be captured in a module:


Processes, dashboards and portal home pages, mashing up information from different applications to provide a unified user experience.

User interfaces and processes, reusing Core and Library services to implement the user stories.

Services around business concepts, exporting reusable entities, business rules and business widgets.

Business-agnostic services to extend the framework with highly reusable assets, UI Patterns, connectors to external systems and integration of native code.

Aggregates and Advanced Queries

Use Aggregates: they’re optimized and database independent!

Use Advanced Queries for bulk operations

Use a 3 layers approach:

Business Processes: a service available for use by users or business processes

Core Entities: logical grouping of operations per responsibility

Connectors: extensions or integration with other systems

Create team processes for active log monitoring

Create team processes for manual deployment procedures such as data update scripts

If the number of lines to be uploaded is not fixed, then you should ensure that your application is capable of loading 65536 records, the maximum number of records Excel allows (Note: MS Office / Excel 2007 has a limit of 1 Million rows). Additionally, in a worst case scenario, Excel doesn't take more than two minutes to load, keeping in mind that table inserts will be progressively slower with table growth.

About Session Variables

Session variables hold data that is persisted during the session and can be used to save information during the end-user interaction. Each application has several session variables automatically created, but you can define new ones.

Session Variable lifetime

The session variables are initiated automatically by Service Studio when the Platform Server session is created. While the session exists, you can use these variables in your business logic. When the session ends, the session variables are set to their default value.

Pre-defined Session Variables

Each application has several session variables that are automatically created and read-only:

ExceptionMessage: Text that explains the reason for the last error, such as "Attempted to divide by zero". If the exception was raised due to an explicit Raise error, it will contain the text defined by the developer. Learn more about exception logging.

Read only.

MobilePhone: In SMS flows, this contains the value of the phone number. In web flows this variable is also available but has an empty value.

Read only. Phone number type.

UserId: Contains the unique identifier of the end-user making the request. This variable is instantiated during the login operation, whether you are using an explicit or implicit login. At logout, this session variable is assigned a Null Identifier value. Learn more about Authenticating End-users.

Read only.

Username: Contains the username of the end-user making the request. This variable is instantiated during the login operation, whether you are using an explicit or implicit login. At logout, this session variable is assigned an empty text value. Learn more about Authenticating End-users.

Read only. Text type.

TerminalType: Indicates the type of terminal that is being used to make the request. The possible values are: WAP, SMS, and Web. These values are instantiated when the session starts.

Read only.

User-defined Session Variables

You can define your own session variables. To define a session variable, simply right-click on the Session Variables folder (in the eSpace tree under the Data layer), and select the Add Session Variable option. Session variables, just like screen variables have an associated data type and a default value that can be set through the session variable properties. Learn more about session variables data types.

Session variables should be used with care since they can affect the scalability of your applications. You should try to avoid storing large quantities of data with session variables because, in each request, these variables need to be fetched from the database and then, when the request ends, updated in the database. When Service Studio detects you are compromising the application's performance and scalability, a warning message is displayed.

When the end-user logs in or out, using the Login, LoginPassword, or Logout actions, the session variables are set to their default value.

What you Should Know

Asynchronous logic such as sending Emails, Timers execution, Processes execution, and Web Services run on a different session, meaning that all session variables are set with their default value when the logic is executed.

System Roles and Custom Roles

When you create a new module in Service Studio, OutSystems provides you with a default set of System Roles but you are allowed to define your own custom Roles.

OutSystems provides the following System Roles:

Anonymous: Allows any end-user to access the element, including users that are not logged in (non-authenticated users). Anonymous is the most general Role and when you associate this Role, for example with a screen, all of the existing Roles are automatically associated with it.

Registered: Allows any end-user who has logged into an Application running in the same platform server (authenticated users) to access the element. This is possible due to the Single Sign-On mechanism of OutSystems, which allows sharing end-user sessions among applications/modules. When you associate this Role with an element all of the existing Roles are automatically associated with it, except the Anonymous role.

Besides the System Roles already provided, you can define your own custom Roles to manage the access of end-users to the screens and operation of your application.

The following Role is provided by default when you create the first module of your application:

<Module Name>User

Persistency in Roles

Permissions can be persistent across multiple sessions, or only be granted for a single session.

Persistent: The association between the end-user and the Roles is stored in the database. Every time the end-user logs in, the association between the end-user and the Roles is established. Set the Is Persistent property of the Role to Yes.

Not persistent: The Role is only associated with the user for a single session, and not persistent in the database. When the end-user logs in for the second time, the Role is not associated with the end-user. Set the Is Persistent property of the Role to No.

#Theme temlpates

Dublin Template

Lisbon

LiverPool

# Good practice of Coding

OutsystemInterviewPoints.docx
Solution

Very useful info .. thanks 

Good summary.

Huarlem Lima wrote:

Good summary.


Thanks.

Full Forms

OML: OutSystems Modeling Language.

XIF: External Integration File.

OAP: OutSystems Application Package.

OSP: OutSystems Solution Package.


What is LOW-Code?

What is low-code? Low-code is a way to design and develop software fast and with minimal hand-coding. It enables skilled people to deliver value more quickly and more reliably.

What are application objects?

Application objects are elements of your application:

  • Pages: The screens you design or install in your environment for end users. These can include web screens, email screens, mobile web screens and SMS screens as designed in the visual development environment. For example, a pop-up web screen or a Supplier_List web screen each equals 1 application object.

  • Tables: Entities that you design with Outsystems Platform or import for integration from external databases or both. Each Local Storage entity (applicable to mobile) will count 1 additional AO, regardless if it is a new entity or an existing one.

  • API/Service operations: Methods from web services, REST APIs or integration connectors that you consume or expose. APIs in extensions, the C# code that you reuse in OutSystems Platform, are not accounted for.

What constitutes a page?

Pages are the web screens, email screens, mobile web screens, SMS screens as designed in the visual development environment. Web blocks are not pages, but screen components. Therefore they’re not counted.


When a single page includes multiple tabs, what is counted?

If each tab is implemented in a different web screen in the designer, they are different pages and each is an application object. If each tab is implemented in the same screen with web blocks or inline, they all constitute just 1 page or 1 application object.



What about pop-ups on a single page?

If the content of the popup is a different web screen, the screen in the popup is counted as a page and therefore is an application object. This is the default when you scaffold a popup or use Richwidgets popup components. 

Usually, a tiny help message will not have its own screen, but will instead be something like a tool tip and therefore is not counted as an application object. If the popup has some transactional logic, it is usually implemented in a different screen and therefore counts as an application object. The developer will decide the best design.


Hey good job Vijay. Try to post this on linked on Outsystems group as a post.

thanks suraj.

What are Templates?

Templates are modules and specific naming that become available is starting point when create new application .

Good efforts vijay   



Thanks Shukla ji.

Vijay Malviya wrote:

Thanks Shukla ji.


Always welcome   

Unique Key, Primary Key & Foreign Key


Primary Key

  • Primary key cannot have a NULL value.
  • Each table can have only one primary key.
  • By default, Primary key is clustered index and data in the database table is physically organized in the sequence of clustered index.
  • Primary key can be related with another table's as a Foreign Key.
  • We can generated ID automatically with the help of Auto Increment field. Primary key supports Auto Increment value.

Unique Key

  • Unique Constraint may have a NULL value.
  • Each table can have more than one Unique Constraint.
  • By default, Unique key is a unique non-clustered index.
  • Unique Constraint can not be related with another table's as a Foreign Key.
  • Unique Constraint doesn't supports Auto Increment value.

Foreign Key

  • Foreign key is a field in the table that is primary key in another table.
  • Foreign key can accept multiple null value.
  • Foreign key do not automatically create an index, clustered or non-clustered. You can manually create an index on foreign key.
  • We can have more than one foreign key in a table.
  • There are actual advantages to having a foreign key be supported with a clustered index, but you get only one per table. What's the advantage? If you are selecting the parent plus all child records, you want the child records next to each other. This is easy to accomplish using a clustered index.
  • Having a null foreign key is usually a bad idea. In the example below, the record in [dbo].[child] is what would be referred to as an "orphan record". Think long and hard before doing this.

 good job Vijay...

Really Appreciate #VijayMalviya

Thanks Manish. 

Just a note to the readers who may be reading the topic: the links from the first post link to the product versions and documentation pages that reached end of life and are no longer supported.

For an up to date documentation overview please check this link.

Hi,

thanks for advise.




Greate work Vijay.. helpful. 

Solution

Very useful info .. thanks 

good work

Thanks ankur

Thank you for this summary was very helpful =)

Luana Almeida wrote:

Thank you for this summary was very helpful =)


thanks luana

It's really helpful....
Thanks Vijay.. 

Welcome. :)

Input Parameter

An Input Parameter allows you to provide data to an element for further use. The Input Parameter becomes available in that element's scope.

For example, if you add an Input Parameter to a Client Action you can:

Provide a value for that Input Parameter when calling the Client Action.

Use the value in the logic flow of the Client Action, for example in expressions or as a part of Input Parameter values of other calls.

In the following example, the GetWeatherData Client Action has two Input Parameters (City and Country) and one Output Parameter (WeatherInfo):


nput Parameters can be mandatory or optional, according to their Is Mandatory property.

If you call other Actions from the Client Action you can no longer access the Input Parameter because it's not longer in the Client Action scope. To make the Input Parameter value accessible to other calls, include the Input Parameter in the arguments of the Action Call.


Hi,

I was trying to find an answer to a question related to Agile but in different documentations, I got some different answers, Could you help me to answer it according to What Outsystems follows?

Q. What is the best time to write the test cases for an agile iteration?

Is it in parallel of development or after done with the development of the iteration or when?

Thanks

Once we start our sprint parallelly we need to write our test cases as per the wireframes and user story and need to make sure it get execute before the sprints get over

Nice summary about each and every topic..

Thanks Akshata

Hello,

Helpful information at one place

Thankyou
Ayush Khare

Thanks Ayush

Screen and Block Lifecycle Events

On Initialize

The On Initialize event handler executes after checking the permission of the user to access the Screen, but before navigating to the Screen and starting to fetch data.


In Blocks, including any server action calls or local storage operations in this flow might cause the render of the Block to start before this action finishes. You will have issues if you set any variables in this flow that affect the render.


Notes:


Keep this event handler action simple and avoid slow actions such as local storage operations, since it may delay the rendering of the Screen or Block.

Avoid accessing the data of the Screen or Block since this action runs before the data is fetched.

Use cases you can implement with this event handler:


Assign a variable based on inputs.

Assign a variable based on some computation in JavaScript, such as a random number.

Redirect the application to another Screen if the user doesn’t have the authorization to see the Screen (only possible if the event handler belongs to a Screen).

Assign the parameters of a child Block based on the inputs of the Screen.

Access variables of the JavaScript window object.

On Ready

The On Ready event handler runs when the Screen or Block is ready, i.e. when the DOM is ready, after the first render. In Blocks, this event happens before the same event of the parent Screen or Block. To ensure a fast and smooth Screen or Block render, this event is triggered even before the transition to the Screen ends.


Notes:


The DOM of the previous and current Screens are loaded when this event is triggered. To ensure that you are operating on the screen being created, execute logic only for the HTML div element with the class active-screen.

Keep this event handler action simple and avoid using Screen Aggregates or Data Actions, which run in parallel, to manipulate data that might not be available.

Avoid accessing the data of the Screen or Block since this action runs before the data is fetched. If you need to develop some logic on these data, use the On After Fetch event handler of the respective Aggregate or Data Action.

Use cases you can implement with this event handler:


Initialize a third-party component that needs the DOM.

Add listeners to a DOM element.

Set the focus on an input widget.

Add listeners to the JavaScript window object.

On Render

The On Render event handler runs after each time the Screen or Block is rendered, i.e. whenever the Screen or Block is opened (right after the On Ready event handler execution) and after any change of the data of the Screen. In Blocks, this event happens before the same event of the parent Screen or Block. You can use this event handler to update a third-party component such as a progress bar.


Notes:


Avoid changing Screen or Block data since every time this data changes the On Render event is triggered again and the app might run in an infinite loop.

Keep this event handler action simple and avoid slow actions such as server requests, since it may delay the render of the Screen or Block.

On the first render of the Screen or Block avoid accessing the data of the Screen or Block since there is no guarantee that the data is already fetched. If you need to develop some logic on these data, use the On After Fetch event handler of the respective Aggregate or Data Action.

Use cases you can implement with this event handler:


Act upon a change in the data of the Screen or Block to update a third-party component.

The same use cases as for the On Ready event handler.

On After Fetch

The On After Fetch event handler executes right after an Aggregate or Data Action finishes fetching data. Since each Aggregate or Data Action has its own On After Fetch event handler, you can implement logic to act upon the data retrieved from that data source.


Notes:


When the On After Fetch event handler runs, the data has arrived and is available but it isn't bound to widgets. This means that the widgets haven't updated yet.

Use cases you can implement with this event handler:


Assign the first or last record returned by the query to a variable.

In the master-detail pattern, to iterate a query to populate a list of lists.

For queries dependent on other queries, you can use this event handler to trigger the dependent Aggregate.

Use cases you shouldn't implement with this event handler:


Don't use the GetUserId() function at this moment to know the user that is currently authenticated. The parallel execution of Data Actions and client-side Agreggates in a Screen overrides the session authentication cookie. Therefore, using the GetUserId() function in the On After Fetch event might return an empty value.

On Parameters Changed

The On Parameters Changed is an event handler only for Blocks that runs after the parent Screen or Block changes an input of the Block. In case you have a Block inside another Block and a change of an input of the outside Block affects an input of the nested Block, the On Parameters Changed event handler of the outer Block runs b

Outsystem Delete Rules

When you create relationships between the Entities in your module, you must define which kind of referential integrity you want to use when deleting records. The referential integrity specifies what happens to a record of an Entity B that references a record of Entity A, when the Entity A record is deleted.

The following Entity Diagram defines the relationship between Customers (main Entity A) and Orders (related Entity B), where a Customer can have several Orders, and an Order belongs to one and only one Customer. The reference attribute, which corresponds in database terminology to a foreign key, is the attribute CustomerId in Entity Order.

In this example, specifying the referential integrity is to define what happens to the Orders of a Customer when that Customer is deleted.

To specify the referential integrity in a relationship between two Entities, you need to edit the reference attribute of the related Entity and set the Delete Rule property to one of the following values: ProtectDelete or Ignore.

Protect

Setting the Delete Rule to Protect prevents deleting records of the main Entity while there are associated records in the related Entity.

This behavior is ensured by a database constraint created on the reference attribute. If you try to delete a record in the main Entity that still has associated records in the related Entity, the Platform Server returns a database exception and the operation is not executed.

Delete

Setting the Delete Rule to Delete guarantees that when a record of the main Entity is deleted, all the associated records in the related Entities are also deleted. This mechanism is commonly known as Cascade Delete.

This behavior is ensured by a database constraint created on the reference attribute.

Ignore

Setting the Delete Rule to Ignore allows deleting records of the main Entity keeping the associated records in the related Entity.

The Ignore value does not guarantee referential integrity and, therefore, no database constraint is created. Accordingly, when you change the Delete Rule property from a previous value to Ignore, the corresponding automatic index is deleted (unless you have manually changed any of its properties).

If the foreign key attribute references an external Entity exposed by an Extension, the only possible value for the Delete Rule property is Ignore, as the referential integrity can’t be guaranteed.

When designing your Entities model, you must identify the correct Delete Rule for the several relationships, ensuring your system behaves as expected in each use case. Check below some examples and considerations for each option to help you choose the appropriate choice for your use case.

"Protect" Example

The Protect value is commonly used when the end user is able to delete the Entity data directly from the application’s screens.

Consider the following business scenario:

  • There is an application screen where the end users can delete Customers.

  • Customer can have one or more Orders, and an Order belongs to one and only one Customer.

  • Customer cannot be deleted while there are associated Orders.

Setting the Delete Rule property of the reference attribute CustomerId to Protect assures that the end user won’t delete a Customer that still has associated Orders.

Trying to delete a Customer that still has associated Orders results in a database exception, and the operation is not executed:

In this case, to delete a Customer you must first delete all the Orders placed by that Customer.

This is the more performant option because you can control and optimize the individual delete statements, and still ensures data consistency. It’s a trade between having more control and performance, over higher implementation costs.

Advantages

  • The data model is always consistent, as you won’t be able to delete a record of the main Entity that is still being referenced in the related Entities.

Constraints

  • You must orchestrate the correct delete order in your logic, by deleting the records of the related Entities first, and then the record of the main Entity.

  • Whenever you add a new related Entity to your model, you must include that related Entity in your delete cycle logic.

"Delete" Example

The Delete value is commonly used when you implement data purging mechanisms, where you need automatic cascade delete between the whole model.

Since data purging mechanisms are typically handled by an asynchronous process (Timer or BPT), performance is not a concern.

Consider the following business scenario:

  • We want to delete all the closed Orders older than five years.

  • An Order has one or more OrderItems, and an OrderItem belongs to one and only one Order.

  • When an Order is deleted, all the associated OrderItems must be deleted.

Setting the Delete Rule property of the reference attribute OrderId to Delete assures that when an Order is deleted, all the related OrderItems are also automatically deleted.

Advantages

  • The data model is always consistent. When you delete a record of the main Entity, that record won’t be referenced in the related Entities anymore, as all the associated records in the related Entities are also deleted.

  • The development and maintenance of your delete logic are straightforward, as you only need to delete the records at the main Entity level.

  • Adding new related Entities to your model implies low development effort, as you only need to set the Delete Rule of the reference attributes to Delete.

Constraints

  • Depending on the number of related records, this option can lead to poor performance. For every delete operation, the related Entities will be checked for related records, causing the delete statement to take longer. Therefore, this option is not recommended when you have a complex Entity model and performance is a concern (for example, the end user is able to delete the Entity data directly from the application’s screens).

"Ignore" Example

The Ignore value is commonly used when you implement historical data archiving mechanisms, where you want to delete records from the main Entity but you need to keep all the records in the related Entities, considering that the details of the main record are not relevant.

Consider the following business scenario:

  • Every operation performed over an Order is logged in OrderHistory.

  • One OrderHistory record relates to one and only one Order and one Order has one or more related OrderHistory records.

  • We want to delete all the closed Orders older than five years, but the OrderHistory records must be kept for 10 years, for compliance reasons.

Setting the Delete Rule property of the reference attribute OrderId to Ignore allows you to delete an Order and keep the related OrderHistory records.

Advantages

  • You can delete records in the main Entity without impacting the related Entities.

Constraints

  • This option leads to an inconsistent data model. It keeps the related records, but you can no longer fetch the details of the main record, only the identifier.

  • When you change the Delete Rule property of a reference attribute from a previous value to Ignore, the corresponding automatic index is deleted. In case you use that reference attribute as a query filter, you need to manually add a new index.

Wow great efforts Vijay!! 

Reactive Web Lifecycle Events

EventDescription

On InitializeOccurs after checking the permission of the user to access the Screen, but before navigating to the Screen and fetching data. In Blocks, it occurs after the navigation. You can use it to initialize the Screen or Block by setting its default data.
On ReadyOccurs after the Screen or Block DOM is ready, before the transition starts.
On RenderOccurs right after the Screen or Block On Ready event handler and every time the data of a Screen or Block changes. You can use it to update some third-party component.
On After FetchOccurs after an Aggregate or Data Action has finished fetching data but before this data is rendered on the Screen or Block. You can use it to act upon the retrieved data.
On Parameters ChangedOccurs in a Block anytime the parent Screen or Block changes one of its input parameters. Changes to the input value inside the block do not trigger this event handler. You can use it to react to changes in the Block parameters, such as to update variables.
On DestroyOccurs before destroying a Screen or Block and removing it from the DOM. You can use it to implement logic when the component is disposed, such as to remove event listeners.


On Initialize

The On Initialize event handler executes after checking the permission of the user to access the Screen, but before navigating to the Screen and starting to fetch data.

In Blocks, including any server action calls or local storage operations in this flow might cause the render of the Block to start before this action finishes. You will have issues if you set any variables in this flow that affect the render.

Notes:

  • Keep this event handler action simple and avoid slow actions such as local storage operations, since it may delay the rendering of the Screen or Block.
  • Avoid accessing the data of the Screen or Block since this action runs before the data is fetched.

Use cases you can implement with this event handler:

  • Assign a variable based on inputs.
  • Assign a variable based on some computation in JavaScript, such as a random number.
  • Redirect the application to another Screen if the user doesn’t have the authorization to see the Screen (only possible if the event handler belongs to a Screen).
  • Assign the parameters of a child Block based on the inputs of the Screen.
  • Access variables of the JavaScript window object.

On Ready

The On Ready event handler runs when the Screen or Block is ready, i.e. when the DOM is ready, after the first render. In Blocks, this event happens before the same event of the parent Screen or Block. To ensure a fast and smooth Screen or Block render, this event is triggered even before the transition to the Screen ends.

Notes:

  • The DOM of the previous and current Screens are loaded when this event is triggered. To ensure that you are operating on the screen being created, execute logic only for the HTML div element with the class active-screen.
  • Keep this event handler action simple and avoid using Screen Aggregates or Data Actions, which run in parallel, to manipulate data that might not be available.
  • Avoid accessing the data of the Screen or Block since this action runs before the data is fetched. If you need to develop some logic on these data, use the On After Fetch event handler of the respective Aggregate or Data Action.

Use cases you can implement with this event handler:

  • Initialize a third-party component that needs the DOM.
  • Add listeners to a DOM element.
  • Set the focus on an input widget.
  • Add listeners to the JavaScript window object.

On Render

The On Render event handler runs after each time the Screen or Block is rendered, i.e. whenever the Screen or Block is opened (right after the On Ready event handler execution) and after any change of the data of the Screen. In Blocks, this event happens before the same event of the parent Screen or Block. You can use this event handler to update a third-party component such as a progress bar.

Notes:

  • Avoid changing Screen or Block data since every time this data changes the On Render event is triggered again and the app might run in an infinite loop.
  • Keep this event handler action simple and avoid slow actions such as server requests, since it may delay the render of the Screen or Block.
  • On the first render of the Screen or Block avoid accessing the data of the Screen or Block since there is no guarantee that the data is already fetched. If you need to develop some logic on these data, use the On After Fetch event handler of the respective Aggregate or Data Action.

Use cases you can implement with this event handler:

  • Act upon a change in the data of the Screen or Block to update a third-party component.
  • The same use cases as for the On Ready event handler.

On After Fetch

The On After Fetch event handler executes right after an Aggregate or Data Action finishes fetching data. Since each Aggregate or Data Action has its own On After Fetch event handler, you can implement logic to act upon the data retrieved from that data source.

Notes:

  • When the On After Fetch event handler runs, the data has arrived and is available but it isn't bound to widgets. This means that the widgets haven't updated yet.

Use cases you can implement with this event handler:

  • Assign the first or last record returned by the query to a variable.
  • In the master-detail pattern, to iterate a query to populate a list of lists.
  • For queries dependent on other queries, you can use this event handler to trigger the dependent Aggregate.

Use cases you shouldn't implement with this event handler:

  • Don't use the GetUserId() function at this moment to know the user that is currently authenticated. The parallel execution of Data Actions and client-side Agreggates in a Screen overrides the session authentication cookie. Therefore, using the GetUserId() function in the On After Fetch event might return an empty value.

On Parameters Changed

The On Parameters Changed is an event handler only for Blocks that runs after the parent Screen or Block changes an input of the Block. In case you have a Block inside another Block and a change of an input of the outside Block affects an input of the nested Block, the On Parameters Changed event handler of the outer Block runs before the same event of the nested Block. You can use this event handler to adapt the Block to the input parameter changes, such as to update variables or rerun Aggregates and Data Actions.

Use cases you can implement with this event handler:

  • Refresh an Aggregate or Data Action that depends on that input parameter.
  • Recalculate a variable that depends on the input parameter.

On Destroy

The On Destroy event handler executes when the Screen or Block is going to be destroyed. In Screens, this event happens when the transition to the new Screen ends. In Blocks, this event happens before the Block is removed from the DOM. This event is triggered following a top-down order: in case you have a Screen with nested Blocks, the event first happens in the Screen, then in the outer Block, and afterwards in the nested Blocks. You can use this event handler to implement logic to remove any footprint of the Screen or Block such as removing event listeners.

Notes:

  • The DOM of the present and target screens is loaded when this event is triggered. To ensure that you are operating on the screen being destroyed, execute logic only for the HTML div element with the class active-screen.
  • Keep this event handler action simple and avoid slow actions such as server requests, since it may delay the removal of the Screen or Block and, in the case of exiting a screen, the loading of the next screen.

Use cases you can implement with this event handler:

  • Call the destroy action of third-party components.
  • Clean the DOM to run a plugin again.
  • Remove JavaScript listeners.

 

Thanks.. Very informative.

Great job..

Very helpful information.Thanks all !!!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.