Variable scoping issue with timed event within sub process

I have indeed considered copying over the attributes from the userTask execution (to which the timer is attached) to the timer execution, and actually I found the place to implement that. However, I chose a different approach. My reasoning was that quite often, after using a multiInstanceLoopCharacteristics, you will want to bind variable values to the root execution of that iteration. So I made a custom tag like this:

<serviceTask id="serv_task"
                         flowable:expression="#{eachValue}"
                         flowable:resultVariable="subProcessVar"
                         mynamespace:useLoopScopeForResultVariable="true"/>

The “useLoopScopeForResultVariable” is slightly different to “useLocalScopeForResultVariable”: it puts the variable value on the execution for the loop, so that it can be used everywhere in executions that are child of this loop root execution. And it works quite well (except that I found this issue: ServiceTask does not read custom attribute from XML).

I would like to know more about your prototyping to fix this issue. Maybe I can align my fix to match your solution direction. Or maybe you like my solution…