Wednesday, October 21, 2009

How do I know if I’m inside a Task Flow or not?

If for some esoteric reason you need to know if you're inside a Task Flow or not, here's the snippet for doing so from a backing bean

ViewPortContext ctx = ControllerContext.getInstance().getCurrentViewPort();
TaskFlowId id = ctx.getTaskFlowContext().getTaskFlowId();
if (id != null){
System.out.println("BOUNDED taskflow.");
} else {
System.out.println("UN-BOUNDED taskflow.");

ControllerContext is also accessible through EL, so you can use the same logic in our JSF/ADF tags.

No comments:

Post a Comment