Permalink
Browse files

Merge pull request #70 from mswiderski/BZ-802741

BZ802741 - Skipping tasks in jBPM Console
  • Loading branch information...
2 parents 85c7e93 + 78893c0 commit 4088211d6e20d8f58fa6b19d08aec9f16b05cf5a @krisv krisv committed Apr 3, 2012
@@ -199,8 +199,12 @@ public void completeTask(long taskId, Map data, String userId) {
@SuppressWarnings("unchecked")
public void completeTask(long taskId, String outcome, Map data, String userId) {
- data.put("outcome", outcome);
- completeTask(taskId, data, userId);
+ if ("jbpm_skip_task".equalsIgnoreCase(outcome)) {
+ skipTask(taskId, userId);
+ } else {
+ data.put("outcome", outcome);
+ completeTask(taskId, data, userId);
+ }
}
public void releaseTask(long taskId, String userId) {
@@ -269,5 +273,18 @@ public void releaseTask(long taskId, String userId) {
}
return result;
}
+
+ public void skipTask(long taskId, String userId) {
+ connect();
+ if ("Mina".equals(TASK_SERVICE_STRATEGY)) {
+ BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+
+ client.skip(taskId, userId, responseHandler);
+ responseHandler.waitTillDone(5000);
+ } else if ("Local".equals(TASK_SERVICE_STRATEGY)) {
+ service.skip(taskId, userId);
+ }
+
+ }
}
@@ -96,7 +96,7 @@ public static TaskRef task(TaskSummary task) {
task.getProcessId() == null ? "" : task.getProcessId(),
task.getName(),
task.getActualOwner() == null ? null : task.getActualOwner().getId(),
- false,
+ !task.isSkipable(),
false);
}
@@ -113,7 +113,7 @@ public static TaskRef task(Task task) {
task.getTaskData().getProcessId() == null ? "" : task.getTaskData().getProcessId(),
name,
task.getTaskData().getActualOwner() == null ? null : task.getTaskData().getActualOwner().getId(),
- false,
+ !task.getTaskData().isSkipable(),
false);
}

0 comments on commit 4088211

Please sign in to comment.