-
Notifications
You must be signed in to change notification settings - Fork 0
Data Type
Figure 1: Modeling a Data Type
(A) Label and path, (B) Detail area, (C) Base Type
Figure 2: Modeling a Member Variable
(A) Adding a new Member Variable, (B) List of Member Variables, (C) Set the label of the Member Variable, (D) Set the type of the Member Variable
A Data Type is an XMOM Object that declares properties and actions for a specific kind of data. Data Types are attached to Parameters, which describe the signature (input and output) of some Modeling Blocks like Services, Mappings or Conditional Branchings. In detail a Data Type consists of the following elements:
- Base Type: The Base Type is another Data Type from which the given Data Type inherits the implementation. It is an optional element.
- Member Variables: Member Variables define the properties of a Data Type. They can be either a simple type, like a string or a number, or a complex type, which is another Data Type.
- Instance Services: Instance Services define the actions of a Data Type. These Services can be used as regular Modeling Blocks inside the Xyna Process Modeller or with Formula Modeling. The speciality of this kind of Services is the awareness of a certain instance of the corresponding Data Type. Therefore the first Input Parameter in the Services's signature is always dedicated to this instance. In another words: Instance Services operates in the context of a certain Data Type instance.
- Exception Type: An Exception Type is a special Data Type for Error Handling purposes. It describes a specific kind of fault and is used to define, what kind of exceptions might happen during processing a Service or to throw or catch such an exception.
- Storable: A Storable is a Data Type with Base Type xnwh.persistence.Storable. Its instances represent an existing fragment of data in some sort of data store, like a database. There exist simple operations to store, query and delete those virtual objects in the real data store. By defining a Storable-based Data Type the corresponding data store will be configured automatically and accordingly to work with data fragments that are equivalent to the structure of Member Variables of the Storable.
Once created, Data Types can usually come into action and be re-utilized in a variety of processes. To provide the necessary Modeling Blocks for modeling the processes, it is essential to be able to create new Data Types in a simple way. With the Xyna Process Modeller, new Data Types, which are immediately available for further modeling, can be created directly. For this purpose, proceed as follows:
A Data Type can either be created by the New Document symbol in the left icon bar or by conversion of a Prototype Data Type.
Specify the Label (Name is generated automatically and is used to identify the Data Type in its Function Group) and Path (oriented by the structure Department.Section.FunctionGroup). The label should be given in an user-friendly and functional way.
Please note: As per convention, Data Type Labels should begin with a capital letter.
If needed, classify the Data Type as abstract (in the sense of implementation, independent of the abstractness of Prototype Data Types which are used for Rapid Prototyping).
Add a Documentation to the Data Type to describe its purpose.
If needed, add a Base Type. If the newly created Data Type shall inherit the implementation from an already existing Data Type, the Base Type can be added via drag & drop. Alternatively, a drop-down menu opens by clicking into the Base Type field, via which the required Base Type can be selected. In the considered example, a Data Type Dunning State without Base Type would be created at first, followed by two new Data Types Dunning Is Active and Dunning Is Not Active to which the type Dunning State is assigned as Base Type.
If needed, add Member Variables. New member variables can either be added via drag & drop (for complex, i.e. already existing modeled Data Types) or via the plus symbol next to Variables. By selecting the Member Variable, a detail window is opened in which the particular Member Variable can be edited by adjusting Label and Type, Documentation and whether it is a list or not. The label should be given in an user-friendly and functional way. To remove a Member Variable, select it and press <kbd>Del</kbd>.
Please note: The order of Member Variables can be changed by dragging an item to the desired position.
If needed, add Instance Services via the plus symbol next to services. Data Types can have Instance Services beside Member Variables. To remove an Instance Service, select it and press <kbd>Del</kbd>. Instance Services can be used for Workflow modeling, the same way as other Services.
The signature of Instance Services can be modeled analogously to other Services. First, select the instance service from the list. The type of implementation of Instance Services can be configured in three different ways, which are explained in the following:
- Abstract: Such an Instance Service is not executable. If a Datatype has at least one abstract service, it has to be abstract as well.
- Instance Services as Coded Service: This means that the Instance Service is implemented in Java. Analogous to Coded Services, the implementation can either be realized as Code Snippet or via an external Java project. The creation of an external Java project is described below.
- Instance Services as Reference to a Workflow: Instance Services can also be realized via modeled Workflows. However, only Workflows with the proper signature can be utilized. Take care that the Data Type containing the Instance Service always appears as first Input Parameter of the Workflow to be referenced .
If you select Reference, a drop-down menu, from which you can select the to be utilized Workflow, is activated by clicking inside of the input field.
In order to implement the modeled Instance Services of a Data Type, a Java Template can be generated and downloaded using the Download Template symbol in the left icon bar. The created zip file in this process (wait for the Download was successful message, the process might take up to a minute) contains a Java Project ready to be edited and implemented in an external Integrated development environment (IDE) e.g. Eclipse (Import Java Template into Eclipse).
Please note: To generate the Java project via CLI, execute the command buildserviceproject
for the concerned Data Type.
Save and deploy the Data Type via the Deployment symbol in the left icon bar (<kbd>Ctrl+Shift+D</kbd>). From now on, this Data Type is part of the XMOM, so it can be found inside the Factory Navigation, it can be searched for and so on. As for Data Types, there is no differentiation between saving and deployment. Created Data Types are immediately available and can be integrated into executable processes.
You can open Data Types from nearly wherever they are displayed or even used as Parameters, e.g. from inside of a Workflow, out of the Factory Navigation or the Search area of the Xyna Process Modeller. To open and edit a Data Type, open its context menu (double or right click on it) and select Open in new Tab.
A Data Type can be renamed from inside the Factory Navigation by using the Data Type's context menu and choosing Move/Rename. The following dialog will guide through this process.
With this action, all references to the moved object will be adjusted. After the action has finished, a report will show information on the modifications done.
To remove a Data Type, you have to open its context menu (double or right click) inside of the Factory Navigation and Search area and select Delete from XMOM.