IsExecutable
I was hoping that Activity would have anIsExecutable property on it, but it does not. Is there another way to determine if a single activity is executable? Or could anIsExecutable property be added to the Activity class?
I was hoping that Activity would have anIsExecutable property on it, but it does not. Is there another way to determine if a single activity is executable? Or could anIsExecutable property be added to the Activity class?
Thanks for the feedback. I've logged your suggestion for the property back with our product team. I could certainly see how having the property on the activity level would be useful. In your case, what scenario would be enabled by having this property?
Thanks,
Arjun
The original reason was for validation. We wanted to make a composite activity that contained several sub-branches (sequences). One of the branches was special in that we wanted to make sure it was always executable.
I realized yesterday that the current logic for determining if a branch is executable or not doesn't test for sub-activities. I suppose another question is: If a child is a composite activity that does not itself contain any activities, should it truely be considered executable?
Regards,
Jared
I guess what we wanted to know in our case was if the special branch was executable and actually had work to be performed. I don't know if PerformsWork makes sense as a property
, but I still think that at least IsExecutable should be there.
Regards,
Jared
Couldn't you examine the ExecutableActivities.Count of each child activity? If the count was equal to zero, you would know the branch is empty.
Arjun
It is easy for me to determine if a child activity contains other executable activities. It's also easy for me to determine if the child activity is commented out. But what other factors go into determineing if a child is executable? It seems there is more logic hidden in the ExecutableActivities property, and I feel that logic should be contained in a property on the activity itself.
As it is currently designed, if I want to determine if a child activity is executable I would have to do:
if (this.ExecutableActivities.Contains(child)) { ... } |
But this is very expensive because it requires generating the collection and then walking the collection looking for a particular instance. If each activity had an IsExecutable property, we could circumvent such work. It would also make your own internal logic for building the collection much simpler.