How to Submit a Data Import Using a Process Workflow

You can use a process workflow (for example, CA Process Automation) to submit a Data Importer data import for processing instead of using the CA APM user interface.
casm173
You can use a process workflow (for example, CA Process Automation) to submit a Data Importer data import for processing instead of using the CA APM user interface.
You can create a data import process workflow using a company-provided sample XML file and integrating with CA Process Automation.
To submit a data import using a process workflow, perform these steps:
Example: Import New Hardware Devices through a Process Workflow
Sam, the CA APM system administrator at Document Management Company, has defined a business process workflow. The workflow discovers new hardware devices, adds the new devices to the company data repository, and runs reports about the new devices. Sam has already created a data import in CA APM that adds the new hardware devices to the data repository. Sam wants to execute that data import at a specific point in his overall workflow. He wants to integrate the data import with his overall business process workflow. Sam wants the data import to execute at the time that the workflow specifies without the user logging in to the product user interface. Sam updates his business process workflow to include calls to the CA APM web service operations for the Data Importer.
Review the Prerequisites
To ensure that you can successfully submit a data import using a process workflow, verify that you have completed the following prerequisites:
  1. Define a data import with all mappings and settings through the CA APM user interface.
  2. Verify that the data file path (if you are specifying a path) is accessible from the server where the Import Service is running. Also, the Network Service (application pool identity) user requires access to this path.
  3. Define a process workflow using a workflow provider (such as CA Process Automation).
Specify the Workflow Calls
To launch the Data Importer and execute a data import from a process workflow, you provide specific workflow calls to CA APM web service operations. These operations perform the following functions:
  • Login operation - Logging in to CA APM.
  • Submitting a data import using one of the following ways of providing a data file:
    • SubmitImportwithfilepath Operation - The data file is available on a specified file path. This file path must be accessible from the server where the Import Service is running. The web service operation uploads the file.
    • SubmitImport Operation - The data file content has been converted to byte array binary format. The web service operation receives the byte array content from an application and submits the content to the Data Importer.
      To use this way of providing a data file, create an application, if one is not already available, to convert the data file content to byte array format. The application then sends the content to the web service operation.
Incorporate the calls to these operations into your business process workflow.
For information about creating a process workflow, see the product documentation for your workflow provider.
Login Operation
This operation logs in to CA APM using the specified CA APM user ID and password. The output of this operation is the login token. The login token is used as input to other data import workflow operations.
  • Input Parameters
    ItamUserName - CA APM user ID
    ItamUserPassword - CA APM user password
  • Output Parameters
    loginToken - Token that is returned after the CA APM login.
SubmitImport Operation
This operation receives data file content that has been converted to byte array format and submits the content with the data import to the Data Importer. To use this operation, create an application, if one is not already available, to convert the data file content to byte array format. The application then sends the content to this web service operation.
This operation returns a data import job ID, which is used to verify the status of the import job.
  • Input Parameters
    loginToken - Token that is returned after the CA APM login.
    ImportName - Name of the data import.
    Datafilename - Name of the data file that is associated with the data import.
    Datafilestream - Data file content in byte array format.
    Caprovided - (Optional) Indicator that specifies a product-provided data import. Set this parameter to one (1) to specify a product-provided import.
    Tenant - (Multi-tenancy only) Name of the tenant to which the import applies.
  • Output Parameters
    Job ID - ID that is returned after a data import is submitted successfully. The GetJobStatus operation uses this ID to verify the status of an import job.
SubmitImportwithfilepath Operation
This operation uploads a data file from a specified file path and submits the data file with the data import to the Data Importer. This file path must be accessible from the server where the Import Service is running.
The operation returns a data import job ID, which is used to verify the status of the import job.
  • Input Parameters
    loginToken - Token that is returned after the CA APM login.
    ImportName - Name of the data import.
    Datafilepath - Complete path and name of the data file that is associated with the data import. This path must be accessible from the server where the Import Service is running. Also, the Network Service (application pool identity) user requires access to this path.
    If the data file location is a shared path, the CA APM server and the shared computer must be in the same domain.Caprovided - (Optional) Indicator that specifies a product-provided data import. Set this parameter to one (1) to specify a product-provided import.
    Tenant - (Multi-tenancy only) Name of the tenant to which the import applies.
  • Output Parameters
    Job ID - ID that is returned after a data import is submitted successfully. The GetJobStatus operation uses this ID to verify the status of an import job.
Verify the Status of the Import Job
The Data Importer provides a status summary of each submitted data import job. Your process workflow can include a call to the CA APM web service operation that retrieves the status of a submitted data import job. Incorporate the call to this operation into your process workflow.
GetJobStatus Operation
This operation uses the data import job ID to verify the status of an import job.
  • Input Parameters
    loginToken - Token that is returned after the CA APM login.
    Job ID - ID that is returned after a data import is submitted successfully.
  • Output Parameters
    Job Status - Status of the import job.
Respond to Error Messages
If errors occur during the data import workflow process, you can receive error messages. The following messages require explanation:
  • 20002 - Cannot access the data import because of user permissions. Contact your administrator.
    The user role requires Data Importer Admin access or Data Importer User access to submit a data import.
  • 20005 - Cannot connect to the Import service. Contact your administrator.
    Verify the Import Service URL in the ImportProcessor.config file, or contact your administrator.
  • 21002 - The data import name is invalid.
    The data import does not exist, or the user does not have access to the data import. If the data import is product-provided, specify a value of 1 for the Caprovided parameter.
  • 21004 - The data file failed to upload.
    This message can result from a configuration error. Review the Storage Manager Service log files.
  • 21005 - No mappings are defined for the data import.
    Define mappings and resubmit the data import.
  • 22001 - The data import job ID is invalid. Verify the job ID and try to execute the import again.
    Verify the job ID by logging in to CA APM and locating the data import job. Resubmit the data import with the valid job ID.