Order of evaluating line rules

  • 30 January 2007
  • 5 replies
  • 0 views

Badge +8
I have several linerules coming off of one activity. Is there any way to specify the order in which to evaluate them?

5 replies

Badge +13
What's the usage case of having to evaluate in specific order?
Badge +8
Peter,

I have 3 lines coming out of an activity.

Line 1 goes to the next activity in the workflow, and its linerule says 'status = approved', where status is the status of the activity just completed.

Line 2 goes to a "Send For Review" activity, and the linerule says 'status <> approved' and 'Delegate = false'.

Line 3 is a "Delegate" line going back to the activity, and the linerule says 'status <> approved' and 'delegate = true'.

The problem is that when I do delegate, it evaluates line 3 prior to line 2 and restarts the activity. The dest rule of the activity resets the status field, and then line2 is evaluated. Delegate is now false, so the SendForReview activity also starts, even though it should not.

I'd like to specify that Line 2 gets evaluated before line 3.

By the way, I'm calling them Line 1, 2, and 3 because that is the order that I added them.

This app uses an InfoPath form, and the fields I refer to above are xml fields in the schema which are set by button rules on the form.
Badge +13
Line2 should not be re-evaluated if the user has not performed additional action? Unless InfoPath forms (which I don't use) works different than default client rules where we need to use .Finish to start evaluate the routing lines.

Can't you take out the code that clears the status in dest rule and set the Delegate=true/false in your Infopath form?
Badge +8
Looking at the console window, the first linerule that is evaluated after this activity's succeedingrule is true is Line1. That evaluates to false.

The next one is line 3, which evaluates true. Then the activity restarts (in the dest rule the 'delegated to' user is added because delegate is true). But then I have to reset delegate to false so that when the new activity is completed it doesn't delegate again. I see startrule = complete, destuser added, destrule = complete, and finally Line 2 is evaluated. Since the delegated flag is reset, this one evaluates true as well.
Badge +8
Hi Steve,

I recommend that you use Activity Level Data Fields for your flags rather than Process Level Data Fields. Activity level data fields can only be manipulated within the instance of the Activity so even if line 3 evaluates to true the new instance of the Activity that is started will not be able to change how the previous instance Line 2 evaluates.

I hope this helps.

-Eric

Reply