Hi!
Say, I am building a business process management application. It has the following entities: issues and tasks, related to each other as 1 issue to many tasks. Both, task and issue, have their own states and the state of one may influence the state of another.
For example, both of them have "Cancelled" and "Completed" states. When I change the state of the issue to "Cancelled", all of its tasks should become "Cancelled". When I change the state of all tasks to "Completed", the issue should automatically become "Completed".
Supposing that there are quite a few states for both entities and the logic of transitions from one state to another and the dependency of states may change, are there any design patterns and/or best practices to handle that situation?