Batch Processing Overview
Allocation contains a set of batch processes that are run in Java. Broadly, the batch processing falls into five categories:
-
Schedule Allocation batch - ScheduledAllocationBatchClient.java creates the child allocations for parent allocations that are scheduled for the day.
-
Daily Cleanup batch - SessionCleanUpBatchClient.java deletes data from the temporary tables used by the Allocations and Calculation engine.
-
Purge batches - Purge batches delete Allocation and Worksheet data from the Allocation tables, which were created before a certain time period.
-
Rule Level On Hand (RLOH) batches - For RLOH, there are six batch update processes that share the same java batch file; InventorySnapshotBatchClient.java.
-
Dashboard Refresh batch - The Dashboard Refresh batch refreshes both Stock to Sales and Top to Bottom Dashboard reports Data.
Batch Processes
The following table describes Oracle Retail Allocation's batch processes:
Table 4-1 Allocation's Batch Process and associated Java Packages
Batch Name | Batch Process | Package |
---|---|---|
Schedule Allocation Batch |
ScheduledAllocationBatchClient.java |
oracle.retail.apps.alc.batch.client |
Daily Cleanup Batch |
SessionCleanUpBatchClient.java |
oracle.retail.apps.alc.batch.client |
Purge Batches |
PurgeBatchRunnable.java |
oracle.retail.apps.alc.batch.client |
RLOH Batch Update |
InventorySnapshotBatchClient.java |
oracle.retail.apps.alc.batch.client |
Dashboard Refresh Batch |
AlcDashboardCleanUp.ksh |
oracle.retail.apps.alc.batch.client |
Running a Java-based Batch Process
To run a Java-based batch process, Oracle Retail provides sample shell scripts (.sh files) and batch files (.bat files). These sample shell scripts must be modified according to the retailer's installation. They perform the following internally:
-
Set up the Java runtime environment before the Java process is run.
-
Trigger the Java batch process.
Scheduler and Command Line
If the retailer uses a scheduler, arguments are placed into the scheduler.
If the retailer does not use a scheduler, arguments must be passed in at the command line.
For UNIX systems, the Java process is scheduled through an executable shell script (.sh file).
Note:
The AllocScheduleBatch.ksh
and AlcDailyCleanUp.ksh
batches can be run by an external scheduling system or a simple UNIX CRON job.
Running the Dashboard Refresh Batch
Take the following steps to run the Daily Cleanup batch:
-
Login to the application server machine using <username>/<password>.
-
Navigate to the batch folder. In the batch folder, verify that the AlcDashboardCleanUp.ksh file is present.
-
Run the AlcDashboardCleanUp.ksh batch using the following command:
ksh AlcDashboardCleanUp.ksh <systemadministratoralias>
The batch runs by taking the batch user from wallet.
Running the Schedule Allocation Batch
Installation and build scripts create the required user for running the batch in the wallet. There is no way you can cross check to determine whether the user is created inside the wallet other than running the batch scripts. However, you can see if the wallet is present in the environment by checking the wallet location. The wallet location is present in batch.properties file. The wallet is created with a user_id, password and an alias name.
Once the wallet is created the csm.wallet.path key in batch.properties file should be updated.
Only those users who have their role mapped to the SYSTEM_ADMINISTRATOR_JOB enterprise role in LDAP, have the privilege to execute the Schedule Allocation batch script. During installation, Allocation creates the SYSTEM_ADMINISTRATOR user, by default, in the Retail Wallet, which is mapped to the SYSTEM_ADMINISTRATOR_JOB enterprise role in LDAP. An alias for any new user mapped to SYSTEM_ADMINISTRATOR_JOB role in LDAP has to be created in the Wallet in order to execute the Schedule Allocation batch script.
Note:
Use the save_credential.sh
script to create a new user in the Wallet. For more information on instructions to run the save_credential.sh script
to add a new user, see the Oracle Retail Allocation Installation Guide.
The batch.properties file exposes a few configuration parameters related to concurrency management or parallel execution which need to be tuned by the retailer based on the volume of transactions. The concurrent processing in batch is implemented leveraging the standard Java Executor service APIs. The sample file with default configurations will be made available and need to be modified by the retailer to suit to their requirements.
The section below describes the properties that can be configured.
-
initialThreadLimit: Initial number of threads in the pool that are available to create child allocations. The default value is 5.
-
maxThreadLimit: Maximum number of threads that can be allowed in the pool. The default value is 10.
-
queueLimit: Size of queue of pending tasks to create child. The default value is 1.
-
providerUrl: URL of the server module (for example, t3://<weblogic host>:<port>). This parameter has to be configured by the retailer to point to the WebLogic Server on which Asynchronous application instance is deployed.
-
csm.wallet.partition.name: Partition name in the wallet (for example, alloc13)
-
csm.wallet.path: Location of Wallet
-
Login to the application server machine using <username>/<password>.
-
Navigate to the batch folder. If the batch folder is not found, the batch installation did not occur properly. In the batch folder, verify that the
AllocScheduleBatch.ksh
file is present. -
Run the
AllocScheduleBatch.ksh
batch using the following command:ksh AllocScheduleBatch.ksh <systemadministratoralias>
The batch runs by taking the batch user from wallet.
Running the Daily Cleanup Batch
Take the following steps to run the Daily Cleanup batch:
-
Login to the application server machine using <username>/<password>.
-
Navigate to the batch folder. In the batch folder, verify that the
AlcDailyCleanUp.ksh
file is present. -
Run the AlcDailyCleanUp.ksh batch using the following command:
ksh AlcDailyCleanUp.ksh <systemadministratoralias>
The batch runs by taking the batch user from wallet.
Running the Purge Batches
Use the following steps to run the Purge batches:
-
Login to the application server machine using <username>/<password>.
-
Navigate to the batch folder. In the batch folder, verify that the AlcPurgeAlloc.ksh and AlcPurgeWksht.ksh files are present.
-
Run the both batch processes using the following command:
ksh AlcPurgeAlloc.ksh <systemadministratoralias> PURGE_ALLOC ksh AlcPurgeWksht.ksh <systemadministratoralias> PURGE_WORKSHEET
The batch runs by taking the batch user from wallet.
Running the Rule Level On Hand Batch
Take the following steps to run the RLOH batch:
-
Login to the application server machine using <username>/<password>. Once logged in, the default folder is /home/alcbatch.
-
Before running the batch, make sure that all the corresponding profile properties are set. For that run the profile file first. Go to the Profiles folder inside alcbatch.
-
If there are multiple environments, there are separate profile files for every machine (for example, QA, DEV, TEST). Make sure to identify the right profile file here. Most likely it will be the name of the environment, run the profile file - ./alc132Linuxdev (for example, Dev 13.2 Env).
-
After running the profile successfully, go back to alcbatch. There are separate folders for every machine's batch under the alcbatch folder. Go to the current machine's folder. (Most likely the folder name would be same as your profile file name, in this case alc132Linuxdev).
-
Run the following scripts inside the batch folder in the following order:
-
ksh AlcSnapshotSOH.ksh <BatchUserAlias>
-
ksh AlcSnapshotOnOrder.ksh <BatchUserAlias>
-
ksh AlcSnapshotAllocIn.ksh <BatchUserAlias>
-
ksh AlcSnapshotCrosslink.ksh <BatchUserAlias>
-
ksh AlcSnapshotAllocOut.ksh <BatchUserAlias>
-
ksh AlcSnapshotCustomerOrder.ksh <BatchUserAlias>
-
Summary of Executable Files
The following table describes the executable shell scripts and batch files:
Table 4-2 Scripts to initiate the deletion process
Executable Shell Scripts (UNIX) | Executable Batch File For Windows | Description |
---|---|---|
AllocScheduleBatch.ksh |
No batch file is available |
Triggers the schedule batch client. |
AllocBatch.ksh |
No batch file is available |
Configures the environment variables sourced by other batch scripts. This script is not to be run/scheduled in a stand alone mode. |
AlcSnapshotSOH.ksh |
No batch file is available |
|
AlcSnapshotOnOrder.ksh |
No batch file is available |
|
AlcSnapshotAllocOut.ksh |
No batch file is available |
|
AlcSnapshotCustomerOrder.ksh |
No batch file is available |
|
AlcSnapshotCrosslink.ksh |
No batch file is available |
|
AlcSnapshotAllocIn.ksh |
No batch file is available |
|
AlcDailyCleanUp.ksh |
No batch file is available |
Deletes data from the temporary tables. |
AlcPurgeAlloc.ksh |
No batch file is available |
Deletes old Allocations from database table |
AlcPurgeWksht.ksh |
No batch file is available |
Deletes old Worksheets from database table |