-
Enhancement
-
Resolution: Unresolved
-
Major
-
None
-
jBPM 6.0.1.Final
Now there is no simple way how to create an ad-hoc task using REST or JMS. It is only possible to do this using AddTaskCommand which takes Task object as a parameter. To create an instance of Task class you have to use TaskImpl class that is "internal" and is not part of the jBPM 6 API. You also have to initialize a lot of its attributes (and their attributes recursively) to be able to successfully create a new ad-hoc task.
A new contructor of AddTaskCommand should be added which will take only some basic information that is needed to create an ad-hoc task as parameters. They might be similar to those used in addTask method of QuickNewTaskPresenter in jBPM Console project (https://github.com/droolsjbpm/jbpm-console-ng/blob/d5cf9885c6958008be0cdf200e85c49a07ec48cd/jbpm-console-ng-human-tasks/jbpm-console-ng-human-tasks-client/src/main/java/org/jbpm/console/ng/ht/client/editors/quicknewtask/QuickNewTaskPresenter.java#L116).
It should be considered not only adding a new constructor of AddTaskCommand which will simplify the creation of an ad-hoc task but also creating a new method with similar parameters directly in the TaskService.