IBM FileNet P8, Version 5.2.1            

WFDefinitionSample

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

For more information, see the comments in the sample source. The samples are supplied in the Developer samples section of the IBM® FileNet® P8 Platform publication library.

See also Running the API Samples.

Methods

General descriptions of the WFDefinitionSample methods follow:

main()

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. It also provides workflow logging with an instance of the sample Logger class.

WFDefinitionSample()

The WFDefinitionSample constructor performs common exception handling and demonstrates various workflow definition functions. It performs the following activities:
  • Creates the default workflow definition (by using the VWWorkflowDefinition constructor)
  • Sets some of the workflow definition general properties (by using the VWWorkflowDefinition set* methods)
  • Creates some fields (by using VWWorkflowDefinition.createFieldUsingString)
  • Gets a VWMapDefinition object for the main map for the workflow
  • Sets the description for the main map (by using the VWWorkflowDefinition methods getMainMap and setDescription)
  • Gets a VWMapNode object for the launch step
  • Sets the description for the launch step (by using the VWMapDefinition methods getStartStep and setDescription)
  • Iterates through the main workflow map to add some steps in the main map (by using the local addstep method)
  • Creates routes for each new step (by using VWMapNode.createRoute)
  • Validates the workflow (by using the local validate method) and writes the validated workflow definition to a file (by using VWWorkflowDefinition.writeToFile)

addStep()

This method performs the following activities:

validate()

Uses VWStepDefinition.validate to validate the workflow definition.



Last updated: October 2015
wfdefinitionsample.htm

© Copyright IBM Corporation 2015.