piątek, 4 stycznia 2013

jBPM web designer runs on VFS

As part of efforts for jBPM and Drools version 6.0 web designer is going through quite few enhancements too. One of the major features is to provide flexible mechanism to persist modeled processes (and other assets that relate to them such as forms, process image, etc) a.k.a assets even without being embedded in Drools Guvnor.
So let's start with the main part here - what does it mean flexible mechanism to persists assets? To answers this let's look at what is currently (jBPM 5.x) available:

  • designer by default runs in embedded mode inside Drools Guvnor
  • designer stores all assets inside Drools Guvnor JCR repository
  • designer can run in standalone mode but only as modeling tool without capabilities to store assets
So as listed above there is only one option to persist assets - inside Drools Guvnor. In most of the cases this is good enough or even desired but there are quite few situation where modeling capabilities are required to be delivered with the custom application and including complete Drools Guvnor could be too much. 
That leads us to the flexible mechanism implemented - designer was equipped with Repository interface that is considered entry point to interact with underlying storage. Designer by default comes with Virtual File System based repository that provides:
  • default implementation that supports 
    • simple (local) file system repository
    • git based repository
  • allows for pluggable VFS provider implementations
  • is based on standards - java NIO2
Extensions to what is delivered out of the box can be done in one of the following ways:
  1. if VFS based repository is not what user needs an alternative implementation of the Repository interface can be provided, e.g data base
  2. if VFS is what user is looking for but neither local file system nor git is the right implementation additional providers can be developed
Let's look little bit deeper into what these new features are and how users will benefit from them. 

1. It's based on Java 7 NIO2


VFS support provides is based on Java SE 7 NIO2 but does not require Java 7 to run as it comes with backport implementation of selected parts of NIO2 that are required

2. Different providers for Virtual File System


The simplest option is to use designer with local file system storage that will simply utilize file system on which designer is running. As most likely it will provide the best performance it leaves user with rather limited options when it comes to clustering, distributed environments or backups.

Next option that personally would recommend is to utilize GIT as underlying storage. People that works with GIT in their software development projects will most likely notice quite few advantages as in the end process definitions are more like source code that can be versioned, developed in parallel (branching) and included in some sort of release cycle.

3. Save process directly in designer editor



Designer now allows users to save process directly from the editor which will store the svg process content as well with just one click!




4. Repository menu


With the repository designer provides a simple UI menu to navigate through the repository and perform basic operations such as:

  • open processes in designer editor
  • create assets and directories
  • copy/move assets
  • delete assets and directories
  • preview files

This menu is intended to be seen as basic file system browser utilized more in a standalone mode as when integrated with jBPM console-ng, guvnor-ng (UberFire) more advanced options will be delivered in this area.

5. Simpler integration with jBPM console and Drools Guvnor


Both jBPM console and Drools Guvnor are going to be "refreshed" for version 6.0 and thus integration between these components and designer will be simplified as they all will be unified on the repository level, meaning single repository can be shared across all these three components.



That will be all for a brief introduction but certainly not all in this topic. Expect more to come as soon as preview will be released on how to configure different repositories and more updates on git based repository on how to make best of it.

Your comments are more than welcome as they can help to make designer best modeling tool out there :)

Known limitation

Currently git based repository does not support move of assets and directories as atomic operation which means that preferred is to copy first and then delete.


12 komentarzy:

  1. Great job! Do you think that a MongoDB adapter could be a valid alternative? It would allow to store diagrams as json and to make advanced search.

    OdpowiedzUsuń
  2. thanks, and yes, that was the intention by introducing this Repository so people can implement new ways of storing assets that suits their needs and hopefully contribute that :)

    If you are interested in implementing that let us know on #jbpm channel as we would be more than happy to help out.

    OdpowiedzUsuń
    Odpowiedzi
    1. We'll think about it for sure. Now with the latest features and architecture, JBpm Designer is becoming a valid alternative to Oryx for us. We are in progress of dynamically converting all ARIS models and diagrams into Oryx format and we would like to store both diagrams and stencilsets into a repository: MongoDB can be a nice choice. If we'll build it we'll give it to the community for sure.

      Usuń
  3. The native representation of your business process model in Designer is JSON. We then transform it to BPMN2 on save operations. I think this would make it very suitable for a MongoDB adapter.

    OdpowiedzUsuń
  4. Is there a standalone JBoss AS distribution loaded only with tne new VFS based web designer?

    OdpowiedzUsuń
  5. currently you could take the source of https://github.com/droolsjbpm/jbpm-designer/tree/storage-for-designer and build it it will generate Jboss AS7 war that can be deployed. Please not that by default it tries to create repository inside /tmp so if you run on windows or want to change the location you need to edit jbpm.xml file inside designer/profiles

    OdpowiedzUsuń
  6. Thank you very much. I agreee with your article, this really helped me. I appreciate your help. Thanks a lot. Good website.
    thue dj tai ha noi

    OdpowiedzUsuń
  7. I thanks for the info.
    I want the standalone designer to be used with my personalized DB.
    I did the same with guvnor integrated designer, but i want it to be done with standalone designer.

    Docs/help Needed

    Cheers
    Naman Shah

    OdpowiedzUsuń
  8. there is no db based repository implementation in designer by default so that would mean you need to implement it yourself - to be completely aligned with what is there you need to work on VFS provider backed by db instead of file system or git (these two are out of the box delivered). Take a look at:https://github.com/droolsjbpm/kie-commons/tree/master/kie-nio2-backport/kie-nio2-impls there you can find currently available implementations that are the best source of knowledge at the moment.

    OdpowiedzUsuń
  9. Thanks..
    Will surely look out for the link.
    and i tried to dig the project, according to the code i found i can even use the Repository and move ahead with some changes.
    Lets see..
    Will check the things for the best available soultions.
    Cheers
    naman

    OdpowiedzUsuń
  10. Hi Maciej, I am running jbpm standalone process designer but I have no clue how can I configure standalone designer to use same git repo and maven as jbpm-full-installation.
    I am running both jbpm-full and standalone designer in same server.

    I already have some repository created with jbpm-full and I want to use the same in standalone designer.

    OdpowiedzUsuń