Search This Blog

Sunday, May 21, 2017

Milestone workflow pattern using AMX BPM


WHAT?

 The Milestone workflow pattern is a BPM Process behaviour in which an activity is only enebled when the process instance is reached in specific state (milestone), in case process instance progresses beyond this state, then the task is no more enabled.

 An interesting graphical animation, simulating the behaviour of such use case can be found here.

WHY?


 There are lot of real life industry use cases which needs to have this pattern implemented in TIBCO AMX BPM, which is preferred BPM Product by many clients today. We can consider an example BPM Process use case in Aviation Industry which has to do with Flight Management. 

 In this use case there is requirement that check-in's are allowed only during specific time, i.e. once a process instance reached certain milestone, check-in's should be allowed and prior to 45 minutes of closing of gates



HOW?


 AMX BPM Provides lot of implementation alternatives to implement this use case using TIBCO Business Studio. However to make this use case and its implementation understandable, I will try keep the suggested solution as simple as possible.

 In the simplest approach as shown below in the Diagram:

  1. A signal can be thrown to start check-ins.
  2. As soon this signal is caught before allowing check-ins a Time comparison should be done if check-ins should be allowed are not. Based on the results process instances continues execution. 






Note: In case if you are intrested in actual sample implementation or you have a problem implementing or even you feel there is better approach for the beginners then it would be helpful if you can drop a message. 


We strongly believe that collaboration makes internet better place.

Monday, November 28, 2016

Handling Time zone in your SOA/BPM architecture.

WHAT?


Need of handling Time zone correctly in your SOA/BPM architecture.


WHY?


There can be many reasons why this problem needs to be addressed before it comes back as a serious Production defect. Few of the commonly occurring situations are like you need to perform manipulations on the date times in your application and you might need to consider Leap months OR your applications are distributed across different geographical location e.g. End users using GUI in APAC region and SOA/BPM Stack is in Europe and Backend/Legacy application based in America OR more important your application needs to cater for Winter/Summer time zone changes in case of daylight savings OR many known/unknown reasons. There can endless scenarios happen when you deal with date time in your application stack.


Also using correct time zone offset doesn’t solves the all problems completely as in many cases time zone offset is changed based on geographic condition. Hence for sure it makes sense to use open source libraries which hides all this complexities and provides APIs for Developers so that they can focus on building robust application.

If you are still not convinced that using 3rd party library for dealing with date times is a good option then this video is recommended for you 


HOW?


When talking about application development using TIBCO Products based on the Industry experience following approach is recommended however for the implementation in other technology is also more or less same.
  1. Your application will need to invoke APIs of Joda-Time http://www.joda.org/joda-time/ in your BW, BPM implementation, hence you will need to integrate Joda-Time libraries inside your BW Application.
  2. There are many ways one can integrate Joda-Time libraries in the code below is an example for beginners.
  3. When your application is dealing with timestamp in case of :
    • Creating new server timestamp, this will give you correct timezone based on the date e.g. in case your code want  to know timezone offset for the date in summer when it gets executed in winter. 
    • Comparing, Manipulating timestamps in the different timezone.

        

Integrating Joda-Time in TIBCO BusinessWorks:

  1. Include the jars in the Alias Library.
  2. Use Java Code Activity to translate the date time to correct target timezone. Now here you can make the code more intelligent to handle it correctly and you can use different APIs given by Joda.

Integrating Joda-Time in TIBCO AMX BPM:


There are more options available in AMX BPM. For beginners they can expose the functionality which was created in BusinessWorks and can expose them as a web service to use in a AMX BPM or they can expose the same java code in AMX BPM as a service or even using AMX Mediation Component a virtualized service can be created. The new versions of tpcl that comes shipped along with TIBCO BusinessStudio already contains Joda library.

Note: In case if you are intrested in actual sample implementation or you have a problem implementing or even you feel there is better approach for the beginners then it would be helpful if you can drop a message. We strongly believe that collaboration makes internet better place.