DECEDI_POST(3) — Subroutines
Name
DECEDI_POST − This enables the caller to submit one or more files into the DEC/EDI Server. These files may be posted directly to the Communications Service, through the Translator or via the Mapper.
The type of file being posted must be specified, and can be one of the following:
•Application_file -- files are posted to the Mapper on the Server. These files are also known as structured files.
•Transmission_file -- files are posted to the Communications Service on the Server, bypassing any translation or mapping. These files are also known as unstructured files.
•Document -- files are posted to the Translation Service on the Server. These files are also known as ’ihf’ files.
C Binding
#include <decedi_api_def.h>
unsigned long int DECEDI_POST ( application,
overrides,
files )
char ∗application;
decedi_t_item_list overrides;
decedi_t_item_list files;
Arguments
application
The name of the client application submitting the request to the Server. This is a null-terminated character string. This argument is used by DEC/EDI as a means of authenticating the request; the client application must be registered as an authorized application on the Server. Applications are registered by using the CommandCenter Management Services Editor. For more information, refer to DEC/EDI Configuring.
overrides
An item list specifying the overrides to apply to all files in this request. Build the item list using one or more calls to DECEDI_ADD_ITEM_LIST. Table 1 gives the item identifier values allowed in the item list.
Note that there are ’File overrides’ in addition to these command overrides. The File overrides apply to each specific file fetched’ whereas command overrides apply to the entire command. See the ’files’ argument for further information.
Table 1: DECEDI_POST Override Identifies
| Value | Description |
| ----- | ----------- |
| DECEDI_ITM_CONNECTION_DATA | This provides information to the communications connection which overrides the defaults for that connection. This field is specific to the type of gateway referenced by the connection id. Please refer to the CommandCenter Trading Partner Editor’s on-line help for types support this feature, and what format they expect the data in. |
| DECEDI_ITM_LINK_ID | Connection ID, if bypassing the mapper and translator. The value associated with this is a character string. This item is mandatory when the file type (DECEDI_ITM_FILE_TYPE) is DECEDI_FILE_TYPE_TRANSMISSION_FILE. |
| DECEDI_ITM_PRIORITY | Specifies the priority the Server is to give to these files. The value associated with this is an unsigned integer containing one of the allowed values specified in Table 3. If not specified then DECEDI_NORMAL_PRIORITY is assumed. |
| DECEDI_ITM_TEST_INDICATOR | Specifies whether to treat the files in this request as test submissions or live submissions. The value associated with this is an unsigned integer containing one of the allowed values specified in Table 2. If not specified then DECEDI_LIVE is assumed. |
Table 2: Values for DECEDI_POST Test
| Value | Description |
| ----- | ----------- |
| DECEDI_LIVE | Files in this request are live business files. |
| DECEDI_MAPPER_TEST | Files in this request are to be tested through to the mapper but no further. |
| DECEDI_PARTNER_TEST | Files in this request are to be tested through all services to the destination partner, and where possible, marked as being a test by the relevant services. |
| DECEDI_TRANSLATION_TEST | Files in this request are to be tested through to the Translation Service but no further. |
Table 3: values for DECEDI_POST Priority
| Value | Description |
| ----- | ----------- |
| DECEDI_HIGH_PRIORITY | Files in this request are to be treated as high priority objects. These objects are processed by the translation and Communications Services immediately, rather than at scheduled intervals. |
| DECEDI_NORMAL_PRIORITY | Files in this request are to be treated as for normal processing. |
files
Item list specifying the files to be posted in this request. Build the item list using one or more calls to DECEDI_ADD_ITEM_LIST.
The item identifier values allowed in the item list for this request are given in Table 4.
Note that the DECEDI_ITM_FILE_NAME must be the first file item for each file.
Table 4: DECEDI_POST File Override Identifiers
| Value | Description |
| ----- | ----------- |
| DECEDI_ITM_BUSINESS_REFERENCES | User application references to be added into the document audit trail for later tracking and reporting. This is a string value containing up to 5 values, each separated by a comma. Empty values are allowed so the user can target save references to one or more particular slots in the 5 available. This optional item is applicable only when DECEDI_ITM_FILE_TYPE specifies structured application files (DECEDI_FILE_TYPE_APPLICATION_FILE) or internal format files (DECEDI_FILE_TYPE_DOCUMENT). |
| DECEDI_ITM_COMMENT | Comment to be added to the mapping audit trail. The value associated with this is a character string. This optional item is applicable only when DECEDI_ITM_FILE_TYPE specifies structured application files (DECEDI_FILE_TYPE_APPLICATION_FILE). |
| DECEDI_ITM_DEBUG | Specification of the file on the client to which the mapper debug output is to be written. The value associated with this is a character string. This optional item is applicable only when DECEDI_ITM_FILE_TYPE specifies structured application files (DECEDI_FILE_TYPE_APPLICATION_FILE). |
| DECEDI_ITM_NO_DEBUG | Specifies that there is to be no mapper debug output. This optional item is applicable only when DECEDI_ITM_FILE_TYPE specifies structured application files (DECEDI_FILE_TYPE_APPLICATION_FILE). |
| DECEDI_ITM_ERROR_LOG | Specification of the file on the client to which the error log output is to be written. The value associated with this is a character string. This optional item is applicable only when DECEDI_ITM_FILE_TYPE specifies structured application files (DECEDI_FILE_TYPE_APPLICATION_FILE). |
| DECEDI_ITM_NO_ERROR_LOG | Specifies that there is to be no error log file. This optional item is applicable only when DECEDI_ITM_FILE_TYPE specifies structured application files (DECEDI_FILE_TYPE_APPLICATION_FILE). |
| DECEDI_ITM_FILE_NAME | Specifies the location and name of the file to post. The value associated with this is a string. This must be the first file item for each file. This item is mandatory and must be placed first in the item list. |
| DECEDI_ITM_FILE_TYPE | Indicates the type of the file that is being posted. The Server handles files differently, depending on the type of the file. The value associated with this identifier is an unsigned integer. The valid values for this flag are given in Table 5. If not specified then DECEDI_FILE_TYPE_APPLICATION_FILE is assumed. |
| DECEDI_ITM_INTERNAL_REF | Return the Server’s internal reference for this object. The value associated with this will be a string that is long enough to hold the returned string. The flag attribute DECEDI_WRITEABLE must be specified when adding this value to the item list. |
| DECEDI_ITM_IO_DEBUG | Specification of the file on the client to which the mapper I/O debug output is to be written. The value associated with this is a character string. This optional item is applicable only when DECEDI_ITM_FILE_TYPE specifies structured application files (DECEDI_FILE_TYPE_APPLICATION_FILE). |
| DECEDI_ITM_NO_IO_DEBUG | Specifies that there is to be no mapper debug output. This optional item is applicable only when DECEDI_ITM_FILE_TYPE specifies structured application files (DECEDI_FILE_TYPE_APPLICATION_FILE). |
| DECEDI_ITM_LOCAL_TEST | Specification of the input file on the Server to use when the mapper is in local test mode. The value associated with this is a character string. This optional item is applicable only when DECEDI_ITM_FILE_TYPE specifies structured application files (DECEDI_FILE_TYPE_APPLICATION_FILE). |
| DECEDI_ITM_NO_LOCAL_TEST | Specifies that the mapper is not to use local test mode. This optional item is applicable only when DECEDI_ITM_FILE_TYPE specifies structured application files (DECEDI_FILE_TYPE_APPLICATION_FILE). |
| DECEDI_ITM_NAMED_APPLICATION | Indicates that the application name specified as an argument is to be passed to the mapper. By default, the mapper obtains application names from within the map. This optional item is applicable only when DECEDI_ITM_FILE_TYPE specifies structured application files (DECEDI_FILE_TYPE_APPLICATION_FILE). |
| DECEDI_ITM_OBJECT_NAME | Identifies the type of object. It is used by the mapper to distinguish different objects sent from the same application. The value associated with this identifier is a character string. This item is not applicable for transmission files (DECEDI_ITM_FILE_TYPE_TRANSMISSION_FILE) and is mandatory when the file type is internal format (DECEDI_FILE_TYPE_DOCUMENT). |
| DECEDI_ITM_OUTPUT_FILE | Specification of the output file to use on the Client. The value associated with this is a character string. This optional item is applicable only when DECEDI_ITM_FILE_TYPE specifies structured application files (DECEDI_FILE_TYPE_APPLICATION_FILE). |
| DECEDI_ITM_PARTNER_NAME | Identifies the partner which will receive the file. The value associated with this identifier is a character string. This item is not applicable for transmission files(DECEDI_ITM_FILE_TYPE_TRANSMISSION_FILE) and is mandatory when the file type is internal format (DECEDI_FILE_TYPE_DOCUMENT). |
| DECEDI_ITM_RESTART_FROM | Document number from which mapping is to be restarted. The value associated with this is an unsigned integer. This optional item is applicable only when DECEDI_ITM_FILE_TYPE specifies structured application files (DECEDI_FILE_TYPE_APPLICATION_FILE). |
| DECEDI_ITM_RETURN_STATUS | Specifies where to put the result of the request for this particular file. The value associated with this will be an unsigned integer. The possible values returned in this field are given in Table 6. The flag attribute DECEDI_WRITEABLE must be specified when adding this value to the item list. |
| DECEDI_ITM_TABLE_NAME | Name of mapping table to use if using the mapper. The value associated with this is a character string. This item is applicable only when DECEDI_ITM_FILE_TYPE specifies structured application files (DECEDI_FILE_TYPE_APPLICATION_FILE) and is mandatory. |
| DECEDI_ITM_TRACKING_REF | User-defined tracking reference to be associated with this file. The Server will use these values when auditing information about objects, and to respond to requests made by the DECEDI_TRACK call. The value associated with this is a character string. This item is mandatory when DECEDI_ITM_FILE_TYPE specifies internal format documents (DECEDI_FILE_TYPE_DOCUMENT). |
Table 5: Values for File Type
| Value | Description |
| ----- | ----------- |
| DECEDI_FILE_TYPE_DOCUMENT | Document files will bypass the mapper and go to the Translation Service. These files are also known as In-house files (DECEDI_FILE_TYPE_IHF). |
| DECEDI_FILE_TYPE_APPLICATION_FILE | Application_file documents go through the mapper, and their resultant documents are passed to the relevant Translation Service. These files are also known as Structured files (DECEDI_FILE_TYPE_STRUCTURED). |
| DECEDI_FILE_TYPE_TRANSMISSION_FILE | Unstructured documents bypass the mapper and Translation Service and go directly to the Communications Service. These files are also known as Unstructured files (DECEDI_FILE_TYPE_UNSTRUCTURED). |
Table 6: Return Values for DECEDI_POST
| Value | Description |
| ----- | ----------- |
| DECEDI_RETURN_OPEN_FAILED | One of the files specified in the request could not be opened. |
| DECEDI_RETURN_MAP_FAILED | File was not posted because the mapping failed. |
| DECEDI_RETURN_MAP_OUTPUT | The file requests map ran successfully but produced no output for this file. Other files in the request will be processed. |
| DECEDI_RETURN_MAP_PARTIAL | A file request was only partially mapped. Details of what the mapper found can be obtained from the mapper output files if specified. Other files in the request will be processed. |
| DECEDI_RETURN_SUCCESS | File was successfully posted. |
Description
This routine issues a request to the Server to post one or more files into the Server. It then waits for the Server to fulfill the request and return the results to the caller.
The request will have previously been constructed using one or more calls to DECEDI_ADD_ITEM_LIST. Once this call has been completed the associated item lists can be released using DECEDI_FREE_ITEM_LIST.
Return Values
DECEDI_BADITMLST
The request was rejected because the call had invalid, or missing item lists.
DECEDI_BADPARAM
The request was rejected because the call had invalid, or missing parameters.
DECEDI_INSUFVMInsufficient virtual memory available to complete request.
DECEDI_INTERROR
Internal error
DECEDI_NOCLIENTLIC
No active client license present
DECEDI_NOEDISYSEDI server system not running
DECEDI_NOTAUTHNot authorized to access the EDI server system
DECEDI_OPENINPERR
Could not open one of the input files
DECEDI_OPENOUTERR
Could not open one of the output files
DECEDI_ORBBADNODE
Bad server selection node
DECEDI_ORBBUSYObjectBroker busy.
DECEDI_ORBCOMMFAIL
Communications to server failed.
DECEDI_ORBDOWN
ObjectBroker not running
DECEDI_ORBERROR
ObjectBroker failure
DECEDI_ORBSAKERR
ObjectBroker "SAK" error.
DECEDI_ORBSRVDIED
Server process died
DECEDI_ORBSRVNOTFND
No server found
DECEDI_ORBTIMEOUT
Server timeout
DECEDI_ORBVERMISM
ObjectBroker version mismatch
DECEDI_SRVERROR
Server error
DECEDI_SUCCESSThe request was successfully processed by the server.
DECEDI_WARNINGNot all the request was successfully processed. Check the individual file statuses.
DECEDI_ZEROMATCH
No records matched
Example
#include <decedi_api_def.h>
unsigned long int status;
decedi_t_item_list item_list = (decedi_t_item_list) NULL;
decedi_t_ulong file_status;
unsigned long int test_indicator;
unsigned long int relationship;
status = DECEDI_ADD_ITEM_LIST (&item_list,
(unsigned long int) DECEDI_ITM_FILE_NAME,
(unsigned long int) DECEDI_STRING,
(unsigned long int) strlen("/usr/users/happyjack/test_file.dat"),
(char ∗) "/usr/users/happyjack/test_file.dat",
(unsigned long int) DECEDI_READ_ONLY);
if (status != DECEDI_SUCCESS)
{
}
status = DECEDI_ADD_ITEM_LIST (&item_list,
(unsigned long int) DECEDI_ITM_PARTNER_NAME,
(unsigned long int) DECEDI_STRING,
(unsigned long int) strlen("THEIR-APPLICATION"),
(char ∗) "THEIR-APPLICATION",
(unsigned long int DECEDI_READ_ONLY);
if (status != DECEDI_SUCCESS)
{
}
status = DECEDI_ADD_ITEM_LIST (&item_list,
(unsigned long int) DECEDI_ITM_TRACKING_REF,
(unsigned long int) DECEDI_STRING,
(unsigned long int) strlen("INVOICE #1234"),
(char ∗) "INVOICE #1234",
(unsigned long int DECEDI_READ_ONLY);
if (status != DECEDI_SUCCESS)
{
}
status = DECEDI_ADD_ITEM_LIST (&item_list,
(unsigned long int) DECEDI_ITM_TABLE_NAME,
(unsigned long int) DECEDI_STRING,
(unsigned long int) strlen("my_map"),
(char ∗) "my_map",
(unsigned long int DECEDI_READ_ONLY);
if (status != DECEDI_SUCCESS)
{
}
status = DECEDI_ADD_ITEM_LIST (&item_list,
(unsigned long int) DECEDI_ITM_RETURN_STATUS,
(unsigned long int) DECEDI_UINTEGER,
(unsigned long int) sizeof(file_status),
(char ∗) &file_status,
(unsigned long int DECEDI_WRITEABLE);
if (status != DECEDI_SUCCESS)
{
}
status = DECEDI_POST ( "MY-APPLICATION", /∗ Application name ∗/
(decedi_t_item_list) NULL, /∗ Overrides ∗/
item_list); /∗ Files to be posted ∗/
status = DECEDI_FREE_ITEM_LIST(&item_list);