이 콘텐츠는 선택한 언어로 제공되지 않습니다.

9.16. Batch-execution and Command Examples


  1. There is currently no XML schema to support schema validation. This is the basic format. The root element is <batch-execution> and it can contain zero or more commands elements:
    <batch-execution>
    ...
    </batch-execution>
    
    Copy to Clipboard Toggle word wrap
  2. The insert element features an "out-identifier" attribute so the inserted object will be returned as part of the result payload:
    <batch-execution>
       <insert out-identifier='userVar'>
          ...
       </insert>
    </batch-execution>
    
    Copy to Clipboard Toggle word wrap
  3. It's also possible to insert a collection of objects using the <insert-elements> element. This command does not support an out-identifier. The org.domain.UserClass is just an illustrative user object that XStream would serialize:
    <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. The <set-global> element sets a global for the session:
    <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> also supports two other optional attributes: out and out-identifier. A true value for the boolean out will add the global to the <batch-execution-results> payload, using the name from the identifier attribute. out-identifier works like out but additionally allows you to override the identifier used in the <batch-execution-results> payload:
    <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. There is a <get-global> element without contents. It only has an out-identifier attribute. There is no need for an out attribute because retrieving the value is the sole purpose of a <get-global> element:
    <batch-execution>
       <get-global identifier='userVar1' />
       <get-global identifier='userVar2' out-identifier='alternativeUserVar2'/>
    </batch-execution>
    
    Copy to Clipboard Toggle word wrap
  7. The query command supports both parameter and parameterless queries. The name attribute is the name of the query to be called, and the out-identifier is the identifier to be used for the query results in the <execution-results> payload:
    <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. The <start-process> command accepts optional parameters:
    <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. The signal event command allows you to identify processes:
    <signal-event process-instance-id='1' event-type='MyEvent'>
       <string>MyValue</string>
    </signal-event>
    
    Copy to Clipboard Toggle word wrap
  10. The complete work item command notifies users when a process is completed:
    <complete-work-item id='" + workItem.getId() + "' >
       <result identifier='Result'>
          <string>SomeOtherString</string>
       </result>
    </complete-work-item>
    
    Copy to Clipboard Toggle word wrap
  11. The abort work item command lets you cancel a process while it is running:
    <abort-work-item id='21' />
    
    Copy to Clipboard Toggle word wrap
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat