Business Process Modeling - BTMSoftwareSolutions.com

Showing posts with label Orbeon xForms. Show all posts
Showing posts with label Orbeon xForms. Show all posts

Wednesday, September 28, 2011

Orbeon xForms Upload/Retrieve Docs from Database

The following screen cast shows how you can use the orbeon upload control to capture document information from a file and then use one submission to store the file to a database and another submission to retrieve the file from the database. 

To store the file to the database an xpl file is called which calls an xslt processor to format the input-config element of the url-generator.  The url-generator processor receieves the url of the temp file passed in on instance data dynamically created by xslt processor.  The url-generator processor grabs the file data in binary mode.  We then use an identity processor to aggregate the instance data passed in on the submission and the output of the url-generator.  We call another xlst processor to dynamically create the input-config element for the SQL processor which will insert the document into the database along with metadata about the file - mediatype, filename, size, ids, etc.

To retrieve the document from the database we call another submission which executes another xpl file.  We pass in instance data about the row of the file we selected to be used as parameters in the sql processor.  So we call sql processor and select the appropriate document.  Then we call an xslt processor and to dynamically configure the config-input element of the http-serializer.  We call a second xslt processor to wrap the document base64Binary data with a root document element and pass as the config-data to the http-serializer.

For assistance on your Orbeon xForms project with storing files and/or integrating with Intalio BPM workflow tool please contact us at BTM Software Solutions, LLC.

Unable to display content. Adobe Flash is required.

Thursday, October 22, 2009

Intalio Timer - xPath Durations

This is a short blog to share my experience in creating a process which uses a parallel gateway in a potentially long ongoing process to allow users to perform work while process simultaneously calls a reporting service quarterly while that process is still in progress.  Here is how I did it:

The user form (Orbeon xForms) which kicks off the process determines the current date and using xpath sets date to either {year}-01-01T12:00:00.000, {year}-04-01T12:00:00.000,  {year}-07-01T12:00:00.000, or {year}-10-01T12:00:00.000.  If the month is 10, 11 or 12, one year is added to the current year so reporting quarter is in the correct year.

So, the process recives this dateTime value and it is mapped to a process variable called reportKickOff.  After the one parallel gateway branch a timer is placed and set to this value.  When the dateTime is reached, the process continues into a loop which first calls a reporting service and after service completes encounters another timer.  Here I take the reportKickOff value and add 3 months.  So, if it was 2009-01-01T12:00:00.000 it is now 2009-04-01T12:00:00.000.  The key here in the mapper is to take the reportingDate (of type xs:dateTime) variable and map to function op:add-yearMonthDuration-to-dateTime() and then map String "P0Y3M" of type xs:yearMonthDuration() to same function.  This is then mapped to 'date' variable in right side of mapper.

Once this date is reached, process continues into an intermediate event which resets the reportKickOff variable by adding another three months using the same technique above, the loop condition is evaluated and if condition to exit is not met, the process loops and calls the reporting service.  After the service completes, the timer is reached again and it waits until the next quarter.  This process repeats every 3 months until the loop is broken. 

To end the process, both branches of parallel gateway have to complete.  If user is done with this long ongoing process, before they reach the end of the parallel gateway I set reportKickOff variable to currentDate() and a loop variable to exit.  By setting the reportKickOff variable to currentDate(), the timer will release and the reporting loop will evaluate to exit.  Both parallel branches will now meet and the entire process can complete.  Before the process ends, I call the reporting service one last time to submit the data for the duration the process was in progress since last reporting period.

If you would like to learn more information about how you can use timers and loops like this in one of your Intalio processes - contact me at BTMSoftwareSolutions.com.

Monday, August 31, 2009

Orbeon xForms Help

Orbeon xForms is an excellent product for creating web forms. I have been using Orbeon for almost 2 years. Orbeon continues to add functionality and enhancements which reduces the amount of code that has to be written to create functional web forms.

For the new Orbeon xForm programmer, you can join the OPS (Orbeon Presentation Server) user group on Nabble. Here you can ask questions and search previous posts to see advice and solutions. This is a great starting point. Orbeon also has good documentation on the product which I strongly encourage that you read, and re-read, and re-read. After each read you will walk away with more knowledge on the product.

If you still find yourself stuck getting started or have a specific question on how to use pipelines to connect to databases, xml instance passing, page navigation, creating PDF documents, etc, you can contact me at http://btmsoftwaresolutions.com for help.