Delete Unit
From WebRatio WebML Wiki
Contents |
Introduction
The Delete Unit is an Operation Unit and it's used to remove instances of an Entity.
When the Delete Unit is activated it physically removes one or more rows of the physical table related to the selected Entity.
Properties
- Id: The unique key automatically assigned by WebRatio to identify the Unit (e.g. dlu11).
- Name: A meaningful name for the Unit, used as label (e.g. Delete employee).
- Entity: The Data Model Entity on which the Unit is based (e.g. employee).
- Home: A flag stating that the Delete Unit must be executed as the first operation when the user enters in the related Site View.
- Default: A flag stating that the Delete Unit must be executed as the first operation when the user enters the Area containing the Unit.
- Landmark: A flag stating that the link shown in the corresponding Landmark menu that will activate the Unit. If the operation or the operation chain has no outgoing link, the final target page will be the last page visited.
- Protected: A flag stating that the access to the Delete Unit is granted only to users belonging to groups entitled to access to it.
- Secure: A flag stating that all the links that can activate the Delete Unit are implemented using the Secure HTTP protocol, instead of the HTTP protocol.
- Custom Descriptor: A flag stating that the Unit uses a Custom Descriptor.
- Custom URL Name: The Custom URL Name of the Unit. It is possible to define a custom name that will be used as URL to reach the Delete Unit, instead of the standard Id (used by default). The custom URL name must not contain whitespaces, non-ascii characters or other special characters like /, ?.
Configuration
A Delete Unit can be configured through a context menu that can be reached right clicking on the Unit either in the Work Area or in the Outline View. The context menu contains the following options:
- Add Link: Adds an outgoing link to the Unit which can be used to transport information and eventually to activate different actions (such as adding new content to the page, reaching another page with new content, activating operation chains).
- Add OK Link: Adds an outgoing OK Link to the Unit. The OK Link is activated when the Unit performs its operation correctly and can be used to transport information. Moreover, the OK Link will cause the execution of its target element (opens a target page or activates other Operation Units).
- Add KO Link: Adds an outgoing KO Link to the Unit. The KO Link is activated when the Unit isn't able to perform its operation correctly and can be used to transport information. Moreover, the KO Link will cause the execution of its target element (opens a target page or activates other Operation Units).
- Add Property: Adds a custom property to the Unit. A Property is composed by Name and Value and permits to mark the element for different purposes.
- Add Key Condition: Adds a Key Condition to the Unit.
- Add Attributes Conditions: Adds an Attributes Condition to the Unit.
- Add Relationship Role Condition: Adds a Relationship Role Condition to the Unit.
- Add Cascade Delete Role: Adds a Cascade Delete Role Condition to the Unit. This Condition behaves like a Relationship Role Condition but instead of filtering the shown instances, it defines the Relationship Role on which perform a cascade delete.
Input and Output
The Input and the Output of the Unit are accessible through the Parameters Coupling window of incoming and outgoing Links respectively.
Input
The input of the Delete Unit consists of all the Conditions defined on the Unit. To access the input parameters, open the Parameters Coupling dialog with a double click or by selecting the "Coupling" property on an incoming link to the Delete Unit. Here all the Conditions are listed.
Output
The Delete Unit does not provide output parameters. The Parameters Coupling dialog for outgoing Links might be used only for static values or for Passing parameters.
Examples
The purpose of this section is to show the usage of the Delete Unit through examples. This example is based on the Data Model shown in the following image.
| This Data Model consists of two Entities : "Company" and "Employee".
The "Company" entity has many attributes, such as "Name", "E-mail", "Nationality", and so on. The "Employee" entity has attributes such as "Name", "Surname", "Email", "Role" and so on. An Employee belongs to one Company while, obviously, a Company has many Employees. This is represented with the 1:N Relationship "Company_Employee". |
Example 1: Delete employees
|
Our goal is to give the possibility to the user to delete employees from the application. The user will be able to select the employees from the list and delete their data. In order to accomplish this example, it is necessary to go through the following steps:
|
|
Possible Enhancement
|
Our goal is to give the possibility to the user to delete more than one employee data at once. The user to select all the employees he wants to delete and delete all their data in a single operation. In order to accomplish this example, it is necessary to go through the following steps:
|
|














