Monday, November 30, 2009

Careers in SOA

As the erstwhile EAI jobs become SOA jobs, it’s interesting to see how many dimensions are there to this job and how to enhance one's skill to be on top of it.

Technical (Type 1-4) - It is also possible that one person might have to be involved in all these types (also to be occupied through-out the project life-cycle), so one has to prepare for it. Also some of the work is product specific roles. By the way, learning the technology might not guarantee success, as they say attitude is the key :)

Work-Type1- This goes to the folks good in linux/unix, mostly the unix admin or dba - they can help in installing all the software (linux, database, app servers, jdk, etc.), RAC install, DR setup, backup activities, code migration, system upgrades, applying patches. These people can grow to be Infrastructure/Data Architects or Cloud Architects :)

Work-Type2- This goes to folks good in JVM, App Server, SOA Server, product architecture, call them 'Specialists' - they can configure the SOA/App servers, clusters, tune them as required, monitor system health, read log file, create SRs, finding patches, system sizing, create solutions for a product stack etc. These people can grow to be Technical/Solution Architects.

Work-Type3- This goes to the folks good in Java, XSLT, JMS, EJBs, transactions, SQL, PL/SQL, BPEL API, Adapters, they are the Developers - (Here I am not including the skills which are more primary in a E2.0 space including JSF, Spring, Hibernate, Struts etc., however a Developer may have to work on some of these if the project demands) . This group can grow to be Application/Solution Architects.

Work-Type4- Lets say this is the group of Architects, who take care governance aspects of the organization, including documentations as per Enterprise standards, coming up with the physical/logical architectures, enterprise security, hardware provisioning, roadmaps, big picture etc. This group is the Enterprise Architects.

Work-Type5- This is the group of project managers, sponsors who take care of planning, budgeting/financials, status tracking, business users reporting etc. This group is the Managers/Leaders of organizations.

I have not included the sales, testing, business analyst, training roles in these categories. Also assumed all role types know SOA and its principles.

Monday, November 02, 2009

Email CSV File As Attachment

I had to create a bpel, which gets data from couple of db tables, and create a csv file and send it as email attachment. I bumped into couple of interesting challenges, luckily google is always there to help :), let me capture some of the lessons learnt.

1. creating a csv file in append mode
2. setting/getting filename in the fileadapter
3. handling multiple records, nillable fields in nxsd
4. interesting xslt, xpath functions
5. sending email with attachment


Creating a csv file using file adapter was quite straightforward, you have to get a sample csv file that you want to crate and give that to the fileadapter wizard to create an nxsd (native xsd). more on it creating csv file here reading csv file here

As the file was created in append mode (how-to here), the file name has to be unique, it had to be set by creating a fileadapter header variable and passing it in invoke. If the file name is created by fileadapter, its name can be obtained as prescribed in technotes 10.1.3.3 by adding an output of header type to the write operation.

I had to write a header to the file, and fileadpater supports multiple record types, however all these record types need a condition Value for each record type to follow, which was not possible to define for data w/o starting with any fixed value, so I had to abandon the idea of using records, I printed the header separately as all my fields were string type. So the nxsd can be tweaked to change datatypes or making fields as optional (nillable=true). more here


While working thru transformations came across very effective xslt functions like translate, which replaces any specific character in the string with any other value. function create-delimited-string creates a delimited string out of a particular node in a repeating XML structure.

Finally sending the file as email attachment, bpel sample sendEMailWithAttchment clearly shows how to do it, however I faced two challenges. One was if the ora:readFile cannot find the file it will throw XSLT error (here ), which is difficult to debug. And some reason my text/html data was overwriting the csv data, for which I changed the order or data setting, setting csv first and then text/html.

update-Nov10

I could not use the translate method to replace newline characters, the sql replace(col,chr(10),null) helped there.

Also if you get javax.xml.xpath.XPathExpressionException: FOTY0001: type error for nothing wrong in XSLT, its because you edited the XSLT even before bpel loaded the parts in the Xform activity, so always wait till the parts load before clicking edit for the XSLT.


Update Dec-7

In order to make the directory to which we write the file as dynamic, we can edit the Outboundheader xsd to add 'directory' there after fileName. And send te directory name as a preference to the bpel at runtime.