Content Definition: Leave Request Content
This document elaborates on the "Content Definition" section of specification.md.
| Item | Value |
|---|
| Content Name | Leave Request Content |
| Content ID | leave_request_content |
Screen Definitions
Screen Definition List
| Screen Type | Screen ID | Path Type | Script Path | Initial Use | Notes |
|---|
| Application Screen | SCR-001 | Scripting Development | leave/apply/apply | ○ | imwUserDataId is assigned a number by the function container |
| Resubmission Screen | SCR-001 | Scripting Development | leave/apply/apply | ○ | Same as the application screen. Additionally displays the send-back comment |
| Processing Screen | SCR-002 | Scripting Development | leave/approve/approve | ○ | Displays the request details as read-only |
| Processing Detail Screen | SCR-003 | Scripting Development | leave/detail/detail | ○ | Reference only |
| Reference Detail Screen | SCR-004 | Scripting Development | leave/detail/detail | ○ | Uses the same screen as the Processing Detail Screen |
Screen Field Definitions
For details on the screen fields, see specification.md - Screen Field Definitions.
User Program Definitions
Development Model
| Item | Value |
|---|
| Development Model | Scripting development model (SSJS) |
| Screen Technology | JSSP (HTML templates + function containers) |
| User Programs | Server-side JavaScript (action processing / matter end process) |
Action Process List
| Program Name | Deployment Path | Target Node | Processing Content |
|---|
| ActionProcess1 | leave/action/ActionProcess1.js | Application Node | Data saving, validation, and matter property setting on application and resubmission |
| ActionProcess2 | leave/action/ActionProcess2.js | Approval Node | Deducts the remaining balance when the approval is completed |
ActionProcess1 (For the Application Node) Processing Details
| Process Type | Step | Processing Content | Applicable Rule |
|---|
| apply (Application) | 1 | Retrieve the screen input values from the user parameters | - |
| 2 | Validation: Number of days taken ≦ Remaining balance | BR-001 |
| 3 | Validation: For half-day paid leave, start date = end date | BR-002 |
| 4 | Validation: Start date ≧ Application date | BR-004 |
| 5 | Validation: No duplicate request for the same period | BR-007 |
| 6 | On a validation error, return resultFlag = false plus an error message | - |
| 7 | INSERT into leave_request (key: userDataId) | - |
| 8 | Set the number of days taken in the matter property leave_days | - |
| 9 | Return resultFlag = true | - |
| reapply (Resubmission) | 1 | Retrieve the screen input values from the user parameters | - |
| 2-6 | Run the validations (same as on application) | BR-001, 002, 004, 007 |
| 7 | UPDATE leave_request (key: userDataId) | - |
| 8 | Reset the matter property leave_days | - |
| 9 | Return resultFlag = true | - |
ActionProcess2 (For the Approval Node) Processing Details
| Process Type | Step | Processing Content | Applicable Rule |
|---|
| approveEnd (Complete Approval) | 1 | Retrieve data from leave_request using userDataId as the key | - |
| 2 | Add the number of days taken to the days-taken count in leave_balance (UPDATE) | BR-005 |
| 3 | Recalculate the remaining balance (granted days + carried-over days − days taken) | - |
| 4 | Return resultFlag = true | - |
| Other (approve / deny / sendBack, etc.) | - | No business data operation needed. Return resultFlag = true | BR-006 |
Matter End Process
| Program Name | Deployment Path | Processing Content |
|---|
| MatterEndProcess | leave/action/MatterEndProcess.js | Returns whether to send an email (send if data = true) |
Notification Definitions
Notification Method
| Item | Value |
|---|
| Notification Method | Email notification |
| Definition Method | Message definition (recommended method) |
| IMBox Notification | Not used |
Email List
| Send Timing | Notification Type | Recipient | Example Subject |
|---|
| On application | Processing request | Supervisor | "A leave request has arrived" |
| On approval | Processing result notification | Applicant | "Your leave request has been approved" |
| On approval completion | Processing result notification | Applicant | "Your leave request has received final approval" |
| On send-back | Processing result notification | Applicant | "Your leave request has been sent back" |
| On denial | Processing result notification | Applicant | "Your leave request has been denied" |
Replacement Strings
The following replacement strings can be used in the email body.
| Replacement String | Description |
|---|
| Matter property value | leave_days (number of days taken) |
| intra-mart URL | Link to the processing screen or reference screen |
Matter Properties
| Property Key | Set At | Purpose |
|---|
| leave_days | On application | Number of days taken. Used in the email replacement string |
Rule Definitions
This workflow does not use branch routes, so no rule definitions are configured.