Bug 1124707 - Element of current iteration does not get updated in the Multi-Instance sub process
Summary: Element of current iteration does not get updated in the Multi-Instance sub p...
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: jBPM Designer
Version: 6.0.2
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER1
: ---
Assignee: Tihomir Surdilovic
QA Contact: Kirill Gaevskii
URL:
Whiteboard:
Depends On:
Blocks: 1115481
TreeView+ depends on / blocked
 
Reported: 2014-07-30 07:08 UTC by Anton Giertli
Modified: 2018-12-06 17:31 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Fixed Issue Summary: A process definition error occurred when updating multiple instance subprocesses because the multiple instance outputs needed to be defined; however, Designer did not provide the ability to define output variables for multiple instance subprocesses. Accordingly, whenever the processes were completed, the updated values were lost and reverted back to the original values. This has been fixed by allowing the definition of multiple instance outputs.
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)
[0] git repository (589.71 KB, application/zip)
2014-07-30 07:08 UTC, Anton Giertli
no flags Details
Updated parent process with output of multi instance (42.63 KB, text/plain)
2014-08-01 11:25 UTC, Maciej Swiderski
no flags Details
[0] human-task-multi-assets (155.05 KB, application/zip)
2014-08-01 13:06 UTC, Anton Giertli
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1123855 None None None Never

Internal Links: 1123855

Description Anton Giertli 2014-07-30 07:08:16 UTC
Created attachment 922437 [details]
[0] git repository

Description of problem:

Let's my Multi-Instance sub process is iterating over List<Person> and I am storing the element of the current iteration in the variable called 'myPerson'.

In multi-instance sub process, there will be new process created, which will include Human Task with the Data Input which will be mapped by 'myPerson'.

When you change whatever value of this object it will be updated once the Human Task is completed. 

However, when the the whole multi-instance sub process will be completed (after all sub processes are completed) the updated value is lost and we are back to the 'original' value.

Version-Release number of selected component (if applicable):
bpm 6.0.2

How reproducible:
always

Steps to Reproduce:
1. Clone the git repository, build the project
2. In CustChildApproval process you need to change "actor" value of the Human Task
3. Build the project
4. Start the InvoiceProcessing-CustomerName process
5. Fill in the following input field 'ccOwners (_Application)' with the comma separated list of values, for example "actor1,actor2,actor3"

-- size of the list will determine number of instance of the the multi-instance sub process

6. Complete *all* human tasks, and in each, change the value  of ccOwner, for example, from actor1 to actor1-changed

7. Observe the output



Actual results:

Element of the iteration of multi-instance sub process is not updated once the multi-instance sub process joins the main process execution

Expected results:
Element of the iteration of multi-instance sub process is updated.


Additional info:
This may be related to the https://bugzilla.redhat.com/show_bug.cgi?id=1123855

As the assignment section of the reusable sub process in the multi-instance subprocess was created using 'hacks'.

Comment 2 Anton Giertli 2014-07-30 07:14:05 UTC
I can observe the following output:

//these are the original values
08:45:32,738 INFO  [stdout] (http-localhost/127.0.0.1:8080-14) CC Owners: anton1,anton2,anton3

//these are the values outputted from the On Exit Actions from the ReUsable sub process, which is part of the MultiInstance sub process
08:46:06,851 INFO  [stdout] (http-localhost/127.0.0.1:8080-11) *** Cost Centre  [ccOwner: anton1-changed, status: ]
08:46:22,356 INFO  [stdout] (http-localhost/127.0.0.1:8080-11) *** Cost Centre  [ccOwner: anton2-changed, status: ]
08:46:32,768 INFO  [stdout] (http-localhost/127.0.0.1:8080-19) *** Cost Centre  [ccOwner: anton3-changed, status: ]


But then it seems like to mapping back to the process variable does not work

//these are the values outputted from the script task which is executed once the multi-instance sub process completed
08:46:32,771 INFO  [stdout] (http-localhost/127.0.0.1:8080-19) Aggregating responses...
08:46:32,772 INFO  [stdout] (http-localhost/127.0.0.1:8080-19) *** Invoice Remark of  [ccOwner: anton1, status: null]
08:46:32,772 INFO  [stdout] (http-localhost/127.0.0.1:8080-19) *** Invoice Remark of  [ccOwner: anton2, status: null]
08:46:32,772 INFO  [stdout] (http-localhost/127.0.0.1:8080-19) *** Invoice Remark of  [ccOwner: anton3, status: null]

Comment 5 Maciej Swiderski 2014-08-01 11:24:35 UTC
The problem here is actually with process definition itself as to be able to update process level variable (remarks) multi instance output needs to be defined. While working with this case it turned out that designer is missing possibility to define that output variable for multi instance subprocess (while it's available as multi instance on a task).

Note: when working with multi instance a good practice is to distinguish between input and output on process variable level so I suggest to include:
- multi instance input as remarks
- multi instance output as remarksOut

even though engine will process if both input and output will be referencing same variable but it will add elements to it so in the end both input and output elements will be stored in that collection.

So depending on the requirements I see two workarounds until support for output of multi instance on subprocess will be added:
1. use regular task with multi instance capabilities e.g. user task as it allows to define input and output of multi instance
2. make manually modification to the bpmn2 to include required output elements (see attached process that has all the pieces available) - please note that when modifying the bpmn2 manually it won't be editable in designer although it will be executable

so for the second workaround user would need to use git integration to push process (parent process) to business central and then directly build and deploy it.

Comment 6 Maciej Swiderski 2014-08-01 11:25:32 UTC
Created attachment 923234 [details]
Updated parent process with output of multi instance

Comment 7 Anton Giertli 2014-08-01 13:06:24 UTC
Created attachment 923302 [details]
[0] human-task-multi-assets

Comment 13 Tomas Livora 2014-08-26 16:00:29 UTC
Verified on BPMS 6.0.3 ER1

I am also changing component to jBPM Designer, because the previous one (jBPM Core) might be confusing for us in the future.


Note You need to log in before you can comment on or make changes to this bug.