we had a similar issue and we solved it as following:
First, we tried to replace the DeploymentService with the VFSDeploymentService (Chapter 20. Integration):
@Vfs - VFSDeploymentDService that allows to deploy assets directly from VFS (Virtual File System) that is provided by UberFire framework. Due to that fact VFSDeploymentService and VFSDeploymentUnit are not bundled with jbpm core modules but with jbpm-console-ng modules.
Unfortunately this did not work, mainly because of some OSGI stuff :/
So our second solution is that:
Assuming you have the compiled KJAR from jbpm-console (or build the jar yourself with bpmn2-files from filesystem, donf forget the kmodule.xml, kie-deployment-descriptor.xml etc) saved in a filesystem / some server, you have to create your own modified version of Deploymentservice.
We basically copied the existing one and replaced the Maven loader with our own:
// MavenRepository repository = getMavenRepository();
In this method you just have to add your KJar to the internal repository like so:
URL url = new URL("file:///somepathOrUrl");
URLConnection urlConnection = null;
urlConnection = url.openConnection();
InputStream processDefinitions = urlConnection.getInputStream();
Resource res = ks.getResources().newInputStreamResource(processDefinitions);
Instead of using Inputstreams, one also can use newFileSystemResource, newUrlResource or whatever you like.
Thank your very much, Dan. It is very helpful.
So in runtime, the Git repository is not necessary if you don't use the kie-wb to draw the diagram, correct?
It is possible not to use neither the git repo nor the jbpm-console at runtime, as long as you get your bpmn2-file's content somehow.