Test1Info test1Info = new Test1Info ( ) ;
Test1Info test1Info = new Test1Info ( ) ;
IBOTRelation ibot = BOTRelationFactory. getLocalInstance ( ctx) ;
IBOTMapping ibm = BOTMappingFactory. getLocalInstance ( ctx) ;
BOTMappingCollection bc = ibm. getBOTMappingCollection ( "where name = 'BE007'" ) ;
String botmaid = "" ;
if ( bc!= null && bc. size ( ) > 0 ) {
botmaid = bc. get ( 0 ) . getId ( ) . toString ( ) ;
}
createBotRelation ( ctx, test1Info, test1Info, ibot, botmaid) ;
private void createBotRelation ( Context ctx, Test1Info test1Info, Test2Info test2Info, IBOTRelation ibot, String botmid) throws BOSException{
ArrayList list = ibot. getSrcObjIdBySrcType ( test2Info. getId ( ) . toString ( ) , test1Info. getBOSType ( ) . toString ( ) ) ;
if ( list!= null && list. size ( ) > 0 ) {
return ;
}
BOTRelationInfo relation = new BOTRelationInfo ( ) ;
relation. setAvailable ( true ) ;
relation. setBOTMappingID ( botmid) ;
relation. setSrcObjectID ( test1Info. getId ( ) . toString ( ) ) ;
relation. setSrcEntityID ( test1Info. getBOSType ( ) . toString ( ) ) ;
relation. setOperatorID ( "user" ) ;
relation. setDestObjectID ( test2Info. getId ( ) . toString ( ) ) ;
relation. setDestEntityID ( test2Info. getBOSType ( ) . toString ( ) ) ;
relation. setIsEffected ( false ) ;
relation. setType ( 0 ) ;
relation. setDate ( new Date ( ) ) ;
ibot. addnew ( relation) ;
}