Component component = valueForKey("component");
Component component = (Component)valueForKey("component");
    public WOComponent fileBug() {        EOEntity entity=EOModelGroup.defaultGroup().entityNamed("Bug");        EOClassDescription aClassDesc=entity.classDescriptionForInstances();        EOEditingContext peerContext=new EOEditingContext(object.editingContext().parentObjectStore());        EOEnterpriseObject localObject=EOUtilities.localInstanceOfObject(peerContext,object);        localObject.addObjectToBothSidesOfRelationshipWithKey(TestItemState.BUG,"state");        EOEnterpriseObject aNewEO=(EOEnterpriseObject)aClassDesc.createInstanceWithEditingContext(peerContext, null);        peerContext.insertObject(aNewEO);        String entityName = object.entityName();        localObject.addObjectToBothSidesOfRelationshipWithKey(aNewEO,"bugs");        EOEnterpriseObject localUser=EOUtilities.localInstanceOfObject(aNewEO.editingContext(),                                                                       ((Session)session()).getUser());        aNewEO.addObjectToBothSidesOfRelationshipWithKey(localUser,"originator");        aNewEO.addObjectToBothSidesOfRelationshipWithKey((EOEnterpriseObject)localObject.valueForKey("component"),"component");        String pKey=object.primaryKey();        aNewEO.takeValueForKey("[From Test #"+pKey+"]","textDescription");        //aNewEO.takeValueForKey("[From Test #"+pKey+"]","subject");                EditPageInterface epi=(EditPageInterface)D2W.factory().pageForConfigurationNamed("EditNewBug",session());        epi.setObject(aNewEO);        epi.setNextPage(context().page());        /*        if(0)     {            EOEditingContext peer = new EOEditingContext(object.editingContext().parentObjectStore());            TestItem testItem = (TestItem)EOUtilities.localInstanceOfObject(peer,object);            People user = (People)EOUtilities.localInstanceOfObject(peer,((Session)session()).getUser());            Component component = valueForKey("component");            Bug bug = new Bug();            peer.insertObject(bug);            testItem.setState(TestItem.BUG_STATE);            bug.setTextDescription("[From Test #"testItem.primaryKey()+"]");            bug.addtoBothSidesOfTestItems(testItem);            bug.addtoBothSidesOfOriginator(user);            bug.addtoBothSidesOfComponents(component);            EditPageInterface epi=(EditPageInterface)D2W.factory().pageForConfigurationNamed("EditNewBug",session());            epi.setObject(bug);            epi.setNextPage(context().page());            return (WOComponent)epi;        }*/                return (WOComponent)epi;            }