Skip to main content
1-Visitor
May 6, 2016
Question

How do I use the SetStateUtil.setObjectsState(Collection,State,boolean) method if my Collection consists of FlexObject types. The method is expecting LifecycleManaged objects types.

  • May 6, 2016
  • 0 replies
  • 774 views

I'm creating a Collection object using the code below.  The objects in the Collection are FlexObject type.  I would assume that the setObjectsState method would convert the FlexObject types to LifeCycleManaged, but it doesn't.  Do I really have to walk through the Collection and type cast each object and put it into a new Collection to use this method?

 

com.lcs.wc.placeholder.Placeholder ph = (com.lcs.wc.placeholder.Placeholder)primaryBusinessObject;

java.util.Collection col = com.lcs.wc.placeholder.PlaceholderQuery.findProductsForPlaceholder(ph);

com.lcs.wc.lifecycle.SetStateUtil.setObjectsState(col, wt.lifecycle.State.toState("ESTIMATED"), true);