[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

1480.0. "creating entities in SAMPLE_AM" by ESCROW::LANG () Tue Sep 10 1991 19:27


	I'm using the design framework, and want to create some entities.
	The framework creates entity x.  Where is the code which creates
	that entity?  I'd like to mimic that code, so I could create a 
	create routine.

	Thanks,

			Bonnie
T.RTitleUserPersonal
Name
DateLines
1480.1NANOVX::ROBERTSKeith Roberts - DECmcc Toolkit TeamTue Sep 10 1991 20:0923
>> I'm using the design framework, and want to create some entities.
>> The framework creates entity x.  Where is the code which creates
>> that entity?  I'd like to mimic that code, so I could create a 
>> create routine.

I'm not sure what you mean when you say "create some entities"

If you want to use the Toolkit Design Framework to develop a Management
Module, you should first read over the Managment Module Programming guide.

You will then run the MCC_YOURMM_AUTO_CREATE tool which will transform
the YOURMM Access Module into a custom AM with your entity names and codes.

From here, you can begin editing the Management Specification (MS) files
to add new entities, directives, and attributes.  Which each change to
the MS file, there will some corresponding changes to the source code - From
modifying tables, to creating new modules (files).

All the source code for the YOURMM and SAMPLE AM modules are shipped with
the DECmcc toolkit.  On VMS, they are in the SYS$COMMON:[SYSHLP.EXAMPLES.MCC]
directory.

/keith
1480.2More information on questionESCROW::LANGWed Sep 11 1991 11:1929
	Keith,

	I read over the manual and ran the MCC_YOURMM_AUTO_CREATE tool.
	This prompts for:
		AM name
		global entity code
		child entity code
	
	as described in chapter 11 of the Managment Module Programming guide.
	
	It creates an entity class which is the name of the AM, for the
	global entity class.  The entity instance is X.  This is documented
	in section 11.2.1 Design Framework Starter AM Functionality.

	I would now like to create other entity instances, using the
	same method that X was created. (I understand when writing a
	real AM, this would be replaced with other code, like to a
	database.)

	I also want to add children to the hierarchy, and I understand
	the process involved, but I'm not sure how to create children
	instances.  I assume I could use the same process as for the
	entity X, in the sample.

	Thanks for your help.

			Bonnie
	
1480.3Some more questionsNANOVX::ROBERTSKeith Roberts - DECmcc Toolkit TeamWed Sep 11 1991 16:26119
RE: .2

>> I would now like to create other entity instances, using the same
>> method that X was created

Looking at section "Design Framework Starter MM Functionality" in the MMP
guide, it shows:

	SHOW YOURMM <x> ALL CHARACTERISTICS

The <x> is a placeholder for the command .. it represents the Instance
of the YOURMM entity.  For example, using the Sample Access Module

	SHOW SAMPLE <x> ALL CHARACTERISTICS

<x> is replaced with a DECnet phase 4 name -- like ESCROW

	SHOW SAMPLE ESCROW ALL CHARACTERISTICS

For YOURMM, the <x> is actually an Identifier Attribute named "Username".
For demo purposes, it is a dummy value and not used by the YOURMM module.

Here is a section from the YOURMM Service MS file:

  ----------------------------------------------------------------------------

      GLOBAL ENTITY YOURMM = 88 :
         IDENTIFIER = ( Username ),
         SYMBOL = CLASS_YOURMM,

  (*
   *  Define the Identifier Attribute Partition
   *    - Username
   *)

         IDENTIFIER ATTRIBUTES

               ATTRIBUTE Username = 1 : SimpleName
                  DNS_IDENT  = PRIMARY_NAME,
                  ACCESS     = NONSETABLE,
                  DISPLAY    = TRUE,
                  SYMBOL     = ATTR_USERNAME,
                  CATEGORIES = ( CONFIGURATION )
               END ATTRIBUTE Username;

         END ATTRIBUTES; (* IDENTIFIER *)

----------------------------------------------------------------------------

??? Is this helping ???


>> I also want to add children to the hierarchy, and I understand
>> the process involved, but I'm not sure how to create children
>> instances.

You will need to define, in your Service MS file, a Child Entity.  The format
is:

  Global Entity <global-name> = <global-class-code>
    Attribute Definitions
    Directive Definitions
      Response & Exception Definitions

    Child Entity <child-name> = <child-class-code>
      Attribute Definitions
      Directive Definitions
        Response & Exception Definitions
    End Entity <child-name>

  End Entity <global-name>

I suggest that you print out the Sample MS file MCC_SAMPLE_AM_SRVC_IF.MS


--------

Once you have added your Child Entities, you will need to make modifications
to the VECTOR.MAR file -- this file lists the Verb, Entity, Partition
codes and the corresponding entry-point (routine name) within your Management
Module that knows how to perform the command:

   Verb:       Show
   Entity:     SAMPLE <*>
   Partition:  CHARACTERISTICS
   Routine:    mcc_sample__show     (found in MCC_SAMPLE__SHOW.C)

Above, the <*> indicates that the command requres an Instance Name.
Print out the Sample Vector file (MCC_SAMPLE_VECTOR.MAR) for more details.
It also will show how to form the dispatch entries when you have child entities.

---------

Now that the the MS & Vector files are updated - you'll need to make
modifications to your source code.  The convention we used for naming
the Sample Access Module is:

	MCC_<global-entity>__<verb>_<child-entity>.C (and .H)

Show Sample <x> all Characteristics
Show Sample <x> all Status
Show Sample <x> all Identifiers
Show Sample <x> all Counters

directves are processed in the file:  MCC_SAMPLE__SHOW.C

Show Sample <x> Line <y> All Characteristics
Show Sample <x> Line <y> All Status
Show Sample <x> Line <y> All Identifiers
Show Sample <x> Line <y> All Counters

directives are process in the file:  MCC_SAMPLE__SHOW_LINE.C

---------

??? Am I helping at all

/keith

1480.4more on 3ESCROW::LANGThu Sep 12 1991 19:1725
	Re: 3

>For YOURMM, the <x> is actually an Identifier Attribute named "Username".
>For demo purposes, it is a dummy value and not used by the YOURMM module.


	Well, this is sort of what I was looking for.  I've created the
	sample, and enrolled, when I type:

		SHOW SAMPLE x ALL CHARACTERISTICS

	I get demochar1 and demochar2, but when I type anything else besides
	the "x", I get an error.  So, I assumed that the X must either be
	hard coded in the program (which I didn't see)  or it must be stored
	in a file.

	So, I understand the msl changes, and the code changes.  I wanted to
	try out creating a child, so It seemed I would have enter in some
	way to see the data - like there is a table for demochar1 and
	demochar2.  BUt... I couldn't find where you put in the data for
	the x id.

	thanks,  Bonnie

1480.5NANOVX::ROBERTSKeith Roberts - DECmcc Toolkit TeamFri Sep 13 1991 11:1175
>> Well, this is sort of what I was looking for.  I've created the
>> sample, and enrolled, when I type:
>>
>>	SHOW SAMPLE x ALL CHARACTERISTICS

   So you ran the AUTO-CREATE tool and produced your own Management Module
   named Sample - Right?  (Sample was probably a poor choice because there
   is already an entity by that name; the Sample AM provided on the toolkit.
   But if you are using a private dictionary, there would be no conflicts).

>> I get demochar1 and demochar2, but when I type anything else besides
>> the "x", I get an error.  So, I assumed that the X must either be
>> hard coded in the program (which I didn't see)  or it must be stored
>> in a file.

   That's really wierd - because the YOURMM code doesn't care what you
   enter for the Instance name ...

   ------------------------------------------------------------------------

   MCC> SHOW YOURMM X ALL CHAR

   YOURMM X
   AT 13-SEP-1991 07:54:17 Characteristics

   Examination of attributes shows:
                              DEMOchar1 = 50
                              DEMOchar2 = 100
   MCC> SHOW YOURMM FRANK ALL CHAR

   YOURMM FRANK
   AT 13-SEP-1991 07:54:20 Characteristics

   Examination of attributes shows:
                              DEMOchar1 = 50
                              DEMOchar2 = 100
   MCC> show yourmm mary all char

   YOURMM mary
   AT 13-SEP-1991 07:54:28 Characteristics

   Examination of attributes shows:
                              DEMOchar1 = 50
                              DEMOchar2 = 100

   ------------------------------------------------------------------------

   The only thing I can think of is you were running the *real* Sample AM.
   And there *is* a node named "X" on the easynet!

   MCC> show sample x all id

   Sample x
   AT 13-SEP-1991 07:59:11 Identifiers

   Examination of attributes shows:
                                Address = 6.989
                                   Name = X

   ------------------------------------------------------------------------

>> So, I understand the msl changes, and the code changes.  I wanted to
>> try out creating a child, so It seemed I would have enter in some
>> way to see the data - like there is a table for demochar1 and
>> demochar2.  But... I couldn't find where you put in the data for
>> the x id.

   In the file, MCC_YOURMM_TRANS_YOURMM.C, the translation table
   contains the USERNAME Attribute.  Although this is in the table
   to complete the list of attributes, it is not referenced as there is
   no 'Show YOURMM foobar All Identifiers' entry point  8(



/keith
1480.6x is a dummyESCROW::LANGFri Sep 13 1991 18:2112
  Re: 4 & 5

	Well, I tried substituting other variablse for x again, and
	I'm embarrassed to say, that it does take any value.

	I thought I remembered clearly that the response was no such entity.
	Sorry about the confusion.  Now I'm going to add those children.

		thanks,

			bonnie
	
1480.7I'm glad its working as advertised -- Good luck with the kids 8) NANOVX::ROBERTSKeith Roberts - DECmcc Toolkit TeamTue Sep 17 1991 10:540