Saturday, November 10, 2012

Read: Measuring SOA Complexity

It's imperative using structured programming constructs while designing SOA/EAI process flows in graphical modeling tools like TIBCO BusinessWorks Designer.
"Most SOA developers, today, struggle with process complexity. They write impeccable, highly-structured Java or C# code, but their processes tend to branch out and meander in every possible direction. They would never dream of embedding an if-then inside a for loop inside a while loop inside of a catch inside a do-while in Java, but they are quick to bury, deep in an SOA process, a pick inside a sequence inside a flow inside of switch inside a scope. Their processes are often far too complex.

On the other hand, when they review each others' processes, they know intuitively what 'too complex' means. Process (b) in the following figure, for example, appears much more complex than Process (c), because it has far too many arrows and is difficult to navigate. Process (c) looks tidier and more structured by comparison. Process (a) is harder to judge. Although it is well-structured and easy to navigate, it is also absurdly long; having so many steps in a sequence is poor design."


Wednesday, October 24, 2012

Read: TIBCO Administrator Fault tolerence

"TIBCO Administrator offers fault tolerance capabilities by allowing a client application to be served by multiple servers. Fault tolerance is implemented through the use of the TIBCO Rendezvous distributed queue protocol (RVDQ). Each logical server has a distributed queue based on the server name. The servers in a distributed queue group share the same server name. The TIBCO Administrator client just sees one logical server."

Read: TIBCO BusinessWorks Best Practices

A nice resource for beautifying your BusinessWorks solutions:

Some valuable points to my opinion:
  • For-Each should be used instead of group activity wherever possible.
  • For multiple transitions merging into one, all transitions should preferably merge at null activity.
  • For Parallel processing, should have an appropriate activity (e.g. null) so that all the parallel paths get executed. This is to ensure that following activities after the null activity will have all the outputs available from parallel paths.
  • Use cfg file to override the GV setting for designer mode testing.
  • Instead of JMS Queue Requestor use JMS Queue Sender and Wait for JMS Actives. Because JMS queue requestor open a new primary thread. 
  • When you want to map a child elements for example Complete Details > Details > Personal Details > Address Details > Permanent Address> Address to the Address then copy the address to process variable and map it. It increases the performance.
  • Instead of creating Durable Subscriber create a bridge b\w topic to queue and ask the durable subscriber to listen on that queue. Adding a durable subscriber creates overhead on the EMS server.
  • Divide the functionality in to molecular level for the re-use. Instead of creating in a large process.
  • Use Batching instead of Statement when possible (Better Latency) in JDBC Update.
  • Use JDBC Query activity to fetch batches of records at a time instead of retrieving the entire result set.
  • Rule of thumb is not to use many Global variables(GV) as it stays in memory in form of a tree and to retrieve the binded value process has to traverse the tree. If the unwanted GV are there the cost is incurred in traversing.
  • Copy-off increases the performance than mapping with for each in Input Tab.
  • Instead of passing a large set of data to Call process every time use Job Shared variable. Which increase the performance.

Monday, September 3, 2012

CorkScrew for tunnelling SSH over HTTP Proxies

At the client site, the firewall denies standard SSH traffic over Port 22 from the internal network to the outside. I decided to enable my Mac ssh-ing through the HTTP-proxy through Port 443. A useful utility is Corkscrew; a tunneling application which enables the Mac SSH command to use a proxy. To get Corkscrew working on your Mac, you could find a port and install it or you can download the source code and build it yourself as described here. I decided to install it via the MacPorts system.

Prior to installing MacPorts

  • First install XCode. I installed the latest XCode distribution (4.4.1) via the App Store 
  • Open up XCode, agree with the EULA. 
  • Install the XCode Command Line Tools. These need to be installed seperately by going to XCode Preferences > Downloads, find the Command Line Tools item and click on the install button.

Install MacPorts

  • Download the MacPorts MacOS Package installer.
  • Update MacPorts by running the following command in Terminal: sudo port selfupdate. For more optional checks, go to

Install and configure Corkscrew

  • In Terminal, run the following command: sudo port install corkscrew
  • Create an authentication credentials file (just a text file with your proxy username and password, to stop you having to type it each time you connect): ~/.ssh/proxy_credentials. It should contain just one line, like this: username:password
  • Next, in your ~/.ssh/config (create the file if it doesn’t already exist), add the following to make ssh use corkscrew by default for ssh connections (all one line): ProxyCommand corkscrew your.local.proxy port %h %p ~/.ssh/proxy_credentials

Optional config:

  • In your ~/.ssh/config, add the following at the top to let SSH just use Corkscrew for specific hosts: Host
  • With this config, I use "#" to switch Corkscrew on and off when needed:
Host *
ProxyCommand corkscrew your.local.proxy port %h %p ~/.ssh/proxy_credentials
#ProxyCommand none

That should be enough – you should now be able to connect to your remote server by typing:
ssh -p 443 you@your.ssh.server

Friday, August 31, 2012

Awk script that checks duplicate values in an XML

I wanted to test if a key-combination of 3 field values appeared multiple times in an XML file. A colleague of mine gave me head start on text-processing using Awk. OS X ships with the BSD version of awk so this came out quite handy.

The input XML:


The Awk script:

print "START";
print "";
/SiebelOrderID/ {
       line = $0;
       split(line, a, ">");
       split(a[2], b, "<");
       siebelOrderID = b[1];

  #print "a" siebelOrderID;
/SiebelOrderNumber/ {
       line = $0;
       split(line, c, ">");
       split(c[2], d, "<");
       SiebelOrderNumber = d[1];

  #print "b" SiebelOrderNumber;
/CordysOrderNumber/ {
       line = $0;
       split(line, e, ">");
       split(e[2], f, "<");
       CordysOrderNumber = f[1];

       #print "c" CordysOrderNumber;

/\/Order/ { 

plep = siebelOrderID "_" SiebelOrderNumber "_" CordysOrderNumber;


#print "d" plep;



       for (i in lijst) {
        if (lijst[i]-1) {
print i, lijst[i]

print "";
print "FINISHED!";

To make life easier, I put the script in a file called "parser.awk" and then used the following command in Terminal:
awk -f parser.awk input.xml

This will print the field combinations that occur multiple times.


Batch file that loops through files

This week I had to create a batch file that loops through folders and files. Dependent on the path, I needed to create a new.SQL file and append the file names to the text file.

This is the script:


REM Creating CreateStatements Files...

@echo off

rem This script makes a CreateStatementsFiles.
rem Version: 3
rem Last script update on: 2012-08-30 by Joshua Moesa

rem Setting environment variables
set rootPathBatchFile=C:\DBSCRIPTS\
set scriptRootPath=%rootPathBatchFile%scripts\
set fileOutput=%rootPathBatchFile%output.txt
set fileOutputSub=%rootPathBatchFile%outputSubRoutine.txt

rem Cleaning-up
::Cleanup all mk_-files
FOR /R %rootPathBatchFile% %%G IN (mk_*.sql) DO (


rem Printing all SQL filenames to buffer file
FOR /R %rootPathBatchFile% %%G IN (cr_*.sql) DO echo %%G >> %fileOutput%

::echo %%~pG >> %fileOutput%

rem Processing lines in the buffer file

FOR /F "tokens=*" %%A in (%fileOutput%) do (
call :process %%A


::echo %1
set fullFileName=%1
call :parse "%fullFileName%"

goto :end

set list=%1
set list=%list:"=%
FOR /f "tokens=4,5,6 delims=\" %%a IN ("%list%") DO (
  if not "%%a" == "" call :sub %%a %%b %%c
  if not "%%b" == "" call :parse "%%b %%b %%c"


exit /b


::echo In subroutine
::echo %1 %2 %3 >> %fileOutputSub%
::echo %scriptRootPath%%1\%2\makefile.txt >> %fileOutputSub%

if not exist %scriptRootPath%%1\%2\mk_%2.sql (
 echo prompt create %2 > %scriptRootPath%%1\%2\mk_%2.sql

echo @@%3 >> %scriptRootPath%%1\%2\mk_%2.sql

exit /b


DEL %fileOutput%


Some handy references I used:

Tuesday, August 28, 2012

X2Go client for Mac: connect with Unix

At my assignment, we switched to Unix development machines. Prior to this, we developed on the Microsoft SQL Server 2003 platform so I used the excellent CoRD remote desktop client to create a RDP connections.

For our new situation we're using X2Go.
x2go is an open (GPL/AGPL) source “server based computing” project. Combining the advantages of existing systems it features ease of use, performance and scalability. x2go provides you with access to your desktop as an individual as well as a corporate user - from within your own network and via the internet. x2go is not limited to particular hardware, it supports a variety of devices and architectures. x2go is open source and open minded. Like any open source project we welcome your support

There's a good X2Go client available for Mac which I use to connect to our Unix machines. I had some startup problems due to my recent OS upgrade to Mountain Lion. I noticed that X11 isn't included in Mountain Lion, so I went to XQuartz to download the latest X11 app. After install and re-login, I then went to Preferences and modified the X-Server settings. Don't click Find X11 application because it will reset the setting incorrectly.

After fiddling around with the connection settings, I managed to connect!



Monday, August 20, 2012

Tuesday, August 7, 2012

Monday, August 6, 2012

Version control with Git and Bitbucket on a Mac

I was looking into a way to put my code into a private cloud version control system. My choice for now: bitbucket.

  • First I installed the git-osx-installer for Snow Leopard (allthough I'm running Mountain Lion now).
  • Then I created an account on bitbucket.
  • I followed the wonderful bitbucket 101 to get a grasp of the Git commands (coming from a SVN world).
  • I installed the beautiful and free SourceTree Git client
  • I created a repo on bitbucket and cloned it to my Mac.
  • Added files to my working copy and added and committed them into bitbucket.
  • Done!

Java Build path and Mac OS X Mountain Lion

After my update from Snow Leopard to Mountain Lion, my Eclipse environment build path got srewed up. My project folder icons showed a red exclamation mark which hinted me.
Have to look into it a bit further (by checking the Java for Developers packages), but I did this as a quick workaround:
  1. In Eclipse, go to Preferences
  2. At Installed JREs, add a JRE of type MacOS X VM
  3. For the JRE Home use location: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

Monday, July 30, 2012

Friday, July 27, 2012

Howto: Build TIBCO BusinessWorks applications with Hudson and Ant

At my assignment, we use Apache Ant to deploy our TIBCO BusinessWorks applications.
We use the popular Hudson Continuous Integration Server to call our custom Ant build script.

This screenshot shows how the form is configured. The user and build (release) type are required by the Ant build script.

Following screenshot shows how to call the script and how to use the form parameters.

The Ant scripts main tasks are checking out code from Subversion and calling BuildEar.exe to build the TIBCO BW application EARS. Some time later, I will blog the contents of the script.

Edit 2013-04-15:
On request, hereby a small snippet which shows how to use Buildear.exe within your ANT build.xml:

<target name="buildear">
   <exec executable="buildear.exe" dir="${tra.path}" resolveexecutable="true">
      <arg line="-x"/>
      <arg value="-v"/>
      <arg line="-ear /Deployment/application.archive"/>
      <arg line="-o ${build.dir}\application.ear"/>
      <arg line="-p ${export.dir}\project"/>

Thursday, July 26, 2012

The code doesn't tell the whole story

A must-see for developers who need to think about Software Architecture
We all know that writing good code is important and refactoring forces us to think about making methods smaller, more reusable and self-documenting. Some people say that comments are bad and that self-commenting code is what we should strive for.

Despite what you’ll hear though, the code isn’t the documentation. The code tells *a* story, but it doesn't tell the whole story. Join Simon Brown to find out what’s missing and how to create lightweight documentation for your software projects.


Thursday, July 19, 2012

Sunday, July 15, 2012

The Joel Test: 12 Steps to Better Code

This list from Joel Spolsky is my default check if I'm not missing something crucial in a project.

"So I've come up with my own, highly irresponsible, sloppy test to rate the quality of a software team. The great part about it is that it takes about 3 minutes. With all the time you save, you can go to medical school."

Check it out on:

Toolbox utility: Authoxy

"If your Internet connection requires you to use a proxy which needs a username and password, Authoxy may be the solution to a seamless Internet experience. Authoxy runs locally as a proxy server to intercept HTTP and HTTPS requests, forwarding them on to your regular proxy with authentication details you define in a System Preference Pane. Such a process is required to use many web services (MacHelp, QuickTime, iTunes) behind a proxy requiring authentication."

Download after the jump:

Saturday, July 14, 2012

10 programming habits that should be more common

"You learn lots of things when you go to college and get a computer science degree or read a how-to-program book. Unfortunately, a number of good programming habits are either untaught or take a good amount of practice to turn into a way of life. Here are 10 such habits you should cultivate to become a better programmer."

Source: TechRepublic

Friday, July 13, 2012