SubmitAsync () method

The method SubmitAsync of the class Aia.ITP.Server.Job submits the job to the KCM Core running on the host and port specified by the properties Host and Port. The method returns immediately after the job has been submitted, without waiting until the job has been processed. If the method returns normally, this means that the job was submitted successfully. If an error occurs during the submission of the job, an exception is thrown. If an error occurs during the processing of the job, this is not reported.

In contrast to the method Submit, the method SubmitAsync does not allow for the exchange of data values, files, or progress messages with KCM Core. If these mechanisms are needed, the method Submit must be used instead.

The class Aia.ITP.Server.Job exposes the following properties:

  • Host
  • Port
  • JobID
  • Service
  • Parameters
  • SessionID
  • ConfirmCompletion
  • KeepAlive
  • NoDelay
  • PrivateTransfer
  • UserID
  • ApplicationID

The property Host is a string that specifies the host name of the machine running KCM Core. You can specify the name either in (IPv4) Internet Protocol dotted address notation (a.b.c.d), or as a resolvable host name.

The property Port is a string that specifies the port number on which KCM Core is running. You can specify the port either in numerical format or as a Service name resolved through any available Service databases.

The property JobID is a string used to identify the job on KCM Core. Also, it appears in the KCM Core log files in all log lines that describe the job run.

The property Service is a string that specifies the name of KCM Core Service that the job should invoke.

The property Parameters is a read-only property of type List<String>. It contains the list of parameters passed to the KCM Core Service. To add or remove parameters, manipulate the object List<String> returned by this property, using the standard methods provided by the .NET Framework. Parameters cannot be null. The empty string is interpreted as if the parameter was not passed, which causes the default value to be substituted (if any).

The property SessionID is a string that specifies the KCM Core session ID that will be associated with the submitted job. KCM Core session IDs serve multiple purposes:

  • Mutual exclusion. The KCM Core guarantees that multiple requests for the same session ID are not handled in parallel by multiple Document Processors. Instead, multiple simultaneous requests with the same session ID are queued and processed in a series.
  • Persistent storage across jobs. KCM Core Services may use the session ID to store information across several KCM Core jobs, so that each job can use data stored by earlier jobs.

You can specify session IDs for mutual exclusion by the calling the client. Session IDs for persistent storage are always generated by KCM Core and must be sent to the calling client using the mechanism exchange_data. For convenience, the class Aia.ITP.Server.Job allows the KCM Core Service to pass a session ID using the mechanism exchange_data and using the key "SessionID" (case-insensitive). The data value of such a data exchange request is automatically stored in the property SessionID of the object Aia.ITP.Server.Job. This functionality works regardless of whether the ExchangeData event is being handled.

For more information about the use of session IDs in KCM Core, see the section KCM Core sessions of the Kofax Communications Manager Core Scripting Language Developer's Guide.

The boolean property ConfirmCompletion specifies that KCM Core should not regard the job as completed until the client, such as the object Aia.ITP.Server.Job, has confirmed to KCM Core that it has received the message stating that the job has completed. This setting has no effect when the job is submitted using SubmitAsync. This property is set to false by default.

The boolean property KeepAlive specifies that the Aia.ITP.Server.Job object should send confirmation messages to KCM Core to indicate that it is still listening, upon request from KCM Core. This setting corresponds to the setting "Verify connection" that you can find on the Advanced tab of KCM Core Administrator. This setting has no effect when the job is submitted using SubmitAsync. The property is set to false by default.

The boolean property NoDelay specifies that the underlying TCP/IP connection to KCM Core should not use Nagle's algorithm to put as much data as possible into a single network packet. Enabling this option significantly reduces network latency, but also leads to a significant increase in network traffic. The property is set to false by default.

The boolean property PrivateTransfer specifies that the KCM Core load balancer should be bypassed for file transfers. Enabling this option may increase performance for large file transfers. The property is set to false by default.

The properties UserID and ApplicationID are strings used for the submission of KCM ComposerUI Server jobs. UserID specifies the user name of the user connected to KCM ComposerUI Server while the ApplicationID identifies the KCM ComposerUI Server application that submits the job. It is not necessary to specify these properties.