[jbpm-dev] [Design of JBoss jBPM] - Re: Extending jBPM, Plugging in custom IdentityService imple

shekharv do-not-reply at jboss.com
Tue Jun 23 05:33:16 EDT 2009


That is neat!
Works like a charm! 

We also are trying out another extension for jbpm from our end. This is similar to what jbpm3 had with regards to CustomTaskInstance(s). 

Use Case: Domain specific Task information to be stored in a separate table and linked up via the taskid to the jbpm Task table. Enables some custom extensions and reporting for tasks.

In jBPM4 we added a custom activity: 
<custom-task> 
Put in the binding for the same using jbpm.user.activities.xml.

Our Custom Activity simply extends the TaskActivity provided out of the box, and over rides the execute method of task creation, 

This is where we add the code to also fire off an insert into our custom table with all the information that we need to persist.

And since we need a handle to the Task ID, we cannot simple call super(execution) 
and instead we have to copy some of the code from execute in TaskActivity


  | public void execute(ActivityExecution execution) {
  |     JpdlExecution jpdlExecution = execution.getExtension(JpdlExecution.class);
  |     TaskImpl task = jpdlExecution.createTask(taskDefinition);
  | 
  |     CustomTask customTask = new CustomTask(task);
  |     customTaskDAO.create(customTask);
  | 
  |     TaskHandler taskHandler = task.getTaskHandler();
  |     boolean wait = taskHandler.executionCreateTask(task);
  |     
  |     if (wait) {
  |       execution.waitForSignal();
  |     }
  |   }
  | 

Again wondering if this is the best way to do so? How does the design of jBPM allow for solving this?

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

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



More information about the jbpm-dev mailing list