IAppIntCmd Interface

Every Application Integration command supported by the FileNet Workplace Application Integration Toolkit automatically uses the IAppIntCmd interface and its' relevant methods. Every command gets executed by calling IAppIntCmd::Invoke and passing the AppIntSession component on which the command component is invoked. The client can then invoke the command component upon one or more of their AppIntSession components.

Each time a command is executed, a newly instantiated response component is returned, where IAppIntRsp is the standard interface for examining the data returned in the response component. For more information about working with command and response components and their COM interfaces, see Command and Response components.

Reference

TLB File FnAppIntCmd.tlb
See Also IAppIntRsp Interface

Methods

The IAppIntCmd interface defines the following methods:

Method Description
GetDescription

Returns the description of the invoked command.

GetName

Returns the name of the invoked command.

Invoke

Executes the command by passing the AppIntSession component on which the command component is invoked. Each time the command is executed, a response component is returned.

Example

In the application's StdAfx.h header file:

#import"C:\Program Files\FileNet\AppInt\FnAppIntCmd.tlb"                      named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntHttpRequest.dll"              named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntBrowserDlg.dll"               named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntHttpConnection.dll"           named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntResources.dll"                named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntClientRecordBase.tlb"         named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntClientStore.dll"              named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntSession.dll"                  named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntSessionLogin.dll"             named_guids no_namespace

In the application's primary .cpp source file:

// Instantiate the StdSessionLogin component
IStdSessionLoginPtr spIStdSessionLogin;
HRESULT hResult = spIStdSessionLogin.CreateInstance(__uuidof(StdSessionLogin));
if (FAILED(hResult)) { std::cout << "Could not create the StdSessionLogin component." << std::endl; _ASSERTE(0); } try {
// Initialize the StdSessionLogin component to create // a separate, non-unified login for the client application // by specifying the session / client application name. std::cout << "Initializing the StdSessionLogin component to use NON-unified login..." << std::endl; _bstr_t sessionName(_T("WordPerfect")); spIStdSessionLogin->InitializeViaSessionName(sessionName);
// Instantiate the AppIntSession component
IAppIntSessionPtr spIAppIntSession;
hResult = spIAppIntSession.CreateInstance(__uuidof(AppIntSession)); if (FAILED(hResult)) { std::cout << "Could not create the AppIntSession component." << std::endl; _ASSERTE(0); } // Initialize the AppIntSession component with the StdSessionLogin component
std::cout << "Initializing the AppIntSession component..." << std::endl;
spIAppIntSession->Initialize(spIStdSessionLogin); // The Client Application may invoke a SessionLogin here; otherwise, // it will automatically be invoked as needed when commands are executed. std::cout << "Checking Login Status..." << std::endl; VARIANT_BOOL bIsLoggedIn = spIAppIntSession->IsLoggedIn(); if (bIsLoggedIn == VARIANT_TRUE) { std::cout << "User is currently Logged In." << std::endl; } else {
std::cout << "User is NOT currently Logged In." << std::endl;
std::cout << "Attempting Login..." << std::endl;
hResult = spIAppIntSession->Login(); if (FAILED(hResult)) { std::cout << "Login failed." << std::endl; _ASSERTE(0); }
std::cout << "Login succeeded." << std::endl; } // Instantiate and Initialize the custom command component here // Execute the command and capture the response component std::cout << "Executing the command..." << std::endl; IAppIntCmdPtr spIAppIntCmd(spICommandNameCmd); _bstr_t bstrCommandName = spIAppIntCmd->GetName(); std::cout << "CommandName=" << ( bstrCommandName.length() ? (LPCSTR) bstrCommandName : _T( "" ) ) << std::endl; _bstr_t bstrCommandDescription = spIAppIntCmd->GetDescription(); std::cout << "CommandDescription=" << ( bstrCommandDescription.length() ? (LPCSTR) bstrCommandDescription : _T( "" ) ) << std::endl;
IAppIntRspPtr spIAppIntRsp = spIAppIntCmd->Invoke(spIAppIntSession);
... } catch(...) {
}