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

Chapter 63. Registering custom tasks


Red Hat Process Automation Manager must know how to associate a custom task work item with the code executed by the work item handler. The work item definition file links the custom task with the work item handler by name and Java class. The work item handler’s Java class has to be registered as usable in Red Hat Process Automation Manager.

Note

Service repositories contain domain-specific services that provide integration of your processes with different types of systems. Registering a custom task is not necessary when using a service repository because the import process registers the custom task.

Red Hat Process Automation Manager creates a WID file by default for projects that contain at least one business process. You can create a WID file when registering a work item handler or edit the default WID file. For more information about WID file locations or formatting, see Chapter 61, Work item definitions.

For non-service repository deployments, work item handlers can be registered in two ways:

  • Registering using the deployment descriptor.
  • Registering using the spring component registration.

63.1. Registering custom tasks using the deployment descriptor inside Business Central

You can register a custom task work item with the work item handler using the deployment descriptor in Business Central.

Procedure

  1. In Business Central, go to Menu Design Projects and select the project name.
  2. In the project pane, select Settings Deployments Work Item Handlers.
  3. Click Add Work Item Handler.
  4. In the Name field, enter the display name for the custom task.
  5. From the Resolver list, select MVEL, Reflection or Spring.
  6. In the Value field, enter the value based on the resolver type:

    Note

    The value fields may be filled automatically.

    • For MVEL, use the format new <full Java package>.<Java work item handler class name>()

      Example: new com.redhat.MyWorkItemWorkItemHandler()

    • For Reflection, use the format <full Java package>.<Java work item handler class name>

      Example: com.redhat.MyWorkItemWorkItemHandler

    • For Spring, use the format <Spring bean identifier>

      Example: workItemSpringBean

  7. Click Save to save your changes

63.2. Registering custom tasks using the deployment descriptor outside Business Central

You can register a custom task work item with the work item handler using the deployment descriptor outside Business Central.

Procedure

  1. In your Git project directory, open the file src/main/resources/META-INF/kie-deployment-descriptor.xml.
  2. Add the following content based on the resolver type under <work-item-handlers>:

    • For MVEL, add the following:

      <work-item-handler>
        <resolver>mvel</resolver>
        <identifier>new com.redhat.MyWorkItemWorkItemHandler()</identifier>
        <parameters/>
        <name>MyWorkItem</name>
      </work-item-handler>
      Copy to Clipboard Toggle word wrap
    • For Reflections, add the following:

      <work-item-handler>
        <resolver>reflection</resolver>
        <identifier>com.redhat.MyWorkItemWorkItemHandler</identifier>
        <parameters/>
        <name>MyWorkItem</name>
      </work-item-handler>
      Copy to Clipboard Toggle word wrap
    • For Spring, add the following and ensure the identifier is the identifier of a Spring bean:

      <work-item-handler>
        <resolver>spring</resolver>
        <identifier>beanIdentifier</identifier>
        <parameters/>
        <name>MyWorkItem</name>
      </work-item-handler>
      Copy to Clipboard Toggle word wrap
      Note

      If you are using Spring to discover and configure Spring beans, it is possible to use an annotation of the org.springframework.stereotype.Component class to automatically register work item handlers.

      Within a work item handler, add the annotation @Component("<Name>") before the declaration of the work item handler class. For example: @Component("MyWorkItem") public class MyWorkItemWorkItemHandler extends AbstractLogOrThrowWorkItemHandler {

Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

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

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

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

Red Hat 소개

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

Theme

© 2026 Red Hat
맨 위로 이동