[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference azur::mcc

Title:DECmcc user notes file. Does not replace IPMT.
Notice:Use IPMT for problems. Newsletter location in note 6187
Moderator:TAEC::BEROUD
Created:Mon Aug 21 1989
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:6497
Total number of notes:27359

1581.0. "%MCC-E-NOENTITY - for incoming events." by KETJE::PACCO (To manage you have to be a (manag..) skilled person!) Wed Oct 02 1991 15:06

QUESTION 1.
    Can someone who played with event handling explain what is the cause of
	"%MCC-E-NOENTITY,  no corresponding entity instance exists" ?
What is wrong on the ILV encoding of the response to the GETEVENT directive ?

    
    At this time the whole ILV response was encoded by the event sink
    application. The event has 1 argument. The two constructions got the
    MCC_K_ILV_LIST_VALUE modifiers. The call sequence was:
	mcc_ilv_param_begin
	mcc_ilv_constr_begin
	mcc_ilv_constr_begin
	mcc_ilv_put
	mcc_ilv_constr_end
	mcc_ilv_constr_end
	mcc_ilv_param_end
The out_p argument of the mcc_call was passed immediately,
without any additional processing, as the event_data argument in the
mcc_event_get routine.  Full trace of this is available further on.
    
QUESTION 2.
    Which is the preferred way to pass events to the AM ?  I see two
    alternatives.  Either you prepare the whole argument in the event sink
    application, and the AM passing it (without any additional processing) to
    the caller (FM or PM).  Either you only pass the event_report as an
    argument to the mcc_event_put routine, where as the AM will have to
    encapsulate it with a mcc_ilv_put_param_begin/mcc_ilv_put_param_end
    construct.  This will give the AM more control over the consistency of
    the out_p argument. Can you tell which are the preferred ILV call
    sequences at both the event-sink and event-report sides, e.g. for an
    event report having 1 argument.
    Is it also possible to send only the event_report construct in a mcc_event_put,
which should then be encoded in a parameterlist in the AM ?


********************************************************************************
An extract of the service MSL.


             EVENT PARTITION CONFIGURATION = 15 :
                (* This partition reports the events which report
                the state transitions of the entity *)

                EVENT Special Attention = 200 :
                    DISPLAY = TRUE,
                    SYMBOL = SPEC_EVENT,
                    TEXT = "Attention required for this event !<SPEC_EVENT_ARG>
                    ARGUMENT Attention Code = 201 : Latin1String
                        DISPLAY = TRUE,
                        SYMBOL = SPEC_EVENT_ARG
                    END ARGUMENT Attention Code;
                END EVENT Special Attention;

             END EVENT PARTITION CONFIGURATION;

...

             DIRECTIVE GETEVENT = 65:
                DIRECTIVE-TYPE=EVENT,

                RESPONSE getevent_success = 10:
                   SYMBOL = geteventsuccess,
                   TEXT = "UAF event received",
                   ARGUMENT geteventrep = 11 : Event_Report
                       SYMBOL = attr_getevent_rep
                   END ARGUMENT geteventrep;
                END RESPONSE getevent_success;

             END DIRECTIVE getevent;
  

The FCL_PM and the the event logger trace shows the following :

MCC> getevent uaf PACCO special attention


*****************************************************
*     FCL PM Arguments before call_function:        *
*****************************************************

VERB code:      65
PARTITION code: 15
AES dump of ENTITY IN:

depth=1 class code= 33 instance = PACCO

ILV dump of IN_P:

[  0 ] (
    [  1 ] (
        [  1 ]         00 c8
        )
    )
ILV dump of IN_Q: in_q is NULL
TIME SPEC is: 0, NOW
Event_Get starting
Event_Get processing Partition argument
Event_Get Input Arguments ...
  in_entity =
        entity [0] wild = NOT_WILD class = 33 id = 100 type = 4
        instance = ..PACCO
        %X0105504143434F
  Partition = 15
  Filter = MCC_K_NULL_PTR
  time_spec = MCC_K_NULL_PTR
        Handle context not set up yet
Event_Get handle state = MCC_K_HANDLE_FIRST
Event_Get building a PRMB for this request
Event_Get creating a Heartbeat thread for this request
Event_Get setting the Heartbeat thread-id B000A
Event_Get creating TimeStamps
Event_Get requesting NEXT event
Going to wait for the event now...
Event_Get was Signalled
Copying Event Data to user supplied buffers
Event_Get converting time to supplied time type
Event_Get deleting global event data
Event_Get performing general clean up
THUMP!
Failed to dequeue event:
%MCC-E-NOMOREVT, no more events in event queue
Event_Get Output Arguments ...
        Handle context not set up yet
  out_entity =
        entity [0] wild = NOT_WILD class = 33 id = 100 type = 4
        instance = ..pacco
        %X0105706163636F
  timestamp =   1-OCT-1991 20:55:39.28
  Event Code = 200
  Event Data =

Dump of MCC Descriptor reveals:
    mcc_w_maxstrlen = 1024
    mcc_b_dtype     = DSC_K_DTYPE_T
    mcc_w_curlen    = 59
    mcc_b_flags     = 0
    mcc_b_ver       = 1
    mcc_l_id        = 10
    mcc_l_dt        = MCC_K_DT_ILV
    mcc_a_pointer   = �..7�..3�.H..-........#�.I........Associated event data..
.
    %XAA820037AB820033BF814882002D810100830100A4820023BF814982001D81010382154173
736F636961746564206576656E742064617461830100
    mcc_a_link      = MCC_K_NULL_PTR
Event_Get completed
        entity [0] wild = NOT_WILD class = 33 id = 100 type = 4
        instance = ..pacco
        %X0105706163636F

[  10 ] (
    [  11 ] (
        [  200 ] (
            [  1 ]             00
            [  3 ]             00
            [  4 ] (
                [  201 ] (
                    [  1 ]                     03
                    [  2 ]                     41 73 73 6f 63 69 61 74 65 64 20
65 76 65 6e 74 20 64 61 74
                    61  -- Associated event data
                    [  3 ]                     00
                    )
                )
            )
        )
    )
**********************************************
FCL PM Arguments on return from call_function:

CVR returned:
%MCC-S-RESPONSE, success with response reply

ILV dump of OUT_P:

[  10 ] (
    [  11 ] (
        [  200 ] (
            [  1 ]             00
            [  3 ]             00
            [  4 ] (
                [  201 ] (
                    [  1 ]                     03
                    [  2 ]                     41 73 73 6f 63 69 61 74 65 64 20
65 76 65 6e 74 20 64 61 74
                    61  -- Associated event data
                    [  3 ]                     00
                    )
                )
            )
        )
    )
AES dump of ENTITY OUT:

depth=1 class code= 33 instance = pacco


uaf pacco
AT  1-OCT-1991 20:55:39 CONFIGURATION

UAF event received

%MCC-E-NOENTITY,  no corresponding entity instance exists
MCC>
    
T.RTitleUserPersonal
Name
DateLines
1581.1Some hintsTENERE::LAVILLATThu Oct 03 1991 05:0694
The "NOENTITY" message is a generic (!) way to say that your out_p is
badly ILV encoded.

>    At this time the whole ILV response was encoded by the event sink
>    application. The event has 1 argument. The two constructions got the
>    MCC_K_ILV_LIST_VALUE modifiers. The call sequence was:

No. You should encode an event report in NATIVE mode.

>[  10 ] (
>    [  11 ] (
>        [  200 ] (
>            [  1 ]             00
>            [  3 ]             00
>            [  4 ] (
>                [  201 ] (
>                    [  1 ]                     03
>                    [  2 ]                     41 73 73 6f 63 69 61 74 65 64 20
>65 76 65 6e 74 20 64 61 74
>                    61  -- Associated event data
>                    [  3 ]                     00
>                    )
>                )
>            )
>        )
>    )

This is not correct. You should have (by simply changing the ILV mode to NATIVE)

[  10 ] (
    [  11 ] (
        [  200 ] (
                [  201 ]                     41 73 73 6f 63 69 61 74 65 64 20
65 76 65 6e 74 20 64 61 74
                    61  -- Associated event data
                )
            )
        )
    )

Another comment :

>           DIRECTIVE GETEVENT = 65:
>               DIRECTIVE-TYPE=EVENT,
>
>               RESPONSE getevent_success = 10:
>                  SYMBOL = geteventsuccess,
>                  TEXT = "UAF event received",
>                  ARGUMENT geteventrep = 11 : Event_Report
>                      SYMBOL = attr_getevent_rep
>                  END ARGUMENT geteventrep;
>               END RESPONSE getevent_success;
>
>            END DIRECTIVE getevent;

Your GETEVENT definition, even if it is correct, is not "standard" : a
standard GETEVENT will use 1 as id_code for both the response and event_report
id_codes. I do not know if it is a problem, but I think the NOTIF FM for
example is expecting this id_codes to be 1 (but maybe it does not check them,
simply doing ilv_get_id calls and discarding the actual value) when reading the
response.


>QUESTION 2.
>    Which is the preferred way to pass events to the AM ?  I see two
>    alternatives.  Either you prepare the whole argument in the event sink
>    application, and the AM passing it (without any additional processing) to
>    the caller (FM or PM).  Either you only pass the event_report as an
>    argument to the mcc_event_put routine, where as the AM will have to
>    encapsulate it with a mcc_ilv_put_param_begin/mcc_ilv_put_param_end
>    construct.  This will give the AM more control over the consistency of
>    the out_p argument. Can you tell which are the preferred ILV call
>    sequences at both the event-sink and event-report sides, e.g. for an
>    event report having 1 argument.
>    Is it also possible to send only the event_report construct in a mcc_event_put,
>which should then be encoded in a parameterlist in the AM ?
>

I have no definitive answer on that (I'll let the *real* MCC gurus answer),
but my opinion is that first you can only pass a simple (native) argument
through the event_put and so the only way to pass more than one argument
to the event_put is to ILV encode it. So, if you want to have your sink
consistent (if you have different events, some having more than one argument)
the better way to do it is directly put in the event_put call the out_p
of the GETEVENT directive. That's what we do, and that what everybody I know
does.

Hope this helps.

Regards.

Pierre.


1581.2RESPONSE and EVENT_REPORT need ID-codes=1STKHLM::BERGGRENNils Berggren EIS/Project dpmt, Sweden DTN 876-8287Thu Oct 03 1991 06:5418
    repl .1
    
>>> Your GETEVENT definition, even if it is correct, is not "standard" : a
>>> standard GETEVENT will use 1 as id_code for both the response and event_report
>>> id_codes. I do not know if it is a problem, but I think the NOTIF FM for
>>> example is expecting this id_codes to be 1 (but maybe it does not check them,
>>> simply doing ilv_get_id calls and discarding the actual value) when reading the
>>> response.
    
    This is certenly the problem.  I had the same problem before.
    The respponse and the argument, if it is an event-report, has to have
    the id-codes = 1.
    
    Look at note # 1529.2 where Jill Callander have posted the MS-def for 
    the GETEVENT-directive.  There you'll find what codes are wanted.
    
    Good luck,
    Nils
1581.3%MCC-E-ILV_BAD_MODE creating event report.KETJE::PACCOTo manage you have to be a (manag..) skilled person!Thu Oct 03 1991 17:3079
Another error, before reaching success...

Still the same MSL.
This time when I try to encode the ILV response, using two times a construction
with MCC_K_ILV_NATIVE_VALUE mode, I cannot do a mcc_event_put any more.
I receive the error :
	%MCC-E-ILV_BAD_MODE, ILV mode inconsistent with Arguments
Surprisingly the example on note 1360.*, where the same sequence is used,
seems to work.

	mcc_ilv_param_begin
	mcc_ilv_constr_begin	MCC_K_ILV_NATIVE_VALUE
	mcc_ilv_constr_begin	MCC_K_ILV_NATIVE_VALUE
	mcc_ilv_put
		%MCC-E-ILV_BAD_MODE, ILV mode inconsistent with Arguments
	mcc_ilv_constr_end
	mcc_ilv_constr_end
	mcc_ilv_param_end

The ILV_PUT use the following parameter:

        arg_length = strlen (event_data);

        arg_desc.mcc_w_maxstrlen = arg_length ;
        arg_desc.mcc_a_pointer = &event_data;
        arg_desc.mcc_w_curlen = arg_length;
        arg_desc.mcc_b_flags=0;
        arg_desc.mcc_b_ver = 1;
        arg_desc.mcc_b_dtype = DSC_K_DTYPE_T;
        arg_desc.mcc_b_class = DSC_K_CLASS_S;
        arg_desc.mcc_l_id = MCC_K_SPEC_EVENT_ARG;
        arg_desc.mcc_l_dt = MCC_K_DT_LATIN1STRING;
        arg_desc.mcc_a_link = MCC_K_NULL_PTR;

        stat = mcc_ilv_put ( &ILVctx,
                             &arg_desc,
                             &reason_code);
  
And, because of the error the ILV dump becomes:
ILV dump of OUT_P:

[  10 ] (
    [  11 ] (
        [  200 ] (
            )
        )
    )
instead of the one expected with argument 201.
Any idea about this ?
********************************************************************************
More comments on QUESTION 2.

If the event report can be seen as a construction (cfr SRM pg 279), where
the construction ID is the event code, and the data are the parameters in the
construction.  If there are no parameters to the event report, the event report
can be passed as an empty construction.  If there are parameters, there will be
as many mcc_ilv_puts as there are parameters.

I do not see any difficulty to pass a "naked" event-report with or without
arguments.

That whole event_report could then easily be put in a parameter list
	mcc_ilv_param_begin
	mcc_ilv_constr_begin
		mcc_ilv_copy_param from "naked" event_report
	mcc_ilv_constr_end
	mcc_ilv_param_end

The problem is, I encounter, that you cannot build a construction on its own,
e.g. for an complete event report, without being preceeded by a
mcc_ilv_param_begin.  THAT IS THE MAIN PROBLEM.
Therefore to extract that event-report construction, it will take several ILV
calls to position the ILV context on the right argument.

Ultimately, because of this, it seems easier to build the full argument
list already in the event sink application.
    
    Dominique.
    
1581.4do not supply reason_code if in NATIVE modeTENERE::LAVILLATFri Oct 04 1991 04:3522
>
>        stat = mcc_ilv_put ( &ILVctx,
>                             &arg_desc,
>                             &reason_code);
>  

Look at the SRM definition of mcc_ilv_put :

"If the current mode is NATIVE_VALUE, then the reason_code argument is not
applicable and MUST reference MCC_K_NULL_PTR"

So call instead :

        stat = mcc_ilv_put ( &ILVctx,
                             &arg_desc,
                             MCC_K_NULL_PTR);

which should fix the problem.

Regards.

Pierre.