prt_api_move_item

Name

prt_api_move_item

Purpose

Move item to location in tracking region

Description

This routine provides a mechanism for moving an Item from the Tracking Region where it currently resides to a new Tracking Region. It also permits the movement of an individual Item from one location to another within the same Tracking Region. The semantics of this call specify that if neither the item_id, reference_id , or item_type_id is specified, all items are moved from the specified source to the specified destination region. If neither the item_id or reference_id is specified, but the item_type_id is, a single item of the specified type is moved from the source to the destination region. If we're moving a serialized item, the source location need not be given. The specification of the destination region location argument is the same as that for the prt_api_add_item function if the insert_flag passed in is FALSE, and is the same as that for the prt_api_insert_item function if the insert_flag passed in is TRUE.

Syntax

int prt_api_move_item ( src_reg_id, dest_reg_id, src_reg_loc,
                        dest_reg_loc, insert_flag, item_id,
                        reference_id, item_type_id, comment,
                        user_or_svc_id, retstat)
char        src_reg_id[PRT_REGION_ID_LEN + 1];
char        dest_reg_id[PRT_REGION_ID_LEN + 1];
COR_I2      src_reg_loc;
COR_I2      dest_reg_loc;
COR_BOOLEAN insert_flag;
char        item_id[PRT_ITEM_ID_LEN + 1];
char        reference_id[PRT_ITEM_ID_LEN + 1];
char        item_type_id[PRT_ITEM_TYPE_ID_LEN + 1];
char        comment[SC_DESCRIPTION_LEN + 1];
char        user_or_svc_id[SERVICE_ID_LEN + 1];
COR_STATUS  *retstat;

Data Structures

See Static Information Requirements

Arguments

Argument Description
Input
Serialized Items Only
item_id Unique identifier of a Serialized Item (optional if reference_id is specified).
reference_id Secondary identifier of a Serialized Item (optional if item_id is specified).
Both Serialized and Non-Serialized Items
src_reg_id Source region id; region the item is moving out of (required).
dest_reg_id Destination region id; region the item is moving into (required).
src_reg_loc Source region location; sequence number of the item in the source tracking region. Specified as FIRST (EXIT), LAST (ENTRY), or a number from 1 to n, where n is the number of items in the queue. required for non-serialized items, optional for serialized items).
dest_reg_loc Destination region location; sequence number of the item in the destination tracking region. Specified as FIRST (EXIT), LAST (ENTRY), or a number from 1 to n, where n is the number of items in the queue. (required).
insert_flag If TRUE, the moved item is to be inserted in the Destination Tracking Region queue before the item located at the specified destination region location, unless the manifest constant LAST (ENTRY) is specified, in which case the item is inserted after behind) the last item currently present in the region. (required).
item_type_id Item type identifier (required for non-serialized items, optional for serialized items).
comment Comment to be recorded in PRT history log file (optional).
user_or_svc_id User or service identifier. This is used for logging purposes and is optional. If this pointer is NULL, the host process id is used. (optional)
Output
*retstat Pointer to COR_STATUS structure

Return Value

Either COR_SUCCESS or COR_FAILURE.

If the function returns COR_FAILURE additional error information can be found in the COR_STATUS structure.

Error Codes

PRTC_NON_SER_ID Non-serialized item has item or ref. id (Failure)
PRTC_SER_NO_ID Serialized item missing both item & ref. id (Failure)
PRTC_UNKNOWN_REGION Unknown REGION specified (Failure)
PRTC_BAD_REG_LOC_SPEC Bad region location specified (Failure)
PRTC_ITEM_STAMP_TOO_NEW An affected item has changed since the last display (Failure)
PRTC_ADD_LOC_TOO_BIG Cannot add item to unoccupied location- inserting (Warning)
PRTC_ADD_MULTIPLE_SERIAL Cannot have two serialized items at one location (Warning)
PRTC_REGION_NOT_LOCKED Lockable region %s not locked; cannot perform operation (Warning)
PRTI_ITEM_TYPE_NULL Item type identifier NULL (Warning)
PRTI_ITEM_TYPE_NDEF Item type identifier not valid (Warning)
PRTI_NON_SER_ID Non-serialized item has item id or reference id (Warning)
PRTI_SER_NO_ID Serialized item missing both item id and reference id (Warning)
PRTI_REG_ID_NULL Region identifier NULL (Warning)
PRTI_REG_ID_NDEF Region identifier not valid (Warning)
PRTI_INVALID_REG_LOC Invalid region location (Warning)
PRTI_ITEM_TYPE_NULL Item type identifier NULL (Warning)
PRTI_INVALID_DEST Destination region is invalid for item of this type (Warning)
PRTI_MF_INIT_ERR Error initializing segment (Failure)
PRTI_CRESEG_ERR Error creating segment (Failure)

Plus all error codes returnable by prt_api_send_cmd.