Search code examples
javajbpmkie

How to use a Data Object created in business central ui on a custom Work Item Handler in jBPM?


I am following the steps on the tutorial from jBPM documentation to create a business application.

The project is made of the structure:

  1. The KJAR where is the business assets
  2. The service where the project will be running
  3. The model where data structures will be implemented

I have implemented a custom Work Item Handler in the service project, and a question came to my mind: What if I need to reference a Data Object created in business central (via UI) and use this class in the custom work item handler to process it and return to the next tasks?

What I have tried was to add the dependency of the KJAR project on service project pom and it worked fine. But I haven't seen in the documentation nothing related to a solution using this approach.

First, does it makes sense? Second how could I "link" assets created in KJAR project inside the service project?


Solution

  • I haven't been able to find the documentation either.

    However the kjar seems to have many of the properties of a java jar. I've successfully managed to define objects in the business central UI, and after uploading them to nexus repository, it is possible to add a standard maven dependency on the jar.

    This way, I was able to use the model defined using the business central UI like standard java objects (if you look inside the jar, you can see some familiar java objects as well as the rules definition).

    It seems like you were able to achieve the same thing so I am not sure what exactly you are asking :)

    If by "link" you mean import into the project then you can do it whatever way you import other dependencies - one way is to add them to the pom.xml - which you seem to have done already. You can get the package and name in the settings section of the business central ui.

    If you have your own repository (nexus for example) you can manually upload it there using mvn deploy command.