Monday, December 12, 2016

Conceptwave Metadata

As this blog is more for Conceptwave technical discussions, so starting with Metadata that we have in Conceptwave briefly.

Metadata Objects :

We have lot many on Metadata and below covers on most used in day to day applications.
  1. Data Types
  2. Data Structures
  3. Documents
  4. User Interfaces (Presentation UI)
  5. Finders
  6. Global Scripts
  7. Processes
Data Types :

As we know, in any programming language we need to define some variables to do some operations. Conceptwave also contains different types of inbuilt data types like String, integer, Boolean, double etc. In addition to it, we can define our own data types too and assign the values to that data type dynamically (from Finders etc or from Code tables etc) or statically (from enumeration values etc). 

Defining own datatype:

1. Dynamic Way
: Suppose, if we wanted to create a one country data type display as a drop down values dynamically based on new countries addition or update or deletion below are the steps.

Step 1 : In your UI write the logic to get the results (we can use script finder or SQL finder based on requirement) and set the parameter with some parameter name using Global.setSessionParameter.

Step 2: Create one finder and get the session parameter details using Global.getSessionParameter.

Step 3 : Create new data type and in the properties of this data type, we will find one option to select the finder which is created in Step 2.

After completion of these steps, we declare variables from UI and assign this data type to it which will give us results every time (based on updates/additions/deletions).

We can also get the results dynamically from Code tables (based on table entries) for this data types. For this purpose we have to provide code table name in properties tab of data type.

2. Static Way : Suppose, if we wanted to create a data type with some standard values then we can provide enumeration values by adding those from designer. 

Data Structures:

Data Structures allow us to define our own data structure to perform our business logic by adding list of things to it. To write our own interfaces also we have to provide our request and response data structures to process further.

Documents:

We can create document and link that to UI to perform field level validations and to store or retrieve data from the data base.

Suppose, we wanted to save 2 UI field details say Customer Id and Customer Name to a table tbl_customer then we can create a document with these 2 fields and map the document values to the table in the database and save the values using <yourDoc>.save(). We can link this document to UI by adding this into variables list under Variables tab of that UI.

We can also perform validations on these fields and display error icon beside the fields if they are any validation violations as part of page leave validations.

We will be using these documents as input or output document in finders etc too.

User Interface (Presentation UI) :

This is used to create our View layer. We have almost all the elements that we have it in HTML like Forms, text fields, buttons, select box, search type etc in Conceptwave too. But the facility that Conceptwave provide is, we need not to write all the tags like HTML for instance <form/>, <input/>, <button/> etc., as it has all these inbuilt. So we just click and select the required input type and make use of those features.

After adding the required elements we can specify name, display label, data we wanted to display to that field (saved data), text data max size, type of data allowed, operation on that particular fields like onClick methods, run trigger on selection of any field, onBlur events, editable or not, visible permissions, any dynamic label, tooltip, label/field alignment etc.

As described, we will link documents to UI to save, retrieve data and perform validations too. To enable validations on the documents by default we have to check validate check box after adding document to UI under variables tab.

We can link one UI to another UI as well but adding child UI under variables tab which will behave like parent and child. We can get the objects/variables from parent UI to child UI using this.parent.<variableName/functionName>.

We can also open new dialog windows as well using common.dialog.

We can display alert messages and all too as we do in HTML.

Finders:

Finders are mainly used to get result data and display them in table format using result form.

We have different types of finders in Conceptwave like
  • Script Finders
  • SQL Finders
  • Document Finders
  • Rule Finders 
Based on the requirement we have to choose the finder. Suppose, if we wanted to retrieve results from completely through SQL queries then we can go for SQL finders. If we wanted to write our logic based on some variable values and perform some java script operations then we can go with Script finders etc.

Global Scripts:

Apart from writing function as part of UI, we can write global scripts too which are mainly used for reusable purpose.

Note: We can modify global scripts during run-time too without stopping designer.

Processes: 

This is another useful feature of Conceptwave. We can use these processes to automate user operations for online applications where user intention is not required. 

We will be using CW workflow to achieve these. We will be building up a flow diagram similar to our flow chart.

This workflow contains start of the process, conditions and from conditions related operations will be performed and after completion of all these process we will end it. We can also use sub-processes too in these processes.

We have 2 types of processes in Conceptwave.

1. User Process
2. Global Process

User process will gets invoked based on some User Action but Global processes will gets invoked automatically. Use Global business process for high CPU or high memory or complex business process. Which will help us to separate the UI and Business process in different Nodes. This will help us to reduce the load and avoid GCs in UI servers. So we can ensure the application availability to 100%.


No comments:

Post a Comment