Support > Repository > Workflow > Sending mail [1] setting
ja | en

You can send mail at workflow event. Here, we will explain how to add some items to the model so that you can set the mail destination automatically. R7.9

You can send mail at the occurrence timing of "event" (approval, remand, etc.) at each node.

Figure 1 Mail Sending Function

Rather than fixing the source (originator "From") and destination (recipient "To") of the mail,To the user group assigned to the nodeYou can set it to send.Here I will explain how to do it.


Add the mail address item to the account management model juser provided by Wagby.

Figure 2 juser model with mail address item added

This setting is "Account> Add e-mail address itemIt explains with.


Add a mail address item to the group model jgroup provided by Wagby.

Figure 3 jgroup model with mail address items added
The e-mail address to be set for the group is the e-mail address to the (plural) personal e-mail addressaliasI will do that.You can create such an alias in the internal mail server settings.Please contact the mail server administrator for details.

In the model definition, select "Group (jgroup)" included in "System" tab.Insert "group mail address" as shown in Fig.

item name Item ID Type Attribute to type
Group Mail Address jgroupmailaddress String type mail address
Figure 4 Adding a mail address item to the jgroup model

Flow Participant Setting

We will use two examples of "sequential, sequential, sequential flow" (application → approval → decision) and "sequential, consultative and sequential flow" (application → consultation approval → decision) this time.(FIG. 5, FIG. 6, FIG. 7)

Figure 5 Flow Participant Setting List

In "Sequential, Sequential and Sequential Flow", we apply as application, approval, and decision.

Figure 6 Participants in sequential, sequential and sequential flows

In "sequential, consultation, and sequential flow", applications are made as a group.Also, in the second consultation we will use "approval 1 to approval 4".

Figure 7 Participants in sequential, consultative and sequential flow

Flow pattern

In this "consecutive/consultation/sequential flow" consultation, it is assumed that you set as "next approval 1 to approval 4", if two people approve, proceed to the next.

Figure 8 Sequential, consultation and sequential flow pattern

Workflow setting

Use the flow participant settings in Figure 5 to set up the workflow.Mail settings are also done here.

Figure 9 Flow Participant Setting List

"Flow Participant Setting Name 01" uses "Sequential, Sequential and Sequential Flow".I will send mail when applying.

Figure 10 Flow Participant Setting Name 01

"Flow Participant Setting Name 02" uses "sequential, consultation, and sequential flow".We will send e-mail at the time of application and approval of consultation.

Figure 11 Flow Participant Setting Name 02 (1)
Figure 12 Flow Participant Setting Name 02 (2)

The following items are added to the "yearly leave application" modelAny oneYou add.

Added an item to the holiday application model in Fig. 13

Initial value of "Applicant" item

The applicant will make the logon ID automatically set.

Fig. 14 Initial value setting

Next mail address item

Prepare an item that stores the mail address of the next node to the next approver at the time of application and the next approver (or approver) at the time of approval.

item name Item ID Type formula DB storage Proper use
Next mail address (if user ID only) nextuseridmail String WF_NEXT_USERID_MAIL("juser", "userid", "mailaddress") × When there is no need to send mail to the group
Next mail address (if group ID only) nextgroupidmail String WF_NEXT_GROUPID_MAIL("jgroup", "jgroupid", "jgroupmailaddress") × When you do not need to send mail to users
Next mail address (user ID, group ID mixed) nextmail String WF_NEXT_MAIL("juser", "userid", "mailaddress", "jgroup", "jgroupid", "jgroupmailaddress") × When there is a possibility of sending mail to either user or group
In this sample, three items are prepared for understanding, but actually, as described above, please prepare one item according to your choice.
The above items can be hidden at the time of production operation and can be hidden on the screen.

For details of arguments of each function,WF_NEXT_USERID_MAIL, WF_NEXT_GROUPID_MAIL, WF_NEXT_MAIL Please read the explanation.

Prepare an email template.

Figure 15 Mail template

I will design a mail template."ID" is an identifier that does not overlap.Select "Yearly holiday application" as "applicable model".Items such as "subject" "sender" "body"PlaceholderYou can also include.

Here we design two mail templates "application" and "approval".

Figure 16 Application template
Figure 17 Approval template

Mail transmission type

The operation of each mail transmission type is as follows.

Mail transmission type Behavior
sign up It is transmitted when data is newly registered in the workflow target model (when the save button is pressed).
Application Sent when the workflow application button is pressed.
Approval Sent when the workflow approval button is pressed.
Dismissal Sent when the workflow reject button is pressed.
on hold -(It does not work)
Remand Sent when the workflow return button is pressed.
cancel -(It does not work)
Decision It is transmitted when the approval button by the workflow approver (person assigned to the last node of the flow) is pressed.

[Case] ​​Mail setting by route "person in charge → section chief → department manager → purchasing department → purchasing department manager" route

Here is an example of specifying a mail template with a combination of node and mail transmission type.

  1. When the person in charge makes an "application", the application mail is sent to the section chief with "Template addressed to section manager".
  2. When the section chief "approved", a primary approval mail is sent to the department manager by "director to manager".
  3. When the manager "approves", the secondary approval mail is sent to the purchasing department at "Purchasing department template".
  4. When the Purchasing Department "approves", the third order approval e-mail is sent to the Purchasing Division Manager by "Purchasing Department Manager's Template".
  5. When the Purchasing Department manager "approves", the approval completion mail is sent to the applicant with "Applicant-addressed template".

In this example, three nodes are set for the mail transmission type "approval".By assigning different mail templates to each one, it becomes possible to perform appropriate operation.

You can describe the content of the text area in which you can enter comments when approving or remanding workflows in a mail template. Specifically, by including the next placeholder in the body of the mail template, you can include the contents of the comment entered in the mail.


Likewise, you can include placeholders like the following in outgoing mail.

Model name. Item name notation Contents
${jfcworkstate_p.modelname} Target model name
${jfcworkstate_p.modelpkey} Primary key of the target model
${jfcworkstate_p.participant} participant
${jfcworkstate_p.username} A processor
${jfcworkstate_p.event} Processing content
${jfcworkstate_p.comment} comment
${jfcworkflow_setting_p.participants} Workflow participants
${jfcworkflow_setting_p.flow} Workflow pattern name
${jfcworkflow_setting_p.mail_setting.0.mstype} Mail setting type of mail setting
Because it is a repeating container, specify the corresponding row of the repeating container with the notation ". 0." Or ". 1.".
${jfcworkflow_setting_p.mail_setting.0.mail_template} Email template for email settings
This notation can not be used for calculation formulas.To use the workflow state in the calculation formula, use "function>WorkflowPlease use it.