JBoss Community

Re: How to validate process definitions , before creating the Knowledge base object

created by Arun V G in jBPM - View the full discussion

In the latest source available in github the KnowledgeBuilder interface have a method undo

 

{https://github.com/droolsjbpm/droolsjbpm-knowledge/blob/master/knowledge-api/src/main/java/org/drools/builder/KnowledgeBuilder.java}

 

So that it looks like  I can implement my use case as below

 

kbuilder.add(ResourceFactory.newByteArrayResource(processFile), ResourceType.BPMN2);

            if(kbuilder.hasErrors()){

                /**

               

  • Remove the last added Resource.

               

  • Can be useful in case this last addition generated some compilation problem.

               

  • If multiple Resources have been added in batch using a CompositeKnowledgeBuilder,

               

  • it removes all of them.

                */

                kbuilder.undo();

            }

 

 

But unfortunately I think the  version  included with JBPM5.2  doesn't have this method (  knowledge-api-5.3.1.Final.jar )  .

 

In my work environment I am not allowed to work with an unreleased (latest) version :(( .Does anyone know a workaround.

 

 

Cheers :)

Reply to this message by going to Community

Start a new discussion in jBPM at Community