Store Add Asynchronous Process (straddbatch.ksh)

Module Name

straddbatch.ksh

Description

Store Add Asynchronous Process

Functional Area

Foundation Data

Module Type

Admin

Module Technology

.ksh

Catalog ID

RMS496

Runtime Parameters

N/A

Business Overview

This asynchronous process creates new stores in Merchandising, along with all their associated records when a new store is initiated online in Merchandising or via the Store Subscription API.

Key Tables Affected

Table 3-9 Key Tables Affected

Table Select Insert Update Delete

STORE _ADD

Yes

No

No

Yes

STORE

Yes

Yes

No

No

STOCK_LEDGER_INSERTS

No

Yes

No

No

RPM_ZONE

No

Yes

No

No

RPM_ZONE_LOCATION

No

Yes

No

No

RMS_ASYNC_STATUS

Yes

Yes

Yes

No

RMS_ASYNC_RETRY

Yes

Yes

Yes

No

RMS_ASYNC_JON

Yes

No

No

No

LOC_TRAITS_MATRIX

No

Yes

No

No

COST_ZONE

No

Yes

No

No

COST_ZONE_GROUP_LOC

No

Yes

No

No

STORE_HIERARCHY

No

Yes

No

No

WF_COST_RELATIONSHIP

No

Yes

No

No

SOURCE_DLVRY_SCHED

No

Yes

No

No

SOURCE_DLVRY_SCHED_EXC

No

Yes

No

No

SOURCE_DLVRY_SCHED_DAYS

No

Yes

No

No

COMPANY_CLOSED_EXCEP

No

Yes

No

No

LOCATION_CLOSED

No

Yes

No

No

POS_STORE

No

Yes

No

No

PERIOD

Yes

No

No

No

SYSTEM_OPTIONS

Yes

No

No

No

STORE_ADD_L10N_EXT

Yes

Yes

No

Yes

STORE_ADD_CFA_EXT

Yes

Yes

No

Yes

Design Assumptions

The materialized views MV_LOC_SOB, MV_L10N_ENTITY and MV_LOC_PRIM_ADDR will be refreshed after the store has been added. It is assumed that the materialized view will still be available to other processes during the refresh.

Queue Creation

The function RMS_ASYNC_QUEUE_SQL.CREATE_QUEUE_SUBSCRIBER is called to drop and recreate the queue table if one already exists. This function is called with the JOB_TYPE as STORE_ADD (for example, the constant ASYNC_JOB_STORE_ADD) to create a queue for store processing.

Design Overview - Process Steps

This section describes the key design aspect of the store add process.

The overall process consists of 3 steps as outlined below.

  1. New (status-code: 00NEW). This is the status when store is just created.

  2. Store-Add (status-code: 01STOREADD)

  3. Store-Add-Post (status-code: 02STOREADD_POST)

The status-code of the current completed step of the process is updated in store_add.process_status column.

If STORE_ADD.LIKESTORE column is not null for the store, the status will remain in 02STOREADD_POST and the record will be picked up by the likestorebatch.ksh which runs as an hourly job. If not, then the STORE entry will be removed from the STORE_ADD table.

Running entire store-add as batch in case of AQ issues

In case of Oracle AQ issues if store-add step is not running in async mode then entire store-add proess can also be run in batch using below command

storeaddbatch.ksh $UP

This is provided only as a workaround in case of AQ issues. The recommended method is to let store-add step be processed in Async through AQ as it is designed.

Building Schedule Dependencies between Async process and other batches

Customers may need to build scheduling dependencies between async processes and other batch programs. For example, making pos-extract batches dependent upon completion of Like-store step of the store-add process. To do that, create a job in scheduler using following command and make required batches dependent upon this job.

straddasyncwait.ksh $UP "03LIKESTORE"

Similarly, if batch program needs to be made dependent upon other steps, schedule jobs by passing desired status.

Monitoring Progress of Store-Add Processes

The current completed step of the store-add process is updated in store_add.process_status column. In case of a Like-Store step (which is a separate batch program) the status of a store will remain in 02STOREADD_POST, until it is processed by the likestore batch program, which will in turn change the status to 03LIKETORE.

Once the process is completed, the store will be subsequently removed from the STORE_ADD table. If not, then the status will be changed to '05LIKESTORE_FAIL'.