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()
- 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()
- Uses VWMapDefinition.createStep to get a VWStepDefinition object
- Initializes step parameters (by using VWStepDefinition.createParameter)
- Creates a new workflow participant and adds the participant to the workflow (by using the VWParticipant constructor, VWParticipant.setParticipantName, and VWStepDefinition.setParticipants)
- Sets the queue name, deadline, and reminder times (by using the VWStepDefinition methods setQueueName, setDeadline, and setReminder)
- Sets the step definition description and design display location (by using the VWStepDefinition methods setDescription and setLocation)
- Logs the status of the new step creation (by using the sample Logger class).
validate()
Uses VWStepDefinition.validate to validate the workflow definition.