Information Technology Reference
In-Depth Information
public void TaskModelFactory {
public Task newTask();
public TaskData newTaskData();
public Content newContent();
//omitted methods
}
The TaskModelFactory class has an implementation called JPATaskModelFact-
ory that defines JPA-based implementations for the interfaces defined in the model. What
the task model provider does is that it discovers the JPATaskModelFactory imple-
mentation through Java's ServiceLoader and uses it to create its own components.
Therefore, you can configure the actual TaskModelFactory class that your project
will use by adding a file called META-INF/services/
org.kie.internal.task.api.TaskModelFactory , with the actual name of
the implementation in it. You can see an example of this configuration in the human-
task-extension-points project in the code section of this topic, which just defines
the default implementation class for the interface. If any of its methods is constructed to
return a different type of object, it will replace the actual JPA implementation by the one
you need. The only thing you will have to be careful is to make sure you replace the
classes that will be persisted in the META-INF/persistence.xml file as well as in
the newly registered implementation of the TaskModelFactory interface.
Search WWH ::




Custom Search