EFW Batch Processing Example Introduction

EFW provides powerful batch processing capabilities that allow developers to write batch processing logic using JavaScript and execute it in both Windows and Linux environments. The following is a complete batch processing example.

1. Processing Startup Scripts

1.1 Windows Batch Startup Script

Filename: helloBatch.bat

1.2 Linux Batch Startup Script

Filename: helloBatch.sh

2. Batch Processing Business Logic

Main File: helloBatch.js

Parameter Definition

var helloBatch = {};
helloBatch.paramsFormat = {
    "sysDate": "format:yyy/MM/dd;display-name:sysdate"
};

Main Functional Modules

3. Execution Process

  1. Environment Preparation: Set up JDK, TOMCAT paths and classpath
  2. Parameter Passing: Pass system date parameters via JSON format
  3. Log Recording: Redirect output to log files
  4. Business Execution: Execute each functional module in sequence
  5. Result Return: Return execution results through Batch object

4. Technical Features

5. Usage Instructions

Execute in Windows Environment

helloBatch.bat

Execute in Linux Environment

chmod +x helloBatch.sh
./helloBatch.sh

View Execution Results

tail -f $TOMCAT/logs/helloBatch.log

This example demonstrates the powerful functionality of the EFW batch processing framework, covering common enterprise application scenarios such as file processing, database operations, and API integration, providing a complete solution for complex batch processing tasks.