3D PLM Enterprise Architecture |
VPM Navigator |
Retrieving VPM IdentificationRetrieving information about existing object |
Use Case |
AbstractThis article shows the way to retrieve VPM Identification information about Part Version or Document Revision object using an Identification Acquisition Agent and explains how to use it in a command. |
This use case is intended to explain how to obtain VPM identification information about a selected object in either 'Query-Result' or 'Explorer' windows of the VPM Navigator. Use of such an Agent is demonstrated by means of an Agent test command from an Explorer window.
[Top]
The Agent test Command is a use case of the CAACATImmENOVIAProvider.edu framework that illustrates Identifier Acquisition Agent capabilities.
[Top]
CAAImmIdAcqAgentTestCmd is a state dialog command which returns the VPM Identification information using the Identifier Acquisition Agent and is described by the following UML statechart diagram.
The dialog is as follows:
Select a Part Version or Document Revision Object from VPMNavigator tree. |
The command returns with the VPM Identification information on the object selected. The command is then complete.
[Top]
To launch CAAImmIdAcqAgentTestCmd , you will need to set up the build time environment, then compile CAAImmIdAcqAgentTestCmd along with its prerequisites, set up the run time environment, and then execute the use case [1] in the following way:
[Top]
The Agent test command is made up of a single class named CAAImmIdAcqAgentTestCmd located in the CAAImmIdAcqAgentTestCmd.m module of the CAACATImmENOVIAProvider.edu framework :
Windows | InstallRootDirectory\CAACATImmENOVIAProvider.edu\CAAImmIdAcqAgentTestCmd.m\ |
Unix | InstallRootDirectory/CAACATImmENOVIAProvider.edu/CAAImmIdAcqAgentTestCmd.m/ |
where InstallRootDirectory
is the directory where the CAA CD-ROM
is installed.
[Top]
To retrieve VPM Identification information using the Acquisition Agent, following steps should be followed:
# | Step | Where |
---|---|---|
1 | Declare the Identification Acquisition agent | Header file |
2 | Instantiate the Acquisition agent | BuildGraph method |
3 | Assign the Acquisition agent to the Initial state | BuildGraph method |
4 | Create a transition from the Initial state triggered by the Acquisition agent valuation | BuildGraph method |
5 | Retrieve the VPM Identification | Transition action method ActionCommand |
6 | Release the Acquisition agent | Destructor |
[Top]
The agent test command derives from CATSTateCommand.
class CAAImmIdAcqAgentTestCmd: public CATStateCommand { ... private: CATImmIdentifierAcquisitionAgent* _ImmIdentifierAcquisition; ... |
A pointer to the Acquisition agent is declared as a private data member. This Acquisition agent is an instance of the CATPathElement class.
[Top]
The Acquisition agent is intantiated in the command BuildGraph
method.
void CAAImmIdAcqAgentTestCmd::BuildGraph() { ... _ImmIdentifierAcquisition = new CATImmIdentifierAcquisitionAgent(); ... |
[Top]
Still in the BuildGraph
method, the SelectImmersiveObject state is created,
and the Acquisition agent is added to this state. This makes it possible to value the Acquisition
agent when this state becomes the active one.
... pFirstState = GetInitialState("SelectImmersiveObject"); pFirstState->AddDialogAgent(_ImmIdentifierAcquisition); ... |
This Agent test command is a single stage command. The GetInitialState
method
retrieves a dialog state and adds it to the states managed by the dialog command.
The AddDialogAgent
method adds the Acquisition agent to the state.
This acquisition agent supports selection of a single object only.
[Top]
The transition between the initial state and the end of command is created in the BuildGraph
method.
This transition is triggered when the Acquisition agent is valued, that is when the end user clicks a Part Version
or a Document Revision.
... AddTransition(pFirstState, NULL, IsOutputSetCondition(_ImmIdentifierAcquisition), Action ((ActionMethod)&CAAImmIdAcqAgentTestCmd::ActionCommand, NULL, NULL, (void*)NULL)); ... |
The AddTransition
method creates a transition and adds it to the
transitions managed by the dialog command. Pointers to the transition's source and target states
are the first and second arguments respectively. In this case, the second parameter is nulled to
indicate that the end of command. The transition trigger is defined in the guard condition as the first
condition to be checked using the IsOutputSetCondition
method applied to the
Acquisition agent. This condition returns True when the Acquisition agent is valued. When the condition
method returns True the transition is fired. In this case, the ActionCommand(void *)
action method is executed.
[Top]
When the guard condition returns true,
the ActionCommand(void*)
method is executed. In this method, the Acquisition agent
object is used to retrieve Identification information as follows:
... CATBoolean CAAImmIdAcqAgentTestCmd::ActionCommand(void* data) { CATUnicodeString domainType = _ImmIdentifierAcquisition->GetType(); CATListOfCATUnicodeString oNM; CATListOfCATUnicodeString oVA; hr=_ImmIdentifierAcquisition->GetIdentifiers(oNM, oVA); if(SUCCEEDED(hr)){ CATUnicodeString id_value=oVA[1]; CATUnicodeString version_value=oVA[2]; CATUnicodeString att_name=oNM[1]; CATUnicodeString att_vname=oNM[2]; ... } ... |
First, using the GetType
function, the type of the acquired object is returned
in the form of 'Domain/Type'. For example, If a PartVersion object is acquired in the PRODUCT domain,
the returned string will be PRODUCT/ENOVIA_VPMPartVersion.
Secondly, using the GetIdentifiers
method, the identifiers of Enovia VPM object are
acquired. For example, If a PartVersion object is selected by the end user, the identifiers V_ID and V_version
for that object will be returned.
[Top]
It is recommended to deallocate the agent at the end of the command, or when its use is finished in the following way,
if(_ImmIdentifierAcquisition){ _ImmIdentifierAcquisition->RequestDelayedDestruction(); } _ImmIdentifierAcquisition=NULL; ... |
[Top]
This use case shows usage of the VPM Identifier Acquisition agent and the way to retrieve the VPM Identification information for a selected Part Version or Document Revision.
[Top]
[1] | Building and Launching a CAA V5 Use Case |
[Top] |
Version: 1 [Jan 2006] | Document created |
[Top] |
Copyright © 2006, Dassault Systèmes. All rights reserved.