Upthrust

This is the weblog of Milinda Pathirage

Why Tools Are Important For Middleware?

In the first quater of 2009, we released first version of WSO2 Business Process Server(BPS). And we released WSO2 BPS with experimental BPEL4People and WS-Human Task support in first quater of 2010. But we did a big mistake by not releasing proper tools at both times. This lead to several problems, like usability issues for the users. And I strongly believe that if we could concern more about the tooling aspect of WSO2  BPS from the first release, usage of WSO2 BPS could be better than the current stage.

When we were doing first release of WSO2 BPS, Eclipse BPEL editor was there and we could do BPEL modeling using that to some extent. At that time Eclipse BPEL editor has some issues and as I remember it didn’t support Apache ODE deployment descriptor creation(This was added later by Tammo). Because if the resource constraints we had we decided to go with only the Eclipse BPEL editor. And at that time Netbeans BPEL editor was also there and we suggested it for users in some situations(User needs to create deployment descriptor manually in this case). But in 2010 we fixed some of the issues there in the Eclipse BPEL editor and we integrated it to WSO2 Carbon Studio.

But again we did a mistake by releasing first version of BPEL4People + WS-Human Task implementation without a proper tool for creating human task definitions. This was a major issue when it comes to usability and this also cause reduction of  amount of testing we could do to test WS-Human Task implementation. In the 2nd half of the 2010, we were busy with Cloud version of WSO2 BPS and we couldn’t work on human task tooling.

Currently we are working on next version of BPEL4People and WS-Human Task support for WSO2 BPS and we are also working on tooling support for human tasks in parallel.

Because of the above experience I strongly believe that, when we are developing middleware we should always think about the tooling aspect from the beginning. This will not only make your product popular and will bring you more money.

WSO2 BPS Dynamic SOAP Header Handling

When dealing with “Activity based Correlation” for WSO2 BAM, we had to send “Activity ID” header coming to the WSO2 BPS to other consecutive external service invocation in same process. Dynamic SOAP header handling feature in Apache ODE was very useful in this scenario. You can use this feature to situation like this where your process WSDL and external service WSDL doesn’t define any SOAP headers and but you need to send incoming SOAP headers across partners in a process.

Current implementation of dynamic SOAP header handling is not that much perfect in WSO2 BPS’ ODE integration layer. There is a bug when you don’t have a SOAP header element specified in source message(Message we extract the SOAP header element to copy in to other message), so you must be careful when using this feature. But there will be more fixes to this in the future and this feature is available on WSO2 BPS 2.0.2. Please feel free to report any issues you found in this feature.

You can download a sample from here. This sample shows how you can copy incoming SOAP Header in request message to the response message. But you can use this same mechanism to copy SOAP Header elements from request message to external service invokes and also to copy SOAP Header elements in the responses from external services to other out going messages from the BPEL process. The above sample expect you to send a SOAP header element with the local name “ActivityId”.

Wikileaks and Governance

“The blame for the issue seems to be landing on a certain US private Bradley Manning. But I place the blame directly on a lack of Governance and poor IT systems. And the measures that have so far been announced – things like removing CD drives from classified systems – are simply the wrong approach. The real problem is why any one person – whatever level of clearance they had – should have access to all 250,000 cables.”

Read more..


WS-BPEL Tips: Transforming Array Of XML Elements

Because of the fact that the WS-BPEL uses WSDL 1.1 to define the interfaces expose by it self and  interfaces it invokes, XML is used every where inside process definition. Defined using XML schema, messages that exchange in and out are all XML and even variables that are local to WS-BPEL process are also XML documents. Because of this, considerable amount of effort must be put in to transforming XML data from one representation to other and combining various XML data together or creating new XML variables when developing WS-BPEL processes.

WS-BPEL support the manipulation of XML data via ‘assign‘ activities and we can also use XSLT and XPath to copy(parts of) one variable to another variable. In addition to basic support provide by WS-BPEL WSO2 BPS, which uses Apache ODE as underlying BPEL engine provide few utility XPath 2.0 functions to make some assignments easier.

In this post I am going to explain how you can create a array of XML elements from another array of XML elements with the help of basic XPath capabilities and Apache ODE specific extension function. The XML conversion will be as below:

to

To do the above XML transformation we need to extract the each text element inside element ‘x‘, create new element ‘y‘, put the extracted text content to ‘y‘ and add the ‘y‘ to parent element. To traverse through XML element array I am going to use WS-BPEL ‘while‘ activity and we need two extra BPEL variables(both variables are of int type) to keep the number of elements in the array and to store the counter to use in the looping condition. To count the number of XML elements in array we can use ‘count‘ XPath function as below:

To insert elements in to the parent element, I used Apache ODE’s XPath extension function ‘insert-as-first-into‘ as below:

The XML transformation while loop is given below and you can use this as template to transform array in your processes.

In addition to things mentioned above, you need to make sure that there is a XML element defined in your XML schema to allow you to define BPEL variable to represent a element in the resulting array. In this case element ‘y‘. If you are writing the process for a existing schema, it’s better to define you own XML schema element to suite to your requirements, so that you can define BPEL variable to represent a element in the array. In this example my XML schema looks like following:

You can download the complete sample from here.

Only Mac OS X Shortcut We Need To Remember

Use of keyboard shortcuts increase the productivity. Keyboard allows you to minimize time between thought and action. But unfortunately, it’s easy forget shortcuts. As a solution to this problem, you can use the OS X keyboard shortcut: Shift + CMD + /, which let’s us toggle an application’s help menu. It let’s us search for application help topics, and in addition to that it also returns application menu items.

Now we can do the action we want. But if we hover over the ‘Menu items’, it will show where in the menu it can be found along with it’s keyboard shortcut. This will help you to easily find out forgotten shortcuts and remember them for next time.

SSL Debugging

There will be situations where you need to debug SSL connection when dealing with Web Services security and other client-server scenarios which uses SSL for security. Following two articles from Prabath describes various methods and tools out there for SSL debugging. In addition to normal SSL related scenarios, he specifically talks about how you can use SSL debugging tools to debug WSO2 Carbon Front-End server and Back-End server communication which uses SOAP over HTTPS.

Objective-C Concepts

Objective-C tutorial on Cocoa Dev Central is a great place to start with Objective-C. This is not a normal hands-on guide, but it’ll help you lot to understand basic concepts if you are new to Objective-C.

The Two Things About Computer Programming

Computer programming:

  1. Every problem can be solved by breaking it up into a series of smaller problems.
  2. The computer will always do exactly what you tell it to.

Software Engineering:

  1. Writing the code is the easy part. Writing it so someone else can understand it later is the important part.
  2. Make it work, then make it elegant, then make it fast.

Read more at “The Fishbowl“.

Want To Live Forever?

Break your habits. Do things you don’t know how to do and foreswear the routine. Walk where you would normally drive. Crawl where you would normally walk. Make a friendship with someone in a new language. Put down that cigarette! Or take up that cigarette! Leave your marriage. Give yourself over to something different. Make yourself a beginner.

Read more…

Notification Script For Maven Builds On Mac OS X

I use Maven every day to build WSO2 Carbon based products and it takes huge amount of time due to the size of WSO2 Carbon platform. So I used to run the build and do some other work until it finishes. But most of the times, I forget to check the build status and this has effected badly on my productivity.

I thought that I could reduce the effect on productivity, if I can trigger some notification sound and a bubble when build is finished. Using Growl notification system(You need to install growlnotify tool as from Growl extras.) and afplay command line tool I came up with the following script which let me trigger notification after invoking any command line tool.

For example think you want to get a notification after a maven build, you can execute the maven command like following(Note: I have named above script growlexec and made it a executable):

growlexec mvn clean install -Dmaven.test.skip=true

This will create notification bubble and will make a sound after the command line tool is done with it’s work.

How can we create something like this for use on Linux?

You can use libnotify to trigger visual notification bubbles. For audio notifications you can use tool like beep.