Data Type - Xyna-Factory/xyna GitHub Wiki
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 distinctive feature of this kind of Service 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.
There are following special types of Data Types:
- 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.
Like other XMOM Objects Data Types can be modeled inside the Xyna Process Modeller. This modeling is described below. Beside regular Data Types Exception Types and Storables offers more modeling possibilities, which are not described here. Therefore please review the detailed description of how to model a Storable or Exception Type.
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 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.
===Add Member Variables=== 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, 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 Del.
Please note: The order of Member Variables can be changed by dragging an item to the desired position.
A datatype can define Instance Services, a subcategory of Services that takes an instance of the datatype as first argument. See Instance Service for details.
Save and deploy the Data Type via the Deployment symbol in the left icon bar (Ctrl+Shift+D). 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.