Monday, 29 August 2011

TIBCO Best Practices

Following are the Best practices which I came across, which might be helpful to you also....

26) To increase the ADB Adapter performance, change the Table Columns dataype to string from i4 or i8 in AESchemas.

25) After importing IDOC structure in Designer, explicitly add the SAP R/3 Adapter version folder from AESChemas to the SharedArchive folder. Otherwise, it will not work post deployment.

24) TIBCO BW documentation provides various functions to deal with date and time. Refer them before using large functions.

23) If the GlobalVariable datatype is Integer and the value is String, then it will not show any error during validation but warning message will appear while building the ear. After deployment it shows the value as 0. So take care of dataTypes.

22) Whenever you use JMS Topic Subscriber as starter activity, there is a scope of data loss if you have FlowLimit setup. To avoid data loss, use of the below options.
a) Do not set the FlowLimit. Keep it to default 0.
b) Triple the FlowLimit value complared to exppected input data volume.
c) Create a Dummy Topic listener process and bridge it to Queue then use that Queue as the listener
d) Create a bridge to Queue on the EMS server and use that queue as starter activity.

22) If "JDBC Call Procedure" is not showing the resultset metadata in the output tab, there might be a chance that stored procedure is having some issues. To cross check the issue, open the corresponding ProcessDefinition file in text editor, search with the activity name. There it will show the error, if any.

21) If the Adapter connection login is taking more than the default value 15 seconds, set the following propery in odbc.ini file to narrow down the issue. 

LoginTimeout=[value in Seconds]

20) When both primary and secondary EMS server down and restart, Adapter will terminate without re-connection. To avoid this, add the following two parameters in the adapter tra file, manually.

  a) tibco.jmsReconnectCount=[count]
  b) tibco.jmsReconnectDelay=[delay in Milliseconds]

19) If you want to change only the Parent table data but not Child table data, 
  a) Use ADB_OPCODE as 4 for parent table  
  b) Use ADB_OPCODE as 10 for child table.

18) If you want to check the SSL connectivity from designer,

       a) Add the below entries in properties.cfg file and place it in TIBCO_HOME directory
           Trace.Task.*=true    
           Trace.Startup=true    
           Trace.JC.*=true
           Trace.Engine=true   
           Trace.Debug.*=true
           bw.plugin.http.server.debug:true

      b) In the Designer, click on Tester tab, click on Advanced button and specify following statement at "Test Engine User Args" and click on OK.
-p TIBCO_HOME/properties.cfg
      c) Check the console for logs.

17) If the asciiContent contains "<?tibco-char 0?>" in the HTTP Response, then check the Accept-Encoding value in the response data. If it contains gzip, then specify ""(empty quotes) in the Headers/Accept-Encoding field in the input tab of SendHTTPRequest activity. Generally this problem comes if the webserver is HTTP 1.1 specification.

16) If we want to see the Input & Output of "SendHTTPRequest" activity from the deployed running service, enable the tracing of the same bwengine from TIBCO Admin.

15)  When starting EMS Server
         a) if the duplicate queue/topic names are present in respecitve conf files, while starting up, EMS Server displays the duplicate names and the server will get start.
         b) If the duplicate entries are present in bridges.conf, while starting up, it displays the line number where it got the duplicate entry and server will not get start.

14) EMS Server names should be same both in Primary & Secondary while configuring EMS Servers in FT

13) If the datatype of a column is changed from integer to numeric in Adapter source table, then there is no change required in the TIBCO Adapter configuration.

12) Adding machine to DOMAIN from Command Line

Step 1: Go to TIBCO_HOME/tra/5.7/template/domainutility/cmdline
Step 2: Create a new file by copying the AddMachine.xml to another file name.
Ex: cp AddMachine.xml AddMachine_XXX.xml
Step 3: Edit AddMachine_XXX.xml, enter domain related specific entries.
Step 4: Go to /TIBCO_HOME/tra/5.7/bin/, execute the following command.
./domainutilitycmd -cmdFile TIBCO_HOME/tra/5.7/template/domainutility/cmdline/AddMachine_XXX.xml –verbose
Step 5: FINISH.


11) To change the Global Variables value at runtime, add a property like below in the application tra file and restart the application.
tibco.clientVar.Shared/JMSConnection/MaxSessions=16

10) To see the input/output of any acitivity in a perticular BW process at run time, add the following properties in the application tra file and restart the application.
Trace.Task.A/B/C/ProcessDefinition.process.Group/ActivityName=true
bw.engine.showInput=true
bw.engine.showOutput=true

Here A/B/C is the directory structure,ActivityName is the acutal activity. If no group is there, remove .Group
Note: It affects the performance of bwengine.

9) While using Notify Configuration activity, check Local Only option in the configuration tab to allow an in-memory notification when the Wait and Notify activities are performed on the same machine.

8) While dealing with DB Connections, use the folllowing property to close the Idle DB connections
java.property.bw.engine.dbConnection.idleTimeout=10 (value should be in Minutes)


7) If your Process Starter is a JMS Queue/Topic receiver, 
    ---> Do not configure Message Type as XML Text, instead configure it as Text and parse the request using Parse xml acitivity.
    --> So that you can handle the errors properly and efficiently.
6) If you want to pass some values from/to your call process  and to/from sub processes,
    ---> Create a complex element in the Start activity Output Editor and End activity Input Editor, then define elements as you needed under it.
   ---> Make sure that all the elements are defined as optional although they are mandatory.
  ----> So that you will not get "Call process input failed validation" or "Output data invalid" errors.
5) If you are mapping to dateTime or Integer/Decimal or boolean elements, make sure that IF condition is appliled on those elements before actual mapping.
4) If you are dealing with SmartMapper
    --> Use the tib:trim() function while seeding the data.
    --> Use the <<SmartMapperActivityName>>/ActivityErrors/WizardOperationException/path to determine for which element Lookup returned error.
3) If you are dealing with special characters, define the special characters in a Global Variable and use the  translate() function as follows
   --> translate(source,GV,"") - syntax.
2) If a particular element is required in multiple conditions, first create a Varialbe and map the value to it. Then use that Varialbe in every condition where ever it is required.

1) Use tib:render-xml function instead of Render XML activity if you are not modifying XML structure. Also, by default, Render XML activity do the XML validation, not Schema validation. Also, you can't set encoding with the function, where as with activity you can.

Please share your experiences also..............

Thursday, 23 September 2010

Removing Namespaces from XML

Here is the following code you can use in your Transform XML activity. Map the input as string.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
 xmlns:xsl="
http://www.w3.org/1999/XSL/Transform" >
 <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
 <xsl:template match="/|comment()|processing-instruction()">
  <xsl:copy> <!-- go process children (applies to root node only) -->
   <xsl:apply-templates/>
  </xsl:copy>
 </xsl:template>
 <xsl:template match="*">
  <xsl:element name="{local-name()}">
  <!-- go process attributes and children -->
   <xsl:apply-templates select="@*|node()"/>
  </xsl:element>
 </xsl:template>
 <xsl:template match="@*">
  <xsl:attribute name="{local-name()}">
   <xsl:value-of select="."/>
  </xsl:attribute>
 </xsl:template>
</xsl:stylesheet>

Friday, 10 September 2010

Load balancing on single machine

If you want to deploy a BWENGINE in load balancing mode in a single machine, follow the steps

Process1
1) Generate the ear file
2) If you deploy through AppManage utility, edit bindings in the ServiceName.xml file
  <bindings>
        <binding name="Process Archive">
            <Machine>MachineName</Machine>
            ..............
            ..............
       </binding>
          <binding name="Process Archive-1">
             <Machine>MachineName</Machine>
               ..............
               ..............
           </binding>
     </bindings>
3) Start the services.

Process2
   1) Add multiple Process Archives in the Enterprise Archive
   2) Add the same processes to each Process Archive
   3) Build the archive
   4) Deploy and start the services
Finish.............
     

Thursday, 2 September 2010

TIBCO

How to stop the Main process until all the spawned processes completes. Note: All spawned processes should have atleast one element in the starter activity.
Step 1 --> Drag a Notify Configuration shared activity in the Shared Configurations.
Step 2 --> Drag a Mapper activity and create a repeating element in the Input Editor tab.
Step 3 --> Map unique transaction id from the source to the element created in Step 2
Step 4 --> Create a Iterate Group on the Call process from where you are calling spawnned processes.
Step 5 --> Map the varialbe created in Step 2 in the Variable List using XPath.
Step 6 --> Map Index Name($i) value to an element of the sub process.(Sub-processes should have atelast one element in the starter activitiy)
Step 6 --> Drag a Wait activity on to the Main process and craete a Iterate group on that.
Step 7 --> In the Configurations, Map the Notify Configuration, created in Step 1.
Step 8 --> Map the varialbe created in Step 2 in the Variable List using XPath.
Step 9 --> Map Index Name($k) value to Key in the Wait activity input tab.
Step 10 --> In the spawned processes, drag a Notify activity before the End acitivity and map the Shared Configuration which is created in Step 1.
Step 11 --> Map the element created in Start activity to Key in the Input tab.
Finish...............
Please let me know if you face any difficulties................

How to Monitor TIBCO EMS Server using Hawk
Step 1 --> Copy the following jar files into <>/hawk/admin-plugins directory
a) tibjmsadmin.jar b) tibjms.jar c) tibcrypt.jar d) jms.jar(optional)
Step 2 --> Edit tibjmsadmin.hma file with appropriate userName, Password, HostName and Port values.
Step 3 --> Add following entries in classpath/path
tibjmsadmin.jar, tibjms.jar, jms.jar, tibcrypt.jar
Step 4 --> Restart the Hawk service
Finish..............
Keep enjoying work when there is work............... :-)