[jboss-user] [jBPM] - Re: Why Uploading POJO model jar in Guvnor, case BPMN processes to exclude from list in jbpm-console? Problem!

Márton Steierlein do-not-reply at jboss.com
Tue Apr 3 03:01:47 EDT 2012


Márton Steierlein [https://community.jboss.org/people/stmarci] created the discussion

"Re: Why Uploading POJO model jar in Guvnor, case BPMN processes to exclude from list in jbpm-console? Problem!"

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

--------------------------------------------------------------
Dear Mahdi,

You have the following options:

* you use guvnor to declare a declarative model using the web interface (Create New -> Declarative model).
You can then use this as an object in your process variables (Object type). The fields are accessed using getters and setters (auto generated). They use java beans notation, so for example if you have:

boolean readonly; -> boolean isReadonly(), void setReadonly(boolean)
String designatedName; -> String getDesignatedName(), void setDesignatedName()

The problem with this is that you might have a hard time using it outside the scope of the jBPM framework. I am using the REST interface of jBPM to access the variables of a process (/gwt-console-server/rs/process/instance/<instance number>/dataset) and I don't see a way to deserialize it into a Java object. This is the reason why I'm using the following:
* Upload a POJO model jar where you can declare your own classes. The problem with this is that the server side component of the jBPM console cannot deserialize the object and silently throws a RuntimeException which you cannot see in the logs.
You can circumvent this headache by exploding your jbpm-gwt-console-server.war (unzip into a directory with the same name with the .war extension like /opt/jbpm/<jboss version>/standalone/deployments/jbpm-gwt-console-server.war/). By doing this, the hot-deploy feature gets disabled so you need to create a file with 'touch' whenever you need to redeploy your applications.

In order to make jBPM work with your custom JAR you'll need to copy it into the above mentioned directory (jbpm-gwt-console-server) into the WEB-INF/lib directory. Once you are done with that, you signal jBoss to redeploy the application (int the deployments directory)

touch jbpm-gwt-console-server.war.dodeploy

Then navigate to jbpm-console in your browser and hit ctrl+r. After that you should be able to see your processes. Remember always use the same jar in guvnor and the console-server. Don't forget to build your package and setup your imports in guvnor. 

If you have static classes, you might need to restart the entire jBPM framework (including jBoss), so I would suggest avoiding them in your models.

If you have further questions don't hesitate to contact me.

Best regards,
Márton
--------------------------------------------------------------

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

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/20120403/29759216/attachment-0001.html 


More information about the jboss-user mailing list