This sample demonstrates how to retrieve, modify, and complete a step using the VWWorkObject class. Run the sample by entering a command similar to the following:
java WorkPerformerSample username password server_name:port_number/connectionPoint_name queue_name output_filename
Refer to the comments in the sample source for further information. The samples are located on the P8 Documentation CD or ESD image in:
ecm_help\developer_help\process_java_api\Developer Files\samples\api
See also Running the API Samples.
General descriptions of the WorkPerformerSample methods follow:
The main method uses common techniques for validating and defaulting argument values. The default value for the log output file is QueueSample.out. It constructs and passes VWSession and sample Logger class objects to the constructor. Main() handles the login and logoff for the session with the login() and logoff() methods of the sample SessionHelper class, and provides workflow logging with an instance of the sample Logger class.
The WorkPerformerSample constructor uses the sample QueueHelper.getQueue to get the VWQueue object (specified as the argument to the constructor), starts a process thread for WorkPerformerSample, and invokes the local run method to run this process.
Retrieves the VWWorkObject objects from the queue using VWQueue.createQuery (based on the type VWFetchType.FETCH_TYPE_WORKOBJECT), and iterates through the queue (using VWQueue.next) calling the local processWork method to process the work objects.
Processes a work object obtained from the query of a queue using VWWorkObject.doLock to lock the VWWorkObject object for modification, VWWorkObject.getFieldValue to get the field information, VWWorkObject.setFieldValue to set a field value, and VWWorkObject.doDispatch to complete the work object.