States on Custom Tables (this is embarrassing)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2015 10:24 AM
So I have a custom task type with several states, 3 of which are considered "Closed".
Since all my workers and customers work off of Task lists, I opted to modify choices for Task.State rather than make a custom table based state.
Ok, so I created all my state choices and the three "Closed" ones have values of 50,60,70 respectively. I did a dictionary override for my custom table and listed them in the close_states attributes (per this wiki page)
My problem is no matter which of the ending states I pick, the system interrupts and sets the State value to 3.
Suspecting the "Task Active State Management" business rule was to blame, I deactivated it, and sure enough, I could pick whatever closure state I wanted unmolested.
My problem is, I can't figure out how or why Task Active State Management is determining that I want a default State of 3 on inactivation.
Anyone run into this kind of thing before?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2015 11:38 AM
So does this look like a viable work around?
I'm not setting ANY close_states in the attributes of my custom table dictionary override on state (thus ensuring that "Task Active State Manager" doesn't fire). I then create 2 business rules on my custom task table.
- 1 rule looks for change of state where state is one of my perceived closure states -> set active to false
- 1 rule looks for change of state where state is one of my perceived open states -> set active to true
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2015 11:50 AM
Why use two rules? You could just look for change of state where it's one of your specific states, and then set active to true or false depending on the state value.
Make sure to run this after the Task Active State Management rule, and before any other rules that act based on the active flag. Task Active State Management is "before" with an order of "50", so maybe you want your order to be 51.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2015 11:58 AM
$%&# ME! It's still setting the state to Closed Complete (value 3)
Verified with Detailed Business Rule Debug that Task Closer is still running.
EDIT: And not only that, but in the list view its displaying really weird state choices that are in neither Task nor my custom table ("Awaiting Problem"?)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2015 12:07 PM
Ah, that's my fault. Bad advice from me. I assumed the problem was that the active flag was turning false (which happens in Task Active State Management). but the problem is later, in task closer.
Set your rule to Order 1000. task closer is order 900, and thus your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-23-2015 12:13 PM
Probably should have been able to guess that myself. Thanks