The Tasks command displays the FileNet Workplace Tasks Java™Server Pages (JSP) page, which presents a Tasks queue to the user. The client application must use the ITasksCmd interface to specify the page title, the Tasks queue to open, and which tasks in the queue to display.
After the Tasks command has been executed by calling IAppIntCmd::Invoke, a Tasks response component is returned. Client applications may interact with the Response component via the standard IAppIntRsp and custom ITasksRsp interfaces. For more information about working with command and response components and their COM interfaces, see Command and Response components.
DLL | FnAppIntTasksCmd.dll |
The Tasks command uses the following interfaces:
Interface | Description |
---|---|
ITasksCmd |
This is a custom interface used to initialize the data contained in the Tasks command component. The client application can use the method in this interface to specify the title for the JSP page, the Tasks queue to open, and identify which tasks in the queue to display. |
ITasksRsp |
This is a custom interface for the Tasks response component that is returned when the Tasks command is executed. |
IAppIntCmd |
This is a standard interface which is automatically used by the Tasks command to invoke the Tasks command component. The client application executes the Tasks command by calling this interface and passing the AppIntSession component on which the Tasks command component is invoked. Each time the command is executed, a Tasks response component is returned. |
IAppIntRsp |
This is a standard interface that is automatically used by the Tasks command to determine the success or failure of the command, as well as retrieve any error code or messages. |
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
#import "C:\Program Files\FileNet\AppInt\FnAppIntCmdComponents.dll" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntTasksCmd.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 the custom Tasks command component ITasksCmdPtr spITasksCmd;
hResult = spITasksCmd.CreateInstance(__uuidof(TasksCmd));
if (FAILED(hResult)) {
std::cout << "Could not create the Tasks command component.\n"; _ASSERTE(0);
} // Initialize the custom Tasks command component with the // page title, queue name and queue type. _bstr_t bstrPageTitle = (_T("Customized Tasks Operation")); QueueNames enQueueName = eQueueNameInbox; QueueTypes enQueueType = eQueueTypeUser; std::cout << "Initializing the Tasks command component..." << std::endl; spITasksCmd->Initialize(bstrPageTitle, enQueueName, enQueueType);// Execute the Tasks command and capture the response component std::cout << "Executing the Tasks command..." << std::endl; IAppIntCmdPtr spIAppIntCmd(spITasksCmd);
IAppIntRspPtr spIAppIntRsp = spIAppIntCmd->Invoke(spIAppIntSession);// Determine if the command failed, before accessing response component data hResult = spIAppIntRsp->GetHResult(); if (FAILED(hResult)) { std::cout << "The Tasks command failed to execute." << std::endl; // Examine the error information provided in the standard response component _bstr_t bstrErrorName = spIAppIntRsp->GetErrorName(); std::cout << "ErrorName=" << ( bstrErrorName.length() ? (LPCSTR) bstrErrorName : _T( "" ) ) << std::endl; _bstr_t bstrErrorMsg = spIAppIntRsp->GetErrorMsg(); std::cout << "ErrorMsg=" << ( bstrErrorMsg.length() ? (LPCSTR) bstrErrorMsg : _T( "" ) ) << std::endl; _bstr_t bstrErrorDetails = spIAppIntRsp->GetErrorDetails(); std::cout << "ErrorDetails=" << ( bstrErrorDetails.length() ? (LPCSTR) bstrErrorDetails : _T( "" ) ) << std::endl; _ASSERTE(0);
} else { std::cout << "The Tasks command succeeded." << std::endl; // Obtain the response name and description from the standard response component _bstr_t bstrResponseDescription = spIAppIntRsp->GetDescription(); std::cout << "ResponseDescription=" << ( bstrResponseDescription.length() ? (LPCSTR) bstrResponseDescription : _T( "" ) ) << std::endl; _bstr_t bstrResponseName = spIAppIntRsp->GetName(); std::cout << "ResponseName=" << ( bstrResponseName.length() ? (LPCSTR) bstrResponseName : _T( "" ) ) << std::endl; // Obtain the custom TasksRsp component ITasksRspPtr spITasksRsp(spIAppIntRsp);
_ASSERTE(spITasksRsp != 0); }...