During my 5+ years development experience in the field of TIBCO, I have come across many implementations ranging from small scale to complex enterprise level integration projects. While looking at the coding schemes followed by others, I have drawn many conclusions, identified several serious coding flaws and have also suggested several best practices based on heavy research and development for proof of the concepts.
I have decided to write down a series of Posts on my blog here to discuss and share my experiences so that every one visiting my blog can benefit from that. In this post, I am going to explain about usage of Complex Elements defined within Input Editor of the process starter verses use of XML Schema Shared Resource.
When you design TIBCO BW processes using TIBCO Designer, you often come across situations where sub-processes are being called from the parent processes. These sub-processes often expect some input and also return some output as well. The Input and Output Elements of the sub-process are defined/referenced in Its Start and End activity respectively.
When writing a process, you have two choices regarding definition of parameters:
- In the Output Editor tab of the Start Activity and Input Editor tab of the End Activity, using Plus button, add a Complex Element and Its sub-elements.
- Create XML Schema using XML Palette Schema activity and then refer to It using XML Element Reference option from Content drop down.
Which Option to Use?
So the question rises that what are the scenarios where one should simply define Elements in the Start and End Activity and when one should create a Schema and then refer to the schema in these activities?
So below are the points which you should take into consideration when deciding on it:
- Is your sub-process using some Generic Input and Output Structure? If yes and you think that you may have to create some processes with the same Input and Output parameters in future as well, you should opt for re-usable XSD instead of hard coded Elements. Use of XML Schema will standardize and generalize your parameters and you will be able to use same Schema when and where needed. If you go for hard coded Parametric elements for your process, same practice will be followed if another process is created in future with the same parameters.
- Are your Input and Output Structure very simple or Complex Enough? If your sub-process is expecting just one or a couple of inputs and also sending back a simple response (like just a response message), you can go for defining these elements simply in the Start and End activity editors. It doesn’t make sense to create a huge bunch of XML Schemas in a project when they are not really needed. But if your process input or output is not that simple and a large number of elements are going to be used with in-depth nesting of the tags, you should use XML Schemas separately. You can always import XSDs in other Schemas and in that way it becomes more easy to re-use Schema elements.
- Are there any chances of the processes moving to a SOAP web service in future? If yes then be careful! WSDL Messages refer to XML Schemas only and not to hard coded Elements. If you are using XSDs for your processes, you can refer to same XSDs for your WSDL Messages as well but if you are using Complex Elements defined internally to the process, you will have to create XML Schemas to be used for your WSDL Messages.