[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

1334.0. "How to implement a 'List of Records'" by HLRG02::GOES () Tue Aug 13 1991 10:04

Hi, I have a question about how to implement a 'list of records' type.


I'm developing an access module to manage the alarms coming from a PABX.

I want to implement a directive called Show_Current_Alarms.
This directive must show a list of the current alarms and must show
a number of data connected to each alarm.

The number of alarms can vary from 0 to 255 and each alarm has the 
following data connected:
		Error Code
		Error Description
		Time Of Error
		Alarm Position
		Information

I understand that I can fit Error Code ... Information in a Record
of Fixed Fields (Constructed Type). But how can I implement a 'list of
these records' whith the list having a variing lenght ?

Is it possible to implement the following ?:
As a response to the Show_Current_Alarms the Record (Error Code ... 
Information) of the first alarm  will be displayed. By clicking 
on <NEXT> and <PREVIOUS> you can 'walk through' the current alarms.
(Something like the Display Alarms directive from the Operations
 Menu.)

Maybe someone can help me with these ?
If you have another solution it is welcome to !

Regards Paul Goes


T.RTitleUserPersonal
Name
DateLines
1334.1Knowing practically ziltch about your application...TOOK::GUERTINDon't fight fire with flamesThu Aug 15 1991 12:1012
    At first glance, you want a Sequence_of - Records datatype.
    
    However, I couldn't help but think, based upon your description,
    that your Modelling is not quite right.  It sounds like you
    have Child Entities called Alarms, of which there can be from
    0 to 255.  Each Child Entity Alarm, has a code (called an Error
    Code), which is the primary identifier.  It has other attributes
    such as Error Description, Time of Error, etc.  I'm probably all
    wet, but that's what I interpreted from your description.
    
    -Matt.
    
1334.2OK Maybe thats the solution, but . . .HLRG02::GOESThu Aug 15 1991 13:5328
Thanks for your reply.

Maybe that's the solution but ...

If I see an alarm as a child entity with the error code as its primary
identifier another problem arises:

The list of alarms (as mentioned in .0) can contain 0 to 255 alarms and these
alarms are contained in a buffer in my entity. The list can contain e.g 3 alarms
or 12 alarms depending on the number of reported alarms that are placed in the 
buffer. 

Say for example that, at a certain time, there are 3 alarms with error codes 
15, 75 and 132. At that time a will have 3 child entity instances with this
three identifiers. How does DECmcc know what child entity instances I have ?
If 2 alarms occur, the number of alarms will increase to 5 alarms, this means
that the number of child instances will also increase to 5 instances.
So instances are created depending on the alarms that occur (at a random moment)
in my entity.
How can DECmcc, at anytime, know how many instances it has ? Normally you have
to register the instances to accomplish this, but that's not possible now, I
think ?

Is it possible to have a proces (or thread) in my AM that continuosly 'monitors' 
the alarm buffer and that registers instances if alarms are appended to the
buffer ?

Regards Paul
1334.3Do you HAVE to register them?TOOK::GUERTINDon't fight fire with flamesThu Aug 15 1991 14:5911
    You don't need to register "dynamic" child entities.  Think of DECnet
    X25 Circuits.  They may come and go unpredictably.  They are still
    child entities, but they may not get registered.  You find out what you
    have by asking.  When the user asks, that's when you check to see what
    you have.  If you NEED them in DNS (for network-wide access), then
    that's a problem.  It was just food for thought.  If you can make them
    into child entities, things sometimes work out better, since you have
    more commands, and other functions (like MCC Alarms, Historian, etc.)
    that come for free (well, almost).
    
    -Matt.
1334.4OK, but when (and how ?) to check ?HLRG02::GOESFri Aug 16 1991 11:0240
reply .3 :
>>When the user asks, that's when you check to see what you have.  
>>If you NEED them in DNS (for network-wide access), then that's a problem.

I don't NEED them to be in DNS.

I checked out some other AM's to see something similar to what I want.
And I found it:
When you have a NODE4 in iconic_map PM, you can double-click its icon and
you will see the child entities displayed. Something like this:
		Line SVA-0
		Remote Node ...
		Link ...
		Object ...
		etc...
If you double-click 'Link ...', you will see the links of the node. They 
can come and go at anytime (like the alarms of the PABX). You see something
like this:
		Link ...
		   Link 130
		   Link 129
		   Link 136
		   etc...
(I can image Link replaced with Alarm and the numbers indicating error-codes)

reply .3
>>When the USER ASKS, that's when you check to see what you have.

When the user asks =?= when the user double-clicks on Link ... ???
That's when you check =?= My AM is the only connection between my entity
			  and DECmcc. So, my AM has to do the check ???
			  How is this check invoked ??? The only way of
			  invoking action in an AM is by issuing a directive
			  via the MCC_CALL interface (I thought ?). 

OK, something similar to the Link childs of NODE4 will do very, very well
for my AM. But can someone tell me (roughly) how to implement this 
'dynamic children' ???

Regards Paul Goes
1334.5addition to reply .4HLDG02::GOESMon Aug 19 1991 08:4719
    After issuing reply .4 I searched in this notesfile for dynamic
    children. I found some information in notes 181 and 338.
    
    When I double-click on:
    	LINK ...
    The following occurs:
    	LINK ...
    		LINK 15
    		LINK 3365
    		LINK 43
    The links are dynamic children. 
    I wondered how the Iconic Map PM gathered this information.
    Does it place a SHOW NODE4 utes09 LINK * ALL IDENTIFIERS to determine
    the child instances ???
    
    Does somebody know ???
    
    Regards Paul
      
1334.6yesTOOK::HAOMon Aug 19 1991 13:286
    Yes, for all dynamic child entities, the Iconic Map PM does a 
    mcc_call_function() to get all the instances at the time that the
    user double-clicks on the "child...".
    
    Christine
    
1334.7not a "list"TOOK::CALLANDERJill Callander DTN 226-5316Thu Aug 22 1991 16:427
plsase note though that for the show class * all ident command to work, each
of your "alarms" would now be a child, and have to be returned 1 response 
at a time. I just read this note quickly but it sounded like you wanted
each "alarm" to show up independently when you did a double click on the
class... if this is so, then you are modeling them as entity instances
and therefore they must be implemented as such.

1334.8Yes that's right !UTES09::GOESFri Aug 23 1991 08:5218
You're completely right. I'm implementing an child-entity class alarm
that can contain a varying number of alarms -> the instances.

The problem now is that, as mentioned in .7 that I have to return 1 response
at a time (as reponse to a chow class * all identifier directive).

I know how to return an attribute (or a number of attributes) for one instance
of a class. But how can I return the identifier attributes for more than one
instance (in one call)?

Do I need the handle indicating more and put one identifier at a call until
all instances are returned and then change the handle ???

Maybe I'm completely wrong ?

Can somebody give some insight in this ??

Regards Paul
1334.9Additional question reply .8UTES09::GOESPaul Goes - T&amp;N Digital UtrechtMon Aug 26 1991 10:3739
    This reply can be seen as an addition to the previous note (.8)
    
    Is this the way to handle the 
    SHOW <global class> <instance> <child class> * ALL IDENTIFIER ???
    
    Using the framework & related contexts:
    
    - PM calls my access module entry point for SHOW ALL IDENTIFIER
    
    - In my do_directive set (*p_context)->flags.more_data=TRUE
    
    - In my do_directive put first entity specification in out_entity
    
    - In my do_directive put identifier in out_p
    
    - return from my access module
    
    - PM calls my access module entry point for the second time
    
    - In my do_directive : set more, put second entity spec and put
      identifier and return
    
    - repeat for the rest of the existing dynamic child entity instances
    
    - .....
    
    - PM calls my access module entry point for the last time
    
    - In my do_directive : - set (*p_context)->flags.more_data = FALSE
    			   - put last entity spec in out_entity
    			   - put last identifier inb out_p
    
    Is this the right way to go ????
    
    Regards Paul
    	 
    
    
    
1334.10Looks good to meNANOVX::ROBERTSKeith Roberts - DECmcc Toolkit TeamMon Aug 26 1991 14:310