1 Reply Latest reply on Jun 13, 2014 1:36 AM by Maciej Swiderski

    What kie api should be used?

    Cameron Smith Newbie

      Hi guys,


      when interacting directly with the Java in order to use the core flow engine, I was wondering which api should be used.


      Looking at the javadocs ( KIE API 6.0.1.Final API ), the introductory examples on the first page suggest following the following basic code pattern:

      KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

      kbuilder.add( ResourceFactory.newUrlResource( url ),

        ResourceType.BPMN2 );

      KnowledgeBase kbase = kbuilder.newKnowledgeBase();

      StatefulKnowledgeSession ksession = knowledgeBase.newStatefulKnowledgeSession();

      ksession.startProcess( "Buy Order Process" );



      However, that seems to use the org.kie.internal.* classes, and not the org.kie.api.* classes. I would assume that the org.kie.api classes would be the preferred api to be used from an external source, if only from the package name.


      Is it OK to use the org.kie.internal package classes? And if not, is there a description on how to use the (slightly differently structured) org.kie.api classes?





        • 1. Re: What kie api should be used?
          Maciej Swiderski Master

          you're right you should mainly use org.kie.api classes in your code. The java docs is definitely outdated so would like to ask you to file jira for this so it gets updated. Use of kie.internal is actually allowed as well as this is sort of "baking time" place for api. It still might change before it gets promoted to public api but usually it is kept backward compatible. Though when using it you need to keep in mind it might change in future.