Best practice for common rule override

Certified Associate Developer

hi,

My team wanted to build a common library/application i.e. Global_CaseManagement where the application will be exported to 2 instances for 2 regions to share (similar to a common library), i.e. UK_Bank  and US_Bank.
Let's name the rule as rule!Global_GetNextCase which used within a node by a common global process model namely ACTION - Get Next Case

Given the rule Global_GetNextCase will have different logic for UK and US, what would be the recommended way to do the common rule override?

The dependency graph as below :
1. Global (application) -> ACTION - Get Next Case -> rule!Global_GetNextCase -> rule!Global_GetNextCase_UK
2. Global (application) -> ACTION - Get Next Case -> rule!Global_GetNextCase -> rule!Global_GetNextCase_US

This way will create a problem where both UK and US rules will be imported into the instances respectively causing unwanted dependency issue, cause UK only needs Global_GetNextCase_UK while US only needs Global_GetNextCase_US


Another method by using local!result: getrulereferencebyname("rule!Global_GetNextCase_" & cons!region) where this way will resolve the unwanted dependency issue, but it will be dynamically calling the expression rule, we are thinking this might not be the best practice since the dependency cannot be traced.

Any suggestion on the best practice?

  Discussion posts and replies are publicly visible

Parents
  • Certified Senior Developer

    Hello weiliml,
    Is there any deeper logic in Global_GetNextCase that you need as it sounds that specific UK and US rule is verwriting the global rule totally?
    or are there any specific parts?

    i feels like, you create here a scientific approach you dont need. it feels way over complicated

    Whats about the good old "if" ? If(ri!region = US,....,....) if(ri!region=UK,...,...)
    ri region comes from a decision table used in a script node if the respective process modell. So you can even track in the vairblae monitoring of a process instance if the right region was selected.  

Reply
  • Certified Senior Developer

    Hello weiliml,
    Is there any deeper logic in Global_GetNextCase that you need as it sounds that specific UK and US rule is verwriting the global rule totally?
    or are there any specific parts?

    i feels like, you create here a scientific approach you dont need. it feels way over complicated

    Whats about the good old "if" ? If(ri!region = US,....,....) if(ri!region=UK,...,...)
    ri region comes from a decision table used in a script node if the respective process modell. So you can even track in the vairblae monitoring of a process instance if the right region was selected.  

Children
No Data