+ // define the next tag after given one in the data tree to insert SObject
+ SALOMEDS::SObject_wrap curObj, objAfter;
+ if ( theFatherObject->GetLastChildTag() > theTag && theTag > 0 )
+ {
+ SALOMEDS::UseCaseIterator_wrap
+ anUseCaseIter = useCaseBuilder->GetUseCaseIterator(theFatherObject);
+ for ( ; anUseCaseIter->More(); anUseCaseIter->Next() ) {
+ curObj = anUseCaseIter->Value();
+ if ( curObj->Tag() > theTag ) {
+ objAfter = curObj;
+ break;
+ }
+ }
+ }
+ if ( !CORBA::is_nil( objAfter ))