|
This is a section of code from the Example FM "PONG" directive. The
Example FM PONG directive calls the Sample Access Module (via the
DECmcc Call Interface) requesting the Identifier Attributes.
If something goes wrong :
o a Specialized Exception from the Sample AM, or
o a Common Exception which the Example FM does not process
the Common Exception "Cannot Complete Operation" is generated.
The Argument to the Exception used is:
ARG_SVC_MSG_ERR (which is of type MCC Message)
-------------
The code that follows sets up the data structure (MCC_R_Mesg_List) used
by the "mcc_ilv_put_mccmsg" routine to encode the MCC Message data.
The code would be basically identical if an MCC Reply was built,
except:
o MCC_R_Reply_List structure would replace MCC_R_Mesg_List
o "mcc_ilv_put_mccreply" would replace "mcc_ilv_put_mccmsg".
Please Note - the SRM documents the "mcc_ilv_put_mccmessage" routine.
This is incorrect. The routine name is "mcc_ilv_put_mccmsg". At some
point (v1.2 ?) this will be corrected. Perhaps the SRM project leader
could shed some light on this topic.
/*
* Code section from the V1.2 Example Function Module
*
* File: MCC_EXAMPLE__PONG.C
* Routine: pong_sample_exception
*/
MCC_T_CVR pong_sample_exception( p_context, sample_status )
dt__LocalContext **p_context;
MCC_T_CVR sample_status;
{
MCC_T_CVR status = { MCC_S_NORMAL };
struct MCC_R_ILV_CONTEXT ctx;
MCC_R_Mesg_List mcc_message;
MCC_T_Unsigned32 ilv_datatype = { MCC_K_DT_ILV };
MCC_T_Unsigned16 buffer_length;
:
:
:
/*
* ------------------------ Build an MCC Message -----------------------
*
* The 'reply_index' has not been set -- this means one of two things;
* the Sample AM returned ...
* o a specialized exception, or
* o a common exception which we don't process
*
* Build our own 'Cannot Complete Operation' containing an MCC Message;
* the Reply returned from the Sample AM
*/
if ((*p_context)->reply_index == 0) {
/*
* Fill in the 'MCC Message' Item List
*/
mcc_message.mesg_w_count = 4;
mcc_message.mesg_w_id = MCC_K_ARG_SVC_MSG_ERR;
mcc_message.mesg_A_CVR = &sample_status;
mcc_message.mesg_A_Directive = (unsigned long int *)
&(*p_context)->sample_call_arguments.p_verb;
mcc_message.mesg_a_out_Entity = (*p_context)->sample_call_arguments.p_out_entity;
mcc_message.mesg_a_out_P = (int *)
(*p_context)->sample_call_arguments.p_out_p;
/*
* Create the Reply Argument Descriptor to hold the MCC Message.
* The size should be about :
*
* Sample Out-P size
* + something for a CVR
* + something for a Directive
* + something for an Out Entity
*
* From Trial and Error, lets call the something 200 bytes
*/
buffer_length = (*p_context)->sample_call_arguments.p_out_p->mcc_w_curlen
+ 200;
status = mcc_desframe_create_descriptor(
&(*p_context)->alloc_mem_list,
&(*p_context)->ReplyArg_p2,
&buffer_length,
&ilv_datatype,
MCC_K_NULL_PTR,
MCC_K_NULL_PTR,
MCC_K_NULL_PTR );
/*
* Open the ILV construction and
* encode the MCC Message
*/
if (_GOOD(status))
status = mcc_ilv_put_param_begin(
&ctx,
(*p_context)->ReplyArg_p2 );
if (_GOOD(status)) {
status = mcc_ilv_put_mccmsg(
&ctx,
&mcc_message );
}
/*
* Close the ILV construction and
* set the reply index to 'Sample MCC Message'
*/
if (_GOOD(status))
status = mcc_ilv_put_param_end(
&ctx,
(*p_context)->ReplyArg_p2 );
if (_GOOD(status))
(*p_context)->reply_index = EXAMPLE__CANNOT_COMPLETE;
} /* end if the 'reply_index' is NULL */
return( status );
}
|
| Keith!
Please, help! How to specify the damn thing in the .MS files.
I have tried
ARGUMENT foo = 1 : MCCMessage
ARGUMENT foo = 1 : Mesg_List
ARGUMENT foo = 1 : MesgList
In all cases I've received %MCCMSL-E-INVDT, Undefined datatype message
Thank you very much for all your replies.
Gene
|
| Gene,
Here is a 'piece' of MS from the v1.2 Common Exception file;
Exception: Cannot Complete Operation
This file show the datatype as "MccMessage" -- I think there
was a problem with the v1.1 MSL translator. You should try
just "Message" and see if that works.
Keith
EXCEPTION Unable to Complete Operation = 2 :
SYMBOL = CANNOT_COMPLETE,
TEXT = "The requested operation cannot be completed",
ARGUMENT Problem Persistence = 1 : Persistence
DISPLAY = FALSE,
SYMBOL = ARG_PROB_PERSIST
END ARGUMENT Problem Persistence;
ARGUMENT MCC Routine Error = 2 : MCCError
DISPLAY = TRUE,
SYMBOL = ARG_MCC_ERR
END ARGUMENT MCC Routine Error;
ARGUMENT VMS Routine Error = 3 : VMSError
DISPLAY = TRUE,
SYMBOL = ARG_VMS_ERR
END ARGUMENT VMS Routine Error;
ARGUMENT MCC Debug Info = 4 : MCCReply
DISPLAY = TRUE,
SYMBOL = ARG_SVC_ERR
END ARGUMENT MCC Debug Info;
ARGUMENT Entity Existence Info = 5 : EntityExistence
DISPLAY = TRUE,
SYMBOL = ARG_ENT_EXIST
END ARGUMENT Entity Existence Info;
ARGUMENT MCC Unhandled Service Reply = 11 : MccMessage
DISPLAY = TRUE,
SYMBOL = ARG_SVC_MSG_ERR
END ARGUMENT MCC Unhandled Service Reply;
END EXCEPTION Unable to Complete Operation;
|