Running the API Samples

Before you modify the source, compile and run the API samples as delivered. Doing so ensures that your development system is set up correctly and helps you to gain a basic understanding of workflow operations.

Compile the appropriate samples. For information about the samples supplied, see Process API Samples Overview. Here is the command-line syntax for running the MainSample application after it is compiled:


    MainSample username password /connectionPoint_name 
        wfDefinition_filename | wfDefinition_filename output_filename
The required parameters are as follows:
  • username is an existing Content Platform Engine user ID.
  • password is the password for the specified user.
  • connectionPoint_name is the connection point to use.
The optional parameters are as follows:
  • wfDefinition_filename is an existing workflow definition (.pep) file.
  • output_filename is the file in which to store the results of the application.

As an example, the following command line shows how to run the unmodified samples as SysAdmin:


 
    java -classpath .;%CLASSPATH% MainSample SysAdmin myserver:32771/myConnectionPoint

In this example, the connection point "myConnectionPoint" on the server myserver, port 32771. No workflow definition (*.pep) or output files are specified.

When the MainSample application runs without encountering errors, you receive output that is similar to the following example. (The output is shown in the same command window from which you ran the MainSample application.)

Writing messages to file: MainSample.out
~~ Starting the main sample.
~ Starting SysConfigSample execution. 
~ SysConfigSample execution complete.
~ Starting WFDefinitionSample execution. 
~ WFDefinitionSample execution complete.
~ Starting LaunchSample execution. 
~ LaunchSample execution complete.
~ Starting RosterSample execution. 
~ RosterSample execution complete.
~ Starting StepProcessorSample execution. 
~ StepProcessorSample execution complete.
~ Starting QueueSample execution. 
~ QueueSample execution complete.
~ Starting MilestoneSample execution. 
~ MilestoneSample execution complete.
~ Starting OperationsSample execution. 
~ OperationsSample execution complete.
~ Starting SystemStepSample execution. 
~ Launching Generated Workflow 
~ SystemStepSample execution complete.
~ Starting StepProcessorSample execution. 
~ StepProcessorSample execution complete.
~ Starting ProcessSample execution. 
~ ProcessSample execution complete.
~ Starting StepProcessorSample execution. 
~ StepProcessorSample execution complete.
~ Starting LogSample execution. 
~ LogSample execution complete.
~~ MainSample execution complete.
Note: This output represents the typical console output results for the first time the MainSample application is run. If the MainSample application is run a second time, without modification, you receive notification that states that the required queues exist.

The following files, which are created by running the unmodified samples, are located in the same directory as the MainSample.class file:

  • MainSample.out

    This file name is the default name for the output file. You can specify a different output file name as part of the MainSample application command line. The output file contains the text-formatted output of the MainSample application. The results of the application operation in the output file clearly indicate where and in what order the other classes are called. Additionally, the contents of the output file provide some indication of the type of information you can retrieve from each associated API.

  • Sample.pep
    This file name is the default name of the workflow definition file that is created by the MainSample application. You can specify a different workflow definition file, if you have a valid workflow definition file already. This workflow definition file contains the XML representation of the workflow definition. You can open this text-formatted file for the following purposes:
    • To examine the workflow definition elements
    • To look at the graphical representation of the workflow by opening the file in Process Designer
  • vwapi.txt

    This file contains all of the session-related information. The file logs all of the session-related calls. The information that is contained in the file is useful to resolve problems that involve connecting to and making calls to a Content Platform Engine server.