How to declare an Event Fact Type programatically (outside a DRL) in BRMS 6?

Solution Verified - Updated -

Environment

  • Red Hat JBoss Business Rule Management System (BRMS) 6.0.x, 6.1.x

Issue

  • Is there a way to declare events in the Java side of the platform, and not in the actual DRL files. In other words, is there a way to declare a Java object as an event in Java, and not in the DRL?

  • How to declare an Event Fact Type programatically (outside a DRL)?

Resolution

You can do that via annotation as follows:

package example;

/**
 * This class was automatically generated by the data modeler tool.
 */

@org.kie.api.definition.type.Role(org.kie.api.definition.type.Role.Type.EVENT)
public class test implements java.io.Serializable
{

   static final long serialVersionUID = 1L;

   public test()
   {
   }

}

It can also be generated by business-central. Refer to our CEP documentation in order to obtain further information.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments