This pattern is similar to Decoupling Pattern 3: Custom service to retrieve data. The main difference is that the service itself now takes the decision, which in Pattern 3 is taken in the profile.

Characteristics

 

 

 TypeScoreDescription
Knowledge characteristicsUser set or System setUser set

Any value set in code becomes user set, and is not overwritten by the rule engine.

Parameters or complex modelComplex model

The custom service has the complete profile available as input. There can be well defined output variables as service parameters. 

Enhanced by Blueriq Functionality(blue star)There is a dependency to the custom service call and model validations on its parameters. There is no support on any business knowledge that is hard coded in the service.




Maintainability characteristics

It should be possible to quickly make changes to business rules independent of other functionality.

        
Focus on Internal or External UseInternal

The custom code is only called by Blueriq

Low Implementation complexity(blue star)(blue star)(blue star)You get a new service call which you can simply place in your flow.
Internals invisible (encapsulation)(blue star)Internals are not visible and/or accessible from Studio. All Studio internals are however fully visible from code.
Autonomous(blue star)The business rules are executed separately, but side-effects are possible as there are no clear output parameters. In code you could theoretically change all profile values, but a best-practice is that only well defined output parameters are changed. Even with this best practice, the score is low as there is no support from the platform for adhering to it. Therefore, an unwanted coupling between code and model becomes likely.
Highly Testable(blue star)(blue star)Unit tests can be written in code. the difficulty lies in the hard link to the defined model. When the model changes, the code might break as it is hard-coded what attributes are needed.
Highly Reusable(blue star)Once you have the external rule defined, then you can distribute the definition in a library and use it simply on any desired attribute.The domain needs however be very similar, as the code reads the values of certain attributes in a hard coded manner. When different attributes are needed for another application, then the code needs to be changed.
Out of the Box(blue star)No custom code required.


Deployment characteristics 

Part of Application or Separate Deployment (=deployment)Part of applicationThe code is packed and published together with the model in practice.