API サンプルの実行
ソースを変更する前に、提供された状態のまま API サンプルをコンパイルして実行してください。そうすることで、開発システムが正しくセットアップされていることを確認でき、ワークフロー・オペレーションの基本的な理解が得られます。
該当するサンプルをコンパイルします。提供されたサンプルの詳細については、Process API サンプルの概要を参照してください。以下は、コンパイル後の MainSample アプリケーションを実行するためのコマンド行構文です。
MainSample username password server_name:port_number/connectionPoint_name
wfDefinition_filename | wfDefinition_filename output_filename
- username は既存の Content Platform Engine ユーザー ID です。
- password は指定されたユーザーのパスワードです。
- server_name は Application Engine ホスト (デフォルトはローカル・マシン) です。
- port_number は Content Platform Engine Manager ポート (デフォルトは 32771) です。
- connectionPoint_name は使用する接続ポイントです。
- wfDefinition_filename は既存のワークフロー定義 (.pep) ファイルです。
- output_filename はアプリケーションの結果を格納するファイルです。
例として、以下のコマンド行は未変更のサンプルを SysAdmin として実行する方法を示します。
java -classpath .;%CLASSPATH% MainSample SysAdmin myserver:32771/myConnectionPoint
この例の接続ポイントは、サーバー myserver、ポート 32771 の「myConnectionPoint」です。ワークフロー定義 (*.pep) ファイルも出力ファイルも指定されていません。
MainSample アプリケーションがエラーなしで実行されると、以下の例のような出力が表示されます。 (出力は、MainSample アプリケーションを実行したのと同じコマンド・ウィンドウに表示されます。)
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.
以下のファイルは、変更していないサンプルを実行することによって作成され、MainSample.class ファイルと同じディレクトリーに配置されます。
- MainSample.out
このファイル名は、出力ファイルのデフォルト名です。MainSample アプリケーション・コマンド行の一部として、別の出力ファイル名を指定できます。この出力ファイルには、MainSample アプリケーションのテキスト形式の出力が格納されます。出力ファイルにあるアプリケーション操作の結果には、ほかのクラスが呼び出された場所と順序が明確に示されています。また、出力ファイルの内容は、それぞれの関連 API から取得できる情報の種類についてのヒントとなります。
- Sample.pepこのファイル名は、MainSample アプリケーションが作成したワークフロー定義ファイルのデフォルト名です。有効なワークフロー定義ファイルが既にある場合は、異なるワークフロー定義ファイルを指定できます。このワークフロー定義ファイルには、ワークフロー定義の XML 表記が格納されます。テキスト・フォーマットのこのファイルを、以下の目的で開くことができます。
- ワークフロー定義のエレメントを調べる
- Process Designer でファイルを開くことにより、ワークフローのグラフィカル表現を調べる
- vwapi.txt
このファイルには、すべてのセッション関連情報が格納されます。このファイルには、セッション関連のすべての呼び出しが記録されます。ファイルに含まれる情報は、Content Platform Engine サーバーへの接続や呼び出しに関する問題の解決に役立ちます。