DFC Lifecycle Promotion Failure at End of Lifecycle

Finding issues like the following is one of the amusing things about navigating APIs.  In DFC 6.5SP1 IDfSysObject.canPromote() will return true for an object that is at the end of it’s lifecycle.

Wait.  That isn’t right!  Yet, that is what happens.

It appears to get DfPolicy.canPromot() to do the real task.  There’s clearly a bug in how that computes the subsequent state and identifies a terminal state.

But there is a workaround:  IDfSysObject.getNextStateName().  The following test proved to work in all of the situations I needed it to, including not attempting to promote a object already at the end of its lifecycle:

if (!sysObj.canPromote() ||
     sysObj.getNextStateName() == null) {
   ... yell about not being able to promote

And that’s that.


About John

I write about technology interests, cooking, and my own writing (sci-fi and fantasy... sometimes both). I try to keep things light, but sometimes I get side-tracked on an issue that I feel strongly about. No offense is meant, I'm just like any other person who feels strongly about something when I write. View all posts by John

Comments are disabled.

%d bloggers like this: