Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Vaughn,
Yes, this is doable.
Are you checking to make sure the object is actually checked out prior to attempting check it.
I almost never use method robots because they don't check if what you want to do can be done prior to attempting to do it.
try this code in an expression robot
if (primaryBusinessObject.getObject() instanceof wt.vc.wip.Workable && wt.vc.wip.WorkInProgressHelper.isCheckedOut(primaryBusinessObject.getObject())) { //Check if the object is checked out
wt.vc.wip.WorkInProgressHelper.service.checkin(primaryBusinessObject.getObject(), null); //Check it in
}
Hope thie helps
DAX, or anyone else.
Have you used the same code in CN Task wf as well as the Promotion Request?
In Reply to Vaughn McDaniel:
DAX,
This is exactly what I was looking for, thanks!
-Vaughn
Yay! I did it!
Here is the Change Task version:
ensure all objects are checked in before completing your task.");
throw new wt.workflow.engine.FailedTransitionException ( pe );
}
}
Boo, I didn't do it! 😞
At runtime this throws an error.
Does anyone know if this part of the code is even applicable to the Change Activity?
wt.vc.wip.WorkInProgressHelper.isCheckedOut((wt.vc.wip.Workable)obj);
If not what isa correlating check a CA needs?
Thanks!
In Reply to Vaughn McDaniel:
Yay! I did it!
Here is the Change Task version:
ensure all objects are checked in before completing your task.");
throw new wt.workflow.engine.FailedTransitionException ( pe );
}
}