Payload example

In this example, you define a UserTransaction that is dependent on both an IBM WebSphere Application Server and a DB2 database running on a particular DB2 instance. This example uses the default tbsm namespace.

Note: Comments are included to help explain the purpose of the XML content.

<!-- this is a comment begin tag

The following tags end the comment ->

<!-- -this id is only used as reference within the file-book -->
<tbsm:resource id='bookid_trans1' > 

 <!-- the toolkit does not enforce values here but it would be wise for 
you to break your resources up into types which will allow you to map 
them to templates later on -->
<tbsm:resType>UserTransaction</tbsm:resType>

<!-- the displayname you will see in tbsm -->
<tbsm:Label>ImportantTransaction</tbsm:Label> 

<!-- the unique identity string for this object - it must be namespace unique -->
<tbsm:identity>UserTransaction_uniqueIdentify</tbsm:identity>  

<!-- you can add any number of additional attributes on the object that may 
be used for your solution ... just make sure you follow standard xml 
formatting -->    
<tbsm:attr1> attrvalue1</tbsm:attr1>    

<!-- the closing tag for the resource definition.

</tbsm:resource>


<!--   the definition of the websphere resource              -->
<tbsm:resource id='bookid_websphere' >                  
<tbsm:resType>J2EEServer</tbsm:resType> 
<tbsm:Label>websphere@host1.com</tbsm:Label>   
<tbsm:identity>websphere@host1.com_identity</tbsm:identity>      
</tbsm:resource>

<!--   the db table              -->
<tbsm:resource id='bookid_dbtable' >                  
<tbsm:resType>DBTable</tbsm:resType> 
<tbsm:Label>table1</tbsm:Label>   
<tbsm:identity>table1@Db2Instance1</tbsm:identity>      
</tbsm:resource>

<!--   the db instance              -->
<tbsm:resource id='bookid_db2inst' >                  
<tbsm:resType>DB2</tbsm:resType> 
<tbsm:Label>Db2Instance1</tbsm:Label>   
<tbsm:identity>Db2Instance1@host1</tbsm:identity>      
</tbsm:resource>
<!--   and now the relationships between them              -->
<tbsm:uses source=' bookid_trans1' target= 'bookid_websphere' />
<tbsm:uses source=' bookid_trans1' target= 'bookid_dbtable' />
<tbsm:uses source=' bookid_dbtable' target= 'bookid_db2inst' />

After being wrapped in a correct header, tail, and footnote section, the XML code can be processed by the TBSM Discovery Library Toolkit and the resources created in TBSM Service Component Repository (SCR). When the resource is in the SCR, the resource is then available to use to build service models.

You can also define your resources with custom namespace definitions.For example:

<my:server id=”server_1” >                  
   <my:serveridentiy>server_1</ my:serveridentiy > 
   <tbsm:Label>My Server 1</tbsm:Label>
</my:server >

<my:application id=”appl_1” >                  
   <my:applicationidentity>appl_1</ my: applicationidentity > 
   <tbsm:Label>My Application 1</tbsm:Label>
</my: application >

<my:default id=”rsc_1” >                  
   <tbsm:identity>ResourceDef 1</ tbsm:identity > 
   <tbsm:Label>Resource 1</tbsm:Label>
</my:default >


<my:uses source=' appl_1' target= ‘server_1' />
<my:dependsOn source=' server_1' target= ‘rsc_1' />