Advice Needed: Object -Post Save processing

Advice Needed: Object -Post Save processing

Old forum URL: forums.lhotka.net/forums/t/7266.aspx


pondosinat posted on Monday, July 13, 2009

I read the CSLA 3.0 ebook and have a question about executing a workflow in the UPDATE region of a BO. I'm struggling with how to go about determining what properties were changed in my object after it has been saved. I really like the idea of having an "ifProjectClosed" check in my WF workflow but how would you implement such a check? In my case, I have an object that contains a "CoverageTerminated" date, but this object could have had a Term date set before it was saved...

My current plan is to have an extra "Coverage Terminated" date stored in the database--separate from the "Term" date visible in the UI-- that only my workflow would use for the "If" check.

dlambert replied on Monday, July 13, 2009

Have you looked at the INotifyPropertyChanged events? This might help you determine which properties have changed.

Reaction #2, though, is to step back and look at the scenario you're describing -- I'm sort of wondering if there shouldn't be an explicit "TerminateCoverage" command on your object that can focus the stuff you're talking about into a business method.

pondosinat replied on Monday, July 13, 2009

Thanks, I did create a "TerminateCoverage" command initially but am thinking about other scenarios where employing If Else checks in a workflow as it seems to be a powerful concept for handling complex workflow scenarious.

I discovered that I can leverage our db audit tables that are wired up to "update" triggers in order to grab whatever recently changed info we might need. For now, thought, more focused command objects as you mentioned seem to be the right fit for this.

Thanks again.

Copyright (c) Marimer LLC