JBoss Community

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

created by Zahid Ahmed in jBPM - View the full discussion

>>>>>>>>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?

 

You can either remove authentication from your guvnor or pass authentication when you call applyChangeSet(URL url). I am adding the code below.

 



UrlResource urlResource = (UrlResource)ResourceFactory.newUrlResource(

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



urlResource.setBasicAuthentication("enabled");


urlResource.setUsername("admin");


urlResource.setPassword("admin");


kagent.applyChangeSet( urlResource );

 

So here I am using applyChangeSet(URL url) instead of applyChangeSet(String filePath);

Reply to this message by going to Community

Start a new discussion in jBPM at Community