Tuesday, March 16, 2010

Webservice Description Language (WSDL)

              
Webservice Description Language (WSDL)

                Webservice is a software system designed to support interoperable machine to machine interaction over a network. In otherwords, it is a Client-Server model based application. WSDL is Webservice Description Language which is an XML based language that provides a model for describing webservices. The main advantage of the webservice is that we can pass values at run time. WSDL uses a certain standard format called SOAP which is Simple Object Access Protocol. The structure of SOAP has a Header, Body and Attachment.


      WSDL has Abstract wsdl on the server side and Concrete wsdl on the client side to perform machine readable description of the operations offered by the service.

        Abstract wsdl is the core of the web service. All services are defined in the abstract wsdl. It is a Server Side WSDL. Abstract wsdl contains only messages and operations. Abstract wsdl is used by SOAP Server. Request and reply operations are created with a port type.
        
            Concrete wsdl is the WSDL that allows a client to connect (and work with request/response) to a Web Server.It contains the metadata for sending a correct request and receiving correct response. Concrete wsdl contains messages, operations and transport specific information (JMS or Http). This is used by SOAP client.

Few properties make sense for bwengine.tra

 Few properties make sense for bwengine.tra

     The following property cleans your gc for your bwengine or designer , add it part of tra files, if you want to make it available for all deployments then add this property as part of your bwengine.tra


  java.extended.properties -Xms768m -Xmx768m -verbose:gc

webservice creation(SOAP OVER HTTP)

webservice creation(SOAP OVER HTTP)

1. Create a ProcessDefinition, name it as main process.

2. Replace the start activity with SoapEventSource.
    a. In the Configuration Tab select the transport as HTTP Transport.
    b. Browse for the porttype and operation from the WSDL
    c. Look in to the abstract WSDL as appeared in the WSDL Tab
    d. Select all and save as ConcreteWSDl
3. Create a test process by the following steps
    a. Drag a processDefinition and get the soap request reply activity in b/n start and stop
    b. In the service panel browse for the concrete WSDL

  When we test it, Providing the input for the test process and test it Everything should be fine.

webservice creation(SOAP OVER JMS)

webservice creation(SOAP OVER JMS)

1. Create a ProcessDefinition, name it as main process.
2. Replace the start activity with SoapEventSource.
     a. In the Configuration Tab select the transport as Jms Transport.
     b. Browse for the porttype and operation from the WSDL
     c. In the Transport Details Tab, Select the message type, either queue/topic.   And mention the Queue/Topic name as Message Destination.
    d. Look in to the abstract WSDL as appeared in the WSDL Tab
    e. Select all and save as ConcreteWSDl

3. Create a test process by the following steps
     a. Drag a processDefinition and get the soap request reply activity in b/n start and stop
     b. In the service panel browse for the concrete WSDL
     c. Inthe transport details, go to the internal JMS tab and mention the credentials as  required to test.
    d. Provide the JMSDestinaion, same name as what we mentioned in the Main Process.
    e. Please check the Use Shared JMS connection checkbox, it will prompt for the connection.
    f. Provide the same connection as mentioned above.

When we test it, Providing the input for the test process and test it.

Out of Memory Error in BW Application

Out of Memory Error in BW Application

     In some running applications, suddenly you started hitting out of memory errors. To drill down more, Check the max heap size you configured while deploying time.
        If the running application thrown out of memory error, you can simple go ahead and test from designer with the same amount of input, some where the funny coding is taking all your memory.

          If it is new application, set the heap suggested is multiples of (64MB), and keep increase, if it is keep throwing just open the code check with the same load and see which activity is taking all the memory and take corrective steps.

For ex:
       If you are not properly using parse data activity in your code, this will end up eating more than 2 GIG for 20 MB file.

Solution :
 
      Heap settings will be done at Admin level, to do that login to TIBCO administrator, and navigiate process specific server settings, and change the heap values.

Custom Database Driver in JDBC Connection in Tibco

Custom Database Driver in JDBC Connection in Tibco

The following drivers are included in the TIBCO BusinessWorks installation: 
  •     tibcosoftwareinc.jdbc.oracle.OracleDriver
  •     tibcosoftwareinc.jdbc.sqlserver.SQLServerDriver
  •     tibcosoftwareinc.jdbc.sybase.SybaseDriver
  •     tibcosoftwareinc.jdbc.db2.DB2Driver  
      The following drivers are supported, but you must obtain, install, and configure these from the appropriate vendor:

  
     oracle.JDBC.driver.OracleDriver (oci)

     oracle.JDBC.driver.OracleDriver (thin)

     com.sybase.jdbc2.jdbc.SybDriver

     com.timesten.jdbc.TimesTenDriver

     com.ibm.db2.jcc.DB2Driver

  
      The following drivers are JDBC 2.0-compliant and should work correctly, but they are not officially supported with BusinessWorks. You must obtain, install, and configure the driver from the appropriate vendor:

  
    sun.jdbc.odbc.JdbcOdbcDriver

    weblogic.jdbc.mssqlserver4.Driver

 
   You can download, install, and use other JDBC drivers, but TIBCO does not guarantee the drivers will function properly with TIBCO BusinessWorks. To use an unsupported driver, perform the following:

 
Download the JDBC driver and copy the required JAR files to a location in the classpath of the TIBCO BusinessWorks Engine. For example, you can copy the files to the following location: TIBCO_HOME/tpcl//jdbc.


          In the JDBC Connection resource, choose Select Driver from the drop-down list in the JDBC Driver field and type in the name of the driver class in the text box within that field. Then, type in the correct URL in the Database URL field and specify the other fields in the resource.
 

      See TIBCO BusinessWorks Release Notes for more information on the supported and tested versions of databases and database drivers.

Create web services in Tibco?

1. First Define Schema

a. Drag XML Schema from XML Tools palette
b. Double click to open schema
c. Change the root element name to what ever the application name
d. Select the content column and change it to elements
e. Create another element called request
f. Repeat the step d for request element
g. Create another element called reply
h. Repeat the step d for request element
i. Open a notepad create element string as follows element_child1?, element_child1? element_child3?

j. Copy these elements in the content model colum (make sure you placed between (–elements–) to either request or reply, and choose globally defined option, it should like as follows. (element_child1? , element_child2?)

k. Add what ever the elements that you require for reply, or choose from the earlier created list

2. Create Abstract WSDL

a. Drag WSDL activity from WSDL palette
b. Open that WSDL (double click), Add two messages to the list and name as operation_request and operation_reply
c. Select operation_request, add a element in part table
d. Choose element instead of type, Click on the schema lookup and choose request element that was created on Step1.
e. Select operation_reply, add a element in part table
f. Choose element instead of type, Click on the schema lookup and choose reply element that was created on Step1.
g. Apply and save
h. Drag port type to the wsdl
i. Open port type (double click) and add operation
j. select operation, add two elements on in the message table.
k. for input choose, request and for output choose reply
l. apply and save

3. Create a HTTP connection

a. Drag HTTP activity from HTTP palette
b. specify the host and port name


4. Create Webservice
a. Drag a process from process palette
b. Open the process, Drag Soap event source and Soap Send Reply from SOAP palette

c. Select Soap Event Source, In configuration Tab, Link the WSDL - Operation created in Step 2,Link HTTP connection created in step 3
d. Add any business logic in between soap event source and soap send reply
e. apply and save

5. Creating Concrete WSDL

a. This is the WSDL is being used by third party application or clients.
b. Select SOAP event source, click on WSDL source tab
c. Right click (mouse) on that body , and select save as and store the WSDL in file directory.

6. To Invoke by third party applications

a. Send this WSDL created in step5

7. To Test (In Designer)

a. Choose Import Resources or file in Project Tab,
b. Choose the format to file type, and click on lookup button to impost the WSDL created in Step 5,and import the WSDL to designer.
c. Create a process
d. Drag Soap Request And Reply from SOAP Palette
e. Choose the WSDL that imported in step b in this Step 7.
g. link all three activities, and test according to your need. (Make sure to pass the details  in Soap Request Reply for the operation)

Note: Things to remember and learned

1. Common schema, one place to change all the elements
2. Make sure all host and port variables are part of global variables
3. Follow the naming conventions as per the company standards or guide lines.

Monday, March 15, 2010

Tibco Interview Questions and Answers

11.What activities are supported in XA Transaction ?
The XA Transaction type allows:

JDBC activities
ActiveEnterprise Adapter activities that use the JMS transport
JMS activities
to participate in transactions.
Note:For JMS activities and ActiveEnterprise Adapter activities, request/reply operations cannot participate in an XA transaction. Also, EJB activities cannot participate in an XA Transaction group.


12.What are the possible Error output's of Read File activity?
Integration can be at different application layers:


FileNotFoundException :Thrown when yhe file does not exist.
UnsupportedEncodingException:Thrown when the text file’s encoding is not valid and the content of the file is read into process data.
FileIOException :Thrown when an I/O exception occurred when trying to read the file.

13.What is the purpose of the inspector activity ?
The Inspector activity is used to write the output of any or all activities and process variables to a file and/or stdout. This is particularly useful when debugging process definitions and you wish to see the entire schema instead of mapping specific elements to the Write File activity.


14.What are the maximum/minimum of threads available for incoming HTTP ?
The maximum/minimum of threads available for incoming HTTP : 75/10


15.How can unauthorized users be prevented from triggering a process ?
Unauthorized users be prevented from triggering a process by giving 'write' access for the process engine to only selected users. Only users with 'write' access can do activities like deploying applications, starting/stopping process engines etc.


16.What are the mandatory configuration parameters for FTP Connection & FTP with firewall ?
The mandatory configuration parameters for FTP Connection

FTP host
Port
Username & Password>

If Firewall is enabled in addition the proxy host and port are required.


17.how to design a process such that depending on number of records updated in a database, 3 different sub-processes may be called ?
Define 3 transitions from JDBC update with condition on the no of updates and call appropriate child processes.


18.How to use legacy .dat file format with latest designer ?
Convert .dat file to multi file project using Administration tab while starting up Designer(Other one being Project tab) and then open the multifile project in the normal way.


19.What are the encodings supported by designer ?
Encodings supported by designer are

ISO8859-1(Latin-1)
UTF-8

20.What are the 4 main panels of the Designer window ?
The 4 main panels of the Designer window are

Project panel
Palette panel
Design panel
Configuration panel

21.How do you determine if there are broken references in the project?
Project -> Validate for deployment


22.Where are the Designer preferences stored ?
Designer preferences stored are stores in a file called 'Designer .prefs' in the user home directory.

23.Explain the process configuration parameters - Max Jobs, Flow Limit & Activation Limit ?

Max Jobs :
Max Jobs specifies the number of process instances that are kept in memmory. Once this limit is reached newly created process instances (subject to flow limit) are paged out to disk.0 specifies no limit and is the default.

Flow Limit :
Flow Limit specifies the maximum number of running process instances that are spawned before the process starter is suspended ie it enters a FLOW_CONTROLLED state and does not accept new events. This can be used to control the number of process instances running simultaneously and when the protocol generating the event can store the event till it is received, like email servers, JMS, RV etc. 0 specifies no limit and is the default.

Activation Limit :
Activation limit flag specifies that once a process instance is loaded it must be placed in memmory till it completes execution. By default it is enabled.


24.What are the options for configuring storage for process engine's checkpoint repository ?
The options for configuring storage for process engine's checkpoint repository are:


Local File
Database. Fault tolerant engines can recover from a checkpoint only when database is used.

25.Process engines in a fault tolerant group can be configured as peers or master secondary.How do these differ ?
The options for configuring storage for process engine's checkpoint repository are:


- Peer means all of them have the same weight. In this case when one engine fails another one takes over and continues processing till it fails.
- In master secondary configuration weights are unequal, the secondary starts processing when master fails. But when master recovers, secondary stops and master continues processing.

26.What are the uses of grouping activities ?
Uses of grouping activities are:

Create a set of activities having a common error transition.
Repeat group of activities based on a condition.
- Iterate over a list.
- Repeat until condition true.
- Repeat on Error until condition true.
Group activities into a transaction.
To create a critical section area that synchronizes process instances.
A 'Pick First Group' allows you to wait for the occurence of multiple events and proceed along a path following the first event to occur.


27.What is the purpose of a Lock shared configuration resource?
A Lock is specified for a 'Critical Section' group when the scope is 'Multiple'. It can be used to ensure synchronization across process instances belonging to multiple processs definitions or for process instances across engines(Check multi engine flag for lock in this case and the BW engine needs to be configured with database persistence while deployment). If synchronization is for process instances belonging to the same processs definition inside one engine, just specify the scope as 'Single'.


28.How to control the sequence of execution of process instances created by a process starter ?
Use the sequencing key field in the Misc tab of any process starter. Process instances with the same value for this field are executed in the sequence in which they are started.


29.Can there be two error transitions out of an activity ?
No. There can be only one Error and one Success if no matching condition transition out of each activity.


30.When is a 'No Action' group used ?
'No Action' group used to have a set of activities having a common error transition


31.What activity can be used to set the value of a 'User defined process variable' ?
The 'Assign' activity can be used to set the value of a 'User defined process variable'.


32.Which are the two process variables available to all activities with inputs ?

$_globalVariables
$_processContext


33.Which mechanism can be used to pass data between a process instance and a called sub process other than mapping from/to the callee's input/output ?
This can be accomplished using job shared variables, unless in the call process activity the 'Spawn' flag is enabled in which case the called sub process is a new job and hence gets a fresh copy of the job shared variable initialized as per its configuration. A shared variable can overcome this limitation as it's scope is not limited to one job.


34.What are the three scenarios where BW engine has to be configured with database persistence instead of Local File ?
The three scenarios are:


Shared Variables across BW engines.
Locking across groups in multiple BW engines.
Wait Notify across BW engines.

35.If you want a group to be executed if there is some unhandled error but subject to some max number of iterations which group do you use ?
We can use Repeat on Error until true


36.When is a 'Generate Error' activity useful?
When you handle an error inside a called subprocess or group and want to rethrow the error to the caller(happens by default if you dont handle the error in the called process)


37.Which activity is used for detecting duplicate message processing?
CheckPoint activity - Specify the uniqueID for the duplicate key field and engine maintains list of these key fields. When a process come to checkpoint activity with the same value for duplicate key which already exists, it throws a DuplicateException. An error transition can then handle this case.


38.Give an example where graceful migration of service from one machine to another is not possible.
HTTP Receiver. In this case the receiver on new machine starts listening on the same port, but you need to redirect requests from the old machine to the new one.


39.What are the types of adapter services ?
Types of adapter services are :

Subscriber Service
Publisher Service
Request-Response Service
Request-Response Invocation Service


40.If the business process needs to invoke another web service which resource do you use ?
SOAP request reply activity. If the business process needs to be exposed as SOAP service use SOAP Event Source in conjunction with SOAP Send Reply or SOAP Send Fault.


41.What is the functionality of the Retrieve Resources resource?
It can be used to serve the wsdl file of a SOAP Event Source to a (http) client.
Construct a process like: HTTP Receiver -> Retrieve Resources -> Send HTTP Response

Now the WSDL file for a SOAP service can be retreived using the http request

http://://?wsdl

where 'path' is the folder path to the SOAP Event Source process and 'resourceName' is the name of the process

Example : http://purch:8877/Purchasing/GetPurchaseOrder?wsdl


42.What is the scope of user defined process variables ?
The scope of user defined process variables is only the process in which it is defined.(Not even inside a sub process that is invoked from this process)

43.What is difference between shared variable and job shared variable ?

Both of them can be manipulated via the palette resources 'Get shared variable' and 'Set shared variable'.

A job shared variable is private to one instance of job or in other words each job has a fresh copy. In the case of shared variable the same copy is shared across all job instances. It can even be persisted and can survive BW engine restarts and even shared across multiple BW engines(when deployed using DB persistence).



44.How do wait-notify resources work ?
Basically wait and notify should share a common notification configuration which is just a schema definition for data that will be passed from notifier to waiter. Specific instances of waiter & notifier are corrrelated via a key.

For example: when one process is in wait state for key 'Order-1', it waits till another process issues a notification with the same key value.


45.What is the default Axis in XPath ?
Child axis- What this means is that when you select "BOOK" from the current context, it selects a child node with that name, not a sibling with that name. Other axes are parent , self , sibling etc.


46.What are the output formats for XSLT?

XML
HTML
Text

47.What does ' Success if no matching condition' transition mean ?
Lets say between two nodes N1 and N2, there are 3 success transitions with condition and there is no success transition without condition. If none of the conditions match then a 'Success if no matching condition' transition can be used. Also if there is a success transition and also success transitions with condition and if the condition matches then both the sucess transition (no condition) as well as the transition(s) with matching conditions are followed. So you can use 'Success if no matching condition' to prevent duplicate paths of execution.







48.What is the Purpose of $_error variable ?
$_error variable is available in the node following the error transition. It captures the error message, error code etc.


49.What are the cases where business process cant proceed correctly subsequent to restart from a checkpoint ?

Sending HTTP response, confirming an email/jms message etc. This is because the confirmation or sending HTTP response has to done in the same session. When engine crashes these sessions are closed at their socket level. In such cases send response/confirm before checkpoint.


50.Which group do you use to wait for multiple events and proceed with the first to occur ?
A 'Pick First Group'.

Tibco Interview Questions

1.What are the modes of TIBCO BW Installations ?

GUI mode
Console mode
Silent mode


2.If you have installed a particular version of TIBCO software e.g. TIBCO BW X.Y.Z, What are X, Y and Z number stands for?
Integration can be at different application layers:


X:Patch
Y:Major
Z:Minor

3.What is the role of TRA?
TRA stands for TIBCO Runtime Agent.
The TRA has two main functions:

Supplies an agent that is running in the background on each machine.
The agent is responsible for starting and stopping processes that run on a machine according to the deployment information.
The agent monitors the machine. That information is then visible via TIBCO Administrator.
Supplies the run-time environment, that is, all shared libraries including third-party libraries.

4.What are the resources that gets included in the EAR file, created by the TIBCO Designer?
An EAR file can contain local project resources, LibraryBuilder resources, and files as specified in AliasLibrary resources. In addition, the TIBCO Designer classpath may include references to other files that are included in the EAR file.



5.What are the revision control system options available in TIBCO designer?

File sharing
VSS
Perforce
XML Canon
ClearCase
iPlanet
CVS
PVCS

6.What are the different modes of service invocation?
Services can be invoked in several ways.

A one-way operation is executed once and does not wait for a response.
A request-response operation is executed once and waits for one response. In a request-response service, communication flows in both directions. The complete interaction consists of two point-to-point messages—a request and a response. The interaction is only considered complete after the response has arrived.
Publication (notification) means an operation sends information on an as-needed basis, potentially multiple times.
Subscription means incoming information is processed on an as-needed basis, potentially multiple times.

7.What is vcrepo.dat?
TIBCO Designer creates a file named vcrepo.dat in the project root directory when you first save the project. This file is used to store properties such as display name, TIBCO Rendezvous encoding, and description. This file can be used for identification in place of the project root directory and can be used as the repository locator string (repoUrl).


8.What are the TIBCO BW activities that can participate in transactions?
Not all TIBCO BusinessWorks activities can participate in a transaction. Only the following types of activities have transactional capabilities:

JDBC activities
JMS activities
ActiveEnterprise Adapter activities that use JMS transports
EJB activities
TIBCO iProcess BusinessWorks Connector activities

9.What are the different types of Transactions TIBCO provides?
TIBCO BusinessWorks offers a variety of types of transactions that can be used in different situations. You can use the type of transaction that suits the needs of your integration project. When you create a transaction group, you must specify the type of transaction. TIBCO BusinessWorks supports the following types of transactions:

JDBC
Java Transaction API (JTA) UserTransaction
XA Transaction

10.What activities are supported in JTA Transaction?
The Java Transaction API (JTA) UserTransaction type allows:

JDBC
JMS
ActiveEnterprise Adapter (using JMS transports)
EJB activities

to participate in transactions.

Tibco Tutorial

This TIBCO tutorial teaches you how to create a process definition that writes the words "Hello, World!" into a file using TIBCO Designer. You will really appreciate how easy this is to do with TIBCO. The neat thing about application development with TIBCO Designer is that you do not have to know the programming syntax on how to perform most of the tasks. Take, for example, the syntax for writing to a file so that you can output "Hello, World!" into the file. This task requires knowledge of the file writing syntax specific to the programming language being used. With the TIBCO Designer tool, all you have to do is place the appropriate activity (in this case, the Write File activity) into the process. After that, you provide the file path and text content of "Hello, World!" into the activity configuration. Then you're done! No need to know the syntax and the use of the appropriate classes behind the scenes. This tutorial is a good demonstration of how TIBCO increases developer productivity. Enjoy!

The writing of output into a file can be achieved by creating and configuring a Write File activity in TIBCO Designer. The steps to do this are as follows:


Create a new empty project called XmarterTIBCOTutorials.
Inside the XmarterTIBCOTutorials root folder, create a new folder called BusinessProcesses.
Inside the BusinessProcesses folder, create a new folder called HelloWorld.
Inside the HelloWorld folder, add a process definition called HelloWorld.
Add a Write File activity into the process definition. Configure the Write File activity as follows:
Go to the Input tab of the activity:
In the fileName field, type "C:/HelloWorld.txt".
In the textContent field, type "Hello, World!"
When done, click the Apply button in the Write File activity and save the whole project.
Create a transition line from the Start activity to the Write File activity and another from the Write File activity to the End activity.
Validate the resource and make sure there are no errors before testing the process.
To do this, deselect all the activities by clicking on a white space inside the process definition. Then click on the Validate Resource button on the top section of TIBCO Designer.
Go to the Tester tab on the left-hand side of TIBCO Designer. Click on the Start testing button. In the dialog box that comes up, click on the Load & Start Current button.
The process should now execute.
To check the output, go to My Computer, and open the C drive. Check to see that it contains a HelloWorld.txt file with a "Hello, World!" text written to the file.

I hope this TIBCO tutorial has been helpful to you. As you can see in the steps above, no coding is required for you to write text into a file. The main bulk of the work is really in the Write File activity. The steps where I had you create the project folders were just for good project organization. Those steps were not necessary to the actual functionality.

This is just one of many instances in which TIBCO dramatically boosts developer productivity. In my opinion, developer productivity is one of the reasons that make TIBCO such a spectacular tool for application development.