12.16. batch-execution とコマンドの例


  1. 現在、スキーマ検証をサポートする XML スキーマはありません。これは基本的な形式です。ルート要素は <batch-execution> で、これには 0 個以上の commands 要素を含めることができます。
    <batch-execution>
    ...
    </batch-execution>
    
    Copy to Clipboard Toggle word wrap
  2. insert 要素は "out-identifier" 属性を特長とし、挿入されたオブジェクトは結果ペイロードの一部として返されます。
    <batch-execution>
       <insert out-identifier='userVar'>
          ...
       </insert>
    </batch-execution>
    
    Copy to Clipboard Toggle word wrap
  3. <insert-elements> 要素を使用してオブジェクトのコレクションを挿入することもできます。このコマンドは out-identifier をサポートしません。org.domain.UserClass は、XStream がシリアライズするユーザーオブジェクトです。
    <batch-execution>
       <insert-elements>
          <org.domain.UserClass>
             ...
          </org.domain.UserClass>
          <org.domain.UserClass>
             ...
          </org.domain.UserClass>
          <org.domain.UserClass>
             ...
          </org.domain.UserClass>
       </insert-elements>
    </batch-execution>
    
    Copy to Clipboard Toggle word wrap
  4. <set-global> 要素は、セッションのグローバルを設定します。
    <batch-execution>
       <set-global identifier='userVar'>
          <org.domain.UserClass>
             ...
          </org.domain.UserClass>
       </set-global>
    </batch-execution>
    
    Copy to Clipboard Toggle word wrap
  5. <set-global> は、outout-identifier の 2 つのオプション属性もサポートします。ブール値の true 値は、識別子 属性からの名前を使用して、グローバルを <batch-execution-results> ペイロードに追加します。out-identifierout のように機能しますが、さらに <batch-execution-results> ペイロードで使用される識別子を上書きできます。
    <batch-execution>
       <set-global identifier='userVar1' out='true'>
          <org.domain.UserClass>
             ...
          </org.domain.UserClass>
       </set-global>
       <set-global identifier='userVar2' out-identifier='alternativeUserVar2'>
          <org.domain.UserClass>
             ...
          </org.domain.UserClass>
       </set-global>
    </batch-execution>
    
    Copy to Clipboard Toggle word wrap
  6. コンテンツのない <get-global> 要素があります。out-identifier 属性のみがあります。値の取得は <get-global> 要素の唯一の目的であるため、out 属性は必要ありません。
    <batch-execution>
       <get-global identifier='userVar1' />
       <get-global identifier='userVar2' out-identifier='alternativeUserVar2'/>
    </batch-execution>
    
    Copy to Clipboard Toggle word wrap
  7. query コマンドは、パラメータークエリーとパラメーターレスクエリーの両方をサポートします。name 属性は呼び出されるクエリーの名前で、out-identifier はクエリーに使用される識別子で、<execution-results> ペイロードになります。
    <batch-execution>
       <query out-identifier='cars' name='cars'/>
       <query out-identifier='cars2' name='carsWithParams'>
          <string>red</string>
          <string>blue</string>
       </query>
    </batch-execution>
    
    Copy to Clipboard Toggle word wrap
  8. <start-process> コマンドは、任意のパラメーターを受け入れます。
    <batch-execution>
       <startProcess processId='org.drools.actions'>
          <parameter identifier='person'>
             <org.drools.TestVariable>
                <name>John Doe</name>
             </org.drools.TestVariable>
          </parameter>
       </startProcess>
    </batch-execution
    
    Copy to Clipboard Toggle word wrap
  9. signal event コマンドを使用すると、プロセスを特定できます。
    <signal-event process-instance-id='1' event-type='MyEvent'>
       <string>MyValue</string>
    </signal-event>
    
    Copy to Clipboard Toggle word wrap
  10. 完全なワークアイテムコマンドは、プロセスが完了したときにユーザーに通知します。
    <complete-work-item id='" + workItem.getId() + "' >
       <result identifier='Result'>
          <string>SomeOtherString</string>
       </result>
    </complete-work-item>
    
    Copy to Clipboard Toggle word wrap
  11. abort work item コマンドを使用すると、実行中にプロセスをキャンセルできます。
    <abort-work-item id='21' />
    
    Copy to Clipboard Toggle word wrap

トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat