Pick extends AbstractActivity<TPick> implements IPick, IContainer { @Override IBpelObject getObjectForNativeObject(Object nativeObject) { if (nativeObject == getNativeActivity()) { return this; } for (OnMessage m : onMessages) { IBpelObject o = m.getObjectForNativeObject(nativeObject); if (o != null) { return o; } } for (OnAlarm a : onAlarms) { IBpelObject o = a.getObjectForNativeObject(nativeObject); if (o != null) { return o; } } return null; } Pick(TPick wrappedPick, IContainer parent); boolean isBasicActivity(); @Override void visit(IVisitor v); void setCreateInstance(boolean b); boolean isCreateInstance(); List<? extends IOnMessage> getOnMessages(); List<? extends IOnAlarm> getOnAlarms(); OnMessage addOnMessage(); OnAlarm addOnAlarm(); @Override IScope wrapActivityInNewScope(IActivity childActivity); @Override void unregister(AbstractActivity<?> a); @Override ISequence wrapActivityInNewSequence(IActivity childActivity);  }
@Test public void testGetObjectForNativeObject() throws Exception { assertSame(pick, pick.getObjectForNativeObject(nativePick)); assertSame(onAlarm, pick.getObjectForNativeObject(nativeOnAlarm)); assertSame(onMessage, pick.getObjectForNativeObject(nativeOnMessage)); assertSame(mainActivityOnMessage, onMessage.getObjectForNativeObject(nativeMainActivityOnMessage)); assertSame(mainActivityOnMessage, pick.getObjectForNativeObject(nativeMainActivityOnMessage)); assertSame(mainActivityOnAlarm, onAlarm.getObjectForNativeObject(nativeMainActivityOnAlarm)); assertSame(mainActivityOnAlarm, pick.getObjectForNativeObject(nativeMainActivityOnAlarm)); }