Continue to design the structure. We will consider whether it can be defined by Wagby's expressions and functions.

Figure 1 shows the handling of calculation formulas in Wagby."Initial value" and "derivable item" can be described as design information."Transaction" is realized by an external program.

Fig.1 Application of calculation formula

initial value

When data is newly registered, it is defined in advance.For example, you set "Date of today" as the initial value of the date type item.

Derivable items

It is defined automatically from the values ​​of other items.For example, if "sales = quantity x unit price", the sales item is determined at the stage when the quantity item and unit price item are entered.

It is also decided whether to save derivable items in the database or not.The standard setting of Wagby is "save".In this case, do not recalculate when opening the display screen, display it using database values.If you decide not to save, always recalculate.

In Wagby, the items derived by the formula areRead only.That is, you can not define an item that is calculated by an expression but can also be input.(Techniques for preparing two items for this need are known.)


This is a process that simultaneously increases or decreases the value of another related model as a certain operation (data registration or update).For example, at the timing of new registration of a sales slip, processing such as reducing the number of stocks of goods described in the slip.(Usually, the sales document model and the product inventory model are prepared separately.)

In Wagby, arithmetic expressions (initial values ​​and derived items) closed to one model can be described as design information.This is treated as "structure".Only when it is an expression that spans a model, it is realized as an external program.In this case we treat it as "behavior" rather than structure.

Wagby is a generalArithmetic arithmetic expressionIn addition,functionYou can use.

Figure 2 Arithmetical operations and functions

Especially,In the model reference relation provided by Wagby, it is possible to specify whether it is "ID part" or "content part" of the reference destination item.
AlsoReference linkageBy using, you can describe the calculation formula with the value of the referenced model posted to your model, so you can express in various ways.

Many functions are designed to be compatible with Excel.For example, the following expression for obtaining age from birth date is also known as an example of Excel's DATEDIF function.

DATEDIF(${birth}, TODAY() ,"Y")

Since Wagby does not describe a program, it does not have the concept of "variable".

Although expressions and functions can be described, they are represented by one line and variables can not be prepared in the expression.

However, in some calculations, you may want to temporarily maintain a certain value and also refer to expressions of other items.There are times when we prepare hidden items.

This hidden item is often designed to not save database.It can be handled like a variable that holds intermediate results of calculation.That is, it is permissible to change the structure of the model (add items) at this stage.

In some business applications, you may be asked for complex expressions that are not practical to write in the framework of Wagby.For example, it is an expression involving dozens of condition judgments.In general, it is a corresponding theme in the programming language, but there are things that can be treated as stylized requirements (for example, using a decision table).In such a case, the business logic can be managed by BRMS (Business Rule Management System).

If you find many such processing patterns, you should consider introducing another tool such as BRMS.Wagby is not the only tool that meets all business requirements.Rather, the design philosophy,We intend to prepare cooperation with other tools by making the application built by Wagby as open as possible.

Of course, instead of introducing BRMS, there are also ways to accomplish (business requirements) with database stored procedures or call another program.All of these correspond in the category of "customization".We will talk about customization later.

We will organize the point at which timing these tasks are realized at this time.

  • It is processed simultaneously at the timing of registration / update.
  • When you press a button while opening the registration / update screen, the result is reflected in the item.
  • When entering a value in a certain item (processing is executed) while the registration / update screen is open, the result is reflected in another item.
  • By pressing the button on the detailed screen or list screen, processing is called up.

We will deal with these themes when we begin customization.

Review the application built by describing the expression and review it with the stakeholders.Verify that the expression works with the input value and that the value of the expression is correct.

Wagby's skills required to do so far are as follows

By learning the description of the expression,You will be able to format some of the primary keys.

Please wait for a while as the "transaction" process introduced in this chapter and the realization of complicated business process will be handled by customization which is the final phase of Wagby design.At this stage, we will assume that such customization is ultimately needed.

We will deal with "behavior" from the next chapter.The first theme to handle in behavior is "screen transition".