Saturday, July 11, 2015

IBM BPM 8.5 - Dynamic user assignment to task

From IBM BPM v8.5, the Assignment options which were there before such as "Last User in the lane", "Routing Policy",  "List Of Users" and "Custom" were deprecated an can no longer be used for the Task Assignments. In older version the option "Custom" was being used for dynamic assignment of Team or User to a Task. In the latest versions of IBM BPM i.e., from V 8.5.0 a new way of assignment has been introduced i.e., using the "Team Filter Service".

In this post, let us look at a code sample illustrating the Dynamic task assignment for user using Team Filter Service.

As a first step create a simple BPD with one Activity with a Human Service. Click on the activity and navigate to Properties --> Assignments and click on new in-front of  "Team Filter Service" to create a new Integration service (team filter service) as shown in below figure or select an already created service.




Now in the "Team Filter Service", navigate to "Variables" section and create a new variable called "toUserId" as shown in the figure. This variable can be used to pass the userId to be assigned.


Let us look at the Assignment Tab of the activity in bpd after attaching the "Team Filter Service". Below figure shows the view of Assignment Tab for the activity along with the input mapping.



Now let us look at the script which is used to create a Team with the users passed dynamically to the Team Filter Service. In this Script we need to create the Team of User and assign it output Variable "filteredTeam". Below figure shows the diagram of the "Team Filter Service".


Below is the script using which the Team is created with the users passed dynamically.

tw.local.filteredTeam=new tw.object.Team();
tw.local.filteredTeam.members=new tw.object.listOf.String();
tw.local.filteredTeam.members.insertIntoList(tw.local.filteredTeam.members.listLength, tw.local.toUserId);

Once the BPD is Created and assignment is done as explained above. Create an instance for the BPD, you will notice that the task is assigned to the team created with list of Users.

This script can be extended to filter the users from the given team based on certain parameters or to create new temporary temporary team with of the list of intended users or any other scenario where the intended Users / Teams are determined dynamically during run time.

Hope this is use full !!!

Friday, July 10, 2015

IBM BPM EPV variable behaviour

  1. I have snapshot_A with an EPV with a default value: "123"
  2. I installed that snapshot to my Process Server and the --> current EPV value is "123" as expected
  3. Now I add a new EPV value "456" with effective date to near future and the --> current EPV value changed to "456" as expected
  4. I created a new snapshot_B and I installed that one on my Process Server
  5. I used Synchronize Settings or Inflight Migration (Instances needed) and discovered that --> the current EPV value switched back to "123". Here, I expected to have "456" because it was the last modified value.
alt text












The behavior of migrating EPV variables has changed due to requirements of utilizing the default EPV value specified in the snapshot, if one is defined.
There are two scenarios:
  • One scenario is the application may be developed in the perspective where the new application requires this new EPV value defined in the snapshot (default behavior in earlier releases).
  • The other scenario is to utilize only what is defined in runtime and do not use any values defined from the snapshot (new default behavior, described above).
With JR52960 a new configurable property "epv-deploy-default" has been introduced to toggle between the two behaviors. After applying the fix the default behavior will be reverted back to how it was in previous releases where the latest modified EPV value is migrated. This means the property by default is set to 'false'. Once the property is enabled (true) then the default EPV value from the snapshot will be once again be used during deployment or instance migration.
You can find the iFix and its pre-requisites on Fix Central: https://www-947.ibm.com/support/entry/portal/search_results?sn=spe&filter=keywords%3Aibmsupportfixcentralsearch&q=JR52960