0 Replies Latest reply on Apr 5, 2012 9:31 PM by Affan Dar

    Creating and using a process programmatically

    Affan Dar Newbie

      The jbpm 5.2 user guide explains how to create a Process using the API here: http://docs.jboss.org/jbpm/v5.2/userguide/ch05.html#d0e783, but it doesn't say how to load this process within a KnowledgeBase. I tried to create my own implementation of a KnowledgePackage and return this process in the call to KnowledgePackage.getProcesses() but when I add this knowledge package to a KnowledgeBase via the addKnowledgePackages method, I get a cast exception. Seems like the method is expecting the implementation to be an instance of KnowledgePackageImpl and nothing else.


      I.e. line 119 here: http://grepcode.com/file/repository.jboss.org/maven2/org.drools/drools-core/5.1.0.M1/org/drools/impl/KnowledgeBaseImpl.java#KnowledgeBaseImpl.addKnowledgePackage%28org.drools.definition.KnowledgePackage%29


      How else can I add my programmatically created process to a kbase?