This sample demonstrates how to create and save a workflow definition in a file.
java WFDefinitionSample 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 WFDefinitionSample 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 WFDefinitionSample.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 WFDefinitionSample constructor performs common exception handling and demonstrates a variety of workflow definition functions. It creates the default workflow definition (using the VWWorkflowDefinition constructor), sets some the workflow definition general properties (using the VWWorkflowDefinition set* methods), and creates some fields (using VWWorkflowDefinition.createFieldUsingString). It gets a VWMapDefinition object for the main map for the workflow, and sets the description for the main map (using the VWWorkflowDefinition methods getMainMap and setDescription). It gets a VWMapNode object for the launch step, and sets the description for the launch step (using the VWMapDefinition methods getStartStep and setDescription), and iterates through the main workflow map to add some steps in the main map and create routes for each new step (using the local addstep method and VWMapNode.createRoute). Finally, it validates the workflow (using the local validate method) and writes the validated workflow definition to a file (using VWWorkflowDefinition.writeToFile).
Uses VWMapDefinition.createStep to get a VWStepDefinition object, initializes step parameters (using VWStepDefinition.createParameter), creates a new workflow participant and adds the participant to the workflow (using the VWParticipant constructor, VWParticipant.setParticipantName, and VWStepDefinition.setParticipants), sets the queue name, deadline, and remainder times (using the VWStepDefinition methods setQueueName, setDeadline, and setReminder), sets the step definition description and design display location (using the VWStepDefinition methods setDescription and setLocation), and logs the status of the new step creation (using the sample Logger class).
Uses VWStepDefinition.validate to validate the workflow definition.