This sample demonstrates how to create a workflow definition object from the workflow definition file and transfer it to the database. Run the sample by entering a command similar to the following:
java LockReportSample username password server_name:port_number/connectionPoint_name wfDefinition_filename | wfDefinition_filename 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 LaunchSample methods follow:
The main method uses common techniques for validating and defaulting argument values. The default values for the log output file and workflow definition file names are LaunchSample.out and Sample.pep, respectively. Main() 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 LaunchSample constructor defines a workflow, transfers the definition to the system database, creates and comments the Launch step, and dispatches the workflow.
The constructor uses VWWorkflowDefinition.readFromFile to create a workflow definition object from an existing workflow definition (*.pep) file. See the sample class WFDefinitionSample) to create a workflow definition file.
VWSession.transfer is used to transfer the workflow definition, returning a VWTransferResult object. The workflow version string in the VWTransferResult object is passed to VWSession.createWorkflow, and a StepElement object for the launch step is returned. The sample Logger class logs the launch step properties. The launch step is then completed using VWStepElement.doDispatch.