<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Re: Trying to set ActorId in On Entry Action - work item is null
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/jemmerling">jemmerling</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/648926#648926">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Sorry, I believe the terminology can cause some confusion.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>What I am trying for is (in the scenario given) 2 tasks and 3 task instances in this case. I will use letters to designate tasks and numbers to designate task instances.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Also I cannot see a strong distinction between a node and a task other than to argue that not all nodes are tasks. So when I say (human) task I could also mean node. When I say task instance I could also mean node instance. Also I will confess that I am not entirely certain just what a work item is as opposed to a task or a node instance. I suppose I will only understand fully when I have looked at enough code (which so far has been a fairly productive way of learning).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>So task A and task B are as you described them (worker/approver) although the real-world problem I want to address is more complicated. Both have GroupId specified in their static definition and neither has ActorId specified (in fact in our model, we would never want to have to think about a given individual).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>So the scenario is:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>1.) Task A -&gt; Task Instance 1: Actor 1 (member of Task A's group) claims this task instance, works on it, and completes it.</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ..also Actor 1's ID is saved as a process variable so we know who completed this task instance</p><p>2.) Task B -&gt; Task Instance 2: Actor 2 (member of Task B's group) claims this and "rejects" it by not setting an "approved" variable (which is a process variable).</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ..so the sequence branches at an XOR gateway which in the BPMN model leads back to Task A</p><p>3.) Task A -&gt; Task Instance 3: Actor 1 now sees that the task has been assigned to them immediately, they will not need to claim it; it is already reserved for them to work on.</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ..Steps 2.) and 3.) could repeat an arbitrary number of times but will eventually lead to a hypothetical step 4.) which should involve Task C or be an end node.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This same pattern will in reality occur 4 or more times in the real-life business process so I don't want to have to define a Task A', B', etc. for every task just to allow for "rework".</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Of course, an admininstrator would always have the ability to reassign any task instance to a different actor, but of course that would require said administrator's intervention.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>However, suppose I did go with the A', B'..Z' approach as you seem to be suggesting. Then I would still need to know how to assign the ActorId from a process variable. Would I use some expression such as #{variable}?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>And I would still like to know if there is a way to programmatically override the ActorId and/or GroupId specification for a task/node using either MVEL or Java, within a script node or within a entry or exit action. If you know how this would be accomplished, could you please refer me to an example!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>--JE</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><div class="mcePaste" id="_mcePaste" style="position: absolute; top: 0px; left: 0px;"></div></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/648926#648926">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>