[jboss-user] [jBPM Users] - [jBPM4] Manually updating DB Entries

freiburger do-not-reply at jboss.com
Mon Oct 19 06:24:35 EDT 2009


Hi,

I'm using jBPM 4.1 in a standalone application with the default setup, having switched to MySQL as DB. I need to update some values in the jBPM DB manually and was asking myself what the most convenient and conformant way would be. As I want to access the environment, I thought about doing so using a custom command like this:



  | public class UpdateDbCmd implements Command<Object> {
  | 	
  | 	private Object _entry;
  | 
  | 	public UpdateDbCmd(Object entry) {
  | 		_entry = entry;
  | 	}
  | 	
  | 	public Object execute(Environment environment) throws Exception {
  | 		DbSession session = (DbSession) environment.get(DbSession.class);
  | // [...]update the entry
  | 		return null;
  | 	}
  | 
  | }
  | 

Then I try to execute the Command like this:


  | ProcessEngine eng = new Configuration().buildProcessEngine();
  | // [...]
  | eng.execute(new UpdateDbCmd(someEntry));
  | 

This does result in a NullPointerException as the userCommandService is not defined in the configuration. Unfortunately I haven't found information about how to configure the wire bindings correctly. Could anyone please point me in the right direction or suggest another way how to update db entries manually.

Thanks

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4261011#4261011

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4261011



More information about the jboss-user mailing list