I think you answered your own question in the following:
but I can imagine that users will want to see (in a single view) the readings from the same item has it has progressed from entry to exit of the process
But a step back first, it looks like I have to recreate the variable all over again, on every task.
It looks like you are creating the variable on the task and not in the pool, if you created the variable in the pool it would be available on every task (click on pool and then define the variable).
The thing to note here though is that by defining the variable on the task, the variable is ONLY available to the task and not to other tasks, hence the need to define the variable on every task. Variables on the pool can be used in multiple tasks.
If you use the same variable in task one and task two, you should be aware that you will over write the contents of the variable (if you change the value) which means you can’t then show a form that shows users the readings as they have progressed…which as you said users might want to do at the end…good observation by the way.
Here is what I would do:
Note this is a simple example using a fixed number of variables, you could use a Java list to do this better.
in the pool define 6 variables
reading_1 to reading_6
Create 6 tasks and assign reading_1 to task 1, reading_2 to task 2 etc.
and create a final task Summary, that shows all the variables (read only) on one screen.
Now then, normally a process will go ahead automatically - 6 time a day - etc? how do you make the process work that way? Add a timer, I’ll leave that to you to discover.
But here’s where you design magic comes to the fore.
You’re taking measures, but for what purposes? There must be a reason, well I suspect it is to do with tolerances. For example 1, 1.1, 1, 0.9, 1, 1.1, 1, 0.9, 1, 1.1, 1, 0.9 etc is OK, but what happens when the measure goes to 0.8 instead of 0.9 in the second instance?
This could be an exception, do the following:
In task 2, add the variable reading_1 (read only so it can’t be changed, call it previous reading or something relevant) so when the user enters reading_2 they know what it says and they can do a visual check, but on the task output operation compute the difference between reading_1 and reading_2 (groovy script) and in a gateway test the tolerance between tasks(defined as a global variable if greater than tolerance then (in parallel) start an exception task as well as the next reading task, task 3. The exception task could be as simple as a single form to show there is a tolerance error, to a full blown email, set off alarms etc. alert that the nuclear power station is going into China Syndrome mode…(look it up if necessary)
Then repeat for steps 3-6. But and I’m hoping here you recognize the flaw here, that only measures tolerances for the 6 measures, every 4 hours of the day, what about the following day? Shouldn’t the first new day reading be tested against the previous days last reading, well yes it should…
So how do we do this? Well we save the reading to a database as business data, with a date and time of the reading…so in task 6 we save the data to database and in task 1 of the next days process we just read the last value in the database and use that then we can use that as our previous value. Yeh, full testing of tolerances…day in day out.
But isn’t that what we’re doing with steps 2-6 as well? Yes it is, so to normalize the process (using a database term, again look it up if necessary) we normalize the process to something like this:
define pool variables:
tolerance_allowed
previous_reading
new_reading
difference
step1 - script get tolerance_allowed and previous reading from database
step2 - Human task, get new reading, but also show previous reading and tolerance allowed (both read only)
create output operation is
difference = absolute value(new_reading-previous_reading)
step3 - script you will always want to save the new data, so save it to database
step4 - script you will always want to restart the process so start the process again (a new case) with the timer (or whatever mechanism you are using)
gateway - if difference > tolerance then execute exception processing else execute end process
That’s the easy bit over and done…just getting the readings, checking tolerances, and exception processing.
Having a screen that shows previous readings is easy to add as well, just read the last 6 values from database and show then in a table…or better yet, have a drop down list last 6 values, last 12 values, last 3 days, last 7 days etc. and show the data on a graph! Yahoo! People love to see numbers in a graph.
This is where management become a pain because they like what you’ve done so well that you will get requests for more data/work/information etc.
Right must get on. I’ve own work to do…
regards and hope this helps
Seán