0 Replies Latest reply on Apr 20, 2012 6:34 AM by out sider

    Create a work item definition programmatically should be easy

    out sider Newbie

      I really can't understand how such a simple thing isn't better documented...or documented at all.


      I just want to add a new work item definition using the Rest API so it can latter be used by the user when designing the Business Process in the editor.


      My sequence is somehting like this:


      User fills form -> work item definition parameters are defined using the form data -> work item definition is added to guvnor using the rest api -> the user can then use it within the designer as a new service task.


      This seems to be quite a common thing and should be strate forward.


      For what I understood there are two ways to create the WDI...uploading a file or as a XML-ATOM. I tried the first one as I didn't see any example of the other.


      But the WDI doesn't appear in the service task list of the designer.


      What I did was writting the WDI content to a string and then send it as a byte[] stream to the POST Rest Api Asset method (simply string.getBytes()). It appears in the WDI list of the drools guvnor explorer but not in the designer.


      So what is the best way and where can I find an example of uploading a work item definition generated with user info programmatically and then use it in the designer?


      Thanks in advance