Support > Repository > Workflow > Narrow the application flow according to the conditions
ja | en

At the start of workflow, you can narrow down the application flow that matches the conditions. R7.4

This is an example of applying workflow to 'purchase article purchase' model.When opening the registration screen, application flow can be selected "Sales partial item purchase inquiry flow 1".This is defined as a flow of 100,000 yen or less.(Described later)

Figure 1 Initial application flow option

When you enter the amount, the screen redraws and the application flow changes.In this case, when the amount exceeds 100,000 yen, we switch to "sales partial item purchase inquiry flow 2".

Figure 2 Entering the amount field
Figure 3 Application flow is switched

When the amount exceeds 200,000 yen, it will switch to "sales partial goods purchase inquiry flow 3".

Figure 4 Application flow switched (2)
Always set at least one option flow so that you can select it.Since this item is mandatory, if the screen is redrawn with a blank state, an input error message will be displayed on the screen.

Model definition

The definition of "goods purchase inquiry" model is as follows.Apply workflow to this model.

Figure 5 Item purchase inquiry model

Assume that the "amount" item redraws the screen when changing the value.

Figure 6 Setting to redraw the screen when changing the value

account

We will prepare the following five accounts.

accountName
user1User 1 (Applicant)
user2User 2
user3User 3
user4User 4

rule

When applying, which workflow can be applied is the following rule.

Amount of moneyFlow 1Flow 2Flow 3
Less than 100,000 yen--
100,000 yen or more and less than 200,000 yen--
200,000 yen or more--

Flow Participant Setting

Prepare "flow participant setting" in the built application.Apply the above rule.

"Sequential, sequential, sequential, sequential flow" is not provided by the standard, please add a separate "flow pattern" model.
Figure 7 Flow Participant Setting List

"Flow 1 for purchasing business partial goods purchase flow" shall be flow for less than 100,000 yen.There are two nodes.

Figure 8 Sequential and sequential flow definition

"Flow of two items purchase inquiry flow 2" is a flow for 100,000 yen or more and less than 200,000 yen.There are three nodes.

Figure 9 Sequential, sequential and sequential flow definition

"Flow 3 for purchasing business partial goods purchase flow" shall be flow for 200,000 yen or more.There are four nodes.

Figure 10 Sequential, sequential, sequential, sequential flow definition

Workflow setting

We will link the above three flows to 'purchase goods purchase'.

Set the following formula as "Effective condition" under the setting "Sales partial article purchase inquiry flow 1".

return kian.price < 100000
Figure 11 Setting the effective conditions for business part purchase inquiry flow 1

Set the following formula as "effective condition" under the setting "Sales partial item purchase inquiry flow 2".

return kian.price >= 100000 && kian.price < 200000
Figure 12 Setting the effective condition of business part purchase inquiry flow 2

Set the following formula as "effective condition" under the setting "Sales partial article purchase inquiry flow 3".

return kian.price >= 200000
Figure 13 Setting valid conditions for business one-part purchase inquiry flow 3

At this point, we have provided the three workflow settings.

Figure 14 Workflow settings

By setting "effective condition" like this, if it meets this condition, it will be displayed on the screen as a choice of application flow.

The effective condition is described as an expression of "server side JavaScript".

The programming grammar is JavaScript.Detail is"Business logicPlease read.

Camel notation applies to item names

As for "Model ID", the name stated in the design information can be used as it is.(In the example above, it is expressed as "kian".)

Camel notation is applied to "Item ID".
For example, if the item ID is "group_cd", it is written as "groupCd" in the script.

return koubai_model.groupCd == 1