[jboss-user] [jBPM] - Re: How to get a package from Guvnor and start it

doboss do-not-reply at jboss.com
Thu Dec 6 11:09:37 EST 2012


doboss [https://community.jboss.org/people/doboss] created the discussion

"Re: How to get a package from Guvnor and start it"

To view the discussion, visit: https://community.jboss.org/message/780425#780425

--------------------------------------------------------------
Okay, I am doing something wrong.  :)   If I use the following code the authentication works, and it looks like it is downloading the binary package:


private static KnowledgeBase readKnowledgeBase() throws Exception {
        KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
 
        KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("test", aconf);
 
        String url = "http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST/";
 
        UrlResource resource = (UrlResource) ResourceFactory.newUrlResource(url);
        resource.setBasicAuthentication("enabled");
        resource.setUsername("guest");
        resource.setPassword("guest");        
        kagent.applyChangeSet(resource);
 
        return kagent.getKnowledgeBase();
    }


I figured this out by sending it through the eclipse tcp/ip monitor proxy. And it looks like it is indeed getting the binary package. But I think the code is expecting a changeset, not a binary package. (Which is why I get the "ERROR drools.xml.ExtensibleXmlParser.fatalError  - (null: 1, 1): Content is not allowed in prolog." - because it's expecting a changeset.xml, not the binary package.) 

Which makes since as I am calling: kagent.applyChangeSet(resource);

So I think I'm almost there, I have to do something with the binary package, not try to apply it as a changeset...
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/780425#780425]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121206/c5aeb055/attachment.html 


More information about the jboss-user mailing list