Every time I think about this I start to use a different approach - but no one ever was fine…
The complete process models the following from an address book:
- enter name of person to search for in database
- if no one was found or a new one (for example with a different birthday) should be created do so, otherwise use the one from the list
- show primary data of the person (name, address, birthday, …) and the type of the contact (family, co-worker, …)
- depending on the type of contact show specific detail fields
- at the end of the process: store the data to database, create a new person entry, if necessary
Background and the parts that are already finished:
- I want to use the Process Engine to run the model
- the “later” parts of the process “enter/change data” is already finished and implemented by form fields in multiple user tasks (depending on what the user has chosen at in the first user task two specific user tasks with detail 1 / detail 2 are run, which specific tasks are run is decided with a simple gateway)
- the last part of the process “store data” (as a service task implemented as a JavaDelegate) works fine, too (it reads the process variables from the fields and stores them to the data base)
Problem: It currently only works from the Cockpit (or with hard coded input data) as I have no good idea how to model the first user task: “choose person”.
The user can input multiple search data, change the search data, choose one of the search results or (even if there is a search result) decide to create a new entry.
How to model this? Using multiple user tasks in a sub-process, each using the same external form with an intermediate service task to read the data from database? If yes: how to show the multiple result in the form and how should the user decide which one to use?
I thought about using a single User Task which does all this in a single Java class as delegate, but even then I’m unsure where to define this Java class in the modeler… - and if I do this the process can likely not be called from the Cockpit application, could it?
I really hope to find a solution here…