JBoss Community

Re: How can I take process definitions from Guvnor with jBPM5 API?

created by Alessandro Dionisi in jBPM - View the full discussion

Thanks liliana, but I can't execute successfully your code (unable to parse ChangeSet error).

I've tried to modify your code as follows:

 

  KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();

                    KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("testKAgent", aconf);

                    String fileName = "http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/plx/LATEST/ChangeSet.xml";

                    kagent.applyChangeSet(ResourceFactory.newUrlResource(fileName));

                    KnowledgeBase kbase2 = kagent.getKnowledgeBase();

                    StatefulKnowledgeSession ksession2 = kbase2.newStatefulKnowledgeSession();

                    ProcessInstance processInstance = ksession2.startProcess("plx.SimpleProcess");

 

But I obtain: Server returned HTTP response code: 401 for URL: http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/plx/LATEST/ChangeSet.xml

 

Did you remove authentication from Guvnor?

Reply to this message by going to Community

Start a new discussion in jBPM at Community