prt_api_modify_item

Name

prt_api_modify_item

Purpose

Modify item tracking data.

Description

This routine provides a mechanism to modify Item Tracking Data, associate an Item Type to an unknown Item, associate a Reference ID to an Item ID and associate two Items. The calling routine receives back a status indicating the success or failure of the request. This routine does not allow for the modification of Item attributes, Item attributes are modified using the prt_api_modify_item_att routine.

Syntax

int prt_api_modify_item (timestamp, modify_bitmask, status_bitmask,
                         region_id, region_loc, item_id,
                         reference_id, item_type_id,
                         parent_item_id, item_status,
                         ext_hold_active, group_id,
                         int_hold_active, int_hold_reason,
                         comment, user_or_svc_id, retstat)
cor_time_t       timestamp;
COR_U2       modify_bitmask;
COR_U4       status_bitmask;
char         region_id[PRT_REGION_ID_LEN + 1];
COR_I2       region_loc;
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         parent_item_id[PRT_ITEM_ID_LEN + 1];
COR_U4       item_status;
COR_BOOLEAN  ext_hold_active;
char         group_id[PRT_REGION_ID_LEN + 1];
COR_BOOLEAN  int_hold_active;
char         int_hold_reason[SC_DESCRIPTION_LEN + 1];
char         comment[SC_DESCRIPTION_LEN + 1];
char         user_or_svc_id[SERVICE_ID_LEN + 1];
COR_STATUS   *retstat;

Data Structures

None

Arguments

Argument Description
Input (See SYNTAX for proper order) 
Serialized Items Only
item_id Unique identifier of a Serialized Item (optional if reference id specified)
reference_id Secondary identifier of a Serialized Item (optional if item id specified)
ext_hold_active If TRUE, item held due to external hold (optional)
group_id Group identifier providing reason for hold (required if ext_hold_active = TRUE)
Non-Serialized Items Only
parent_item_id Item ID of associated serialized Item (optional)
Both
Timestamp The time the item was last moved or modified. The timestamp is used to ensure that, when attempting to modify an item, the item has not changed (or moved) between the time when information was last obtained for that item and the attempt to modify it. (One of the fields in the structure that returns data on an item is the last_mod_time field, which indicates the time at which the item was last moved or modified.) If the timestamp argument provided to this function is older than the timestamp associated with the item at the time of the attempted modification, then the modification is not performed and a warning returned. If the timestamp argument passed to this function is zero, the operation is performed without any timestamp checking.
modify_bitmask Indicates fields that have been modified (required). If a bit in the bitmask is set, the corresponding argument provided to this function is required. If a bit is clear, the corresponding argument is not accessed in any way.
The following fields are potentially modifiable and have a corresponding bit in the modify_bitmask .
Field Name Bit Name
item_status ITEM_STATUS_BIT
status_bitmask ITEM_STATUS_BIT
item_id ITEM_ID_MOD_BIT
reference_id REFERENCE_ID_MOD_BIT
item_type_id ITEM_TYPE_ID_BIT
parent_item_id PARENT_ITEM_ID_BIT
ext_hold_active EXT_HOLD_BIT
group_id EXT_HOLD_BIT
int_hold_active INT_HOLD_BIT
int_hold_reason INT_HOLD_BIT
Macros can be used to set the various bits in modify_bitmask to indicate which fields are being modified.
Note: The item_id and reference_id, if both are specified, are used to find the item unless either the ITEM_ID_MOD_BIT or REFERENCE_ID_MOD_BIT is set (both cannot be set). If neither is set, the item you are looking to modify will only be found if both the item_id and the reference_id you supply match that of an item already in the production tracking system. The item_ids need not match, however, if the ITEM_ID_MOD_BIT is set, and similarly, the reference_ids need not match if the REFERENCE_ID_MOD_BIT is set.
status_bitmask Indicates fields in item status that have been modified. (optional)
region_id Region where item last resided (required)
region_loc Location in the region where the item resides (required) For non-serialized items, a specific region location must be specified. For serialized items, the constant ALL_LOCATIONS may be used. This indicates that the item may reside at any location in the region.
item_type_id Item type identifier (required for non-serialized item, optional for serialized items)
item_status Item status (optional)
Comment Comment to be recorded in prt history log file. (optional)
user_or_svc_id User or service identifier (optional)
int_hold_active If TRUE, item held due to internal hold (optional)
int_hold_reason Comment specifying reason for internal hold. (required for activate, does not apply to deactivate)
Output
*retstat Pointer to COR_STATUS structure

Return Value

Either COR_SUCCESS, COR_WARNING, or COR_FAILURE.

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

Error Codes

All error codes returnable by prt_api_modify_item_all (except PRTI_NUM_ATTS_INVALID)