Question

FSM 6.9 Business rule XML

  • 17 January 2022
  • 1 reply
  • 273 views

Badge +3

Good Day,

I am tryin to add text on the update rule based on the hierarchy_select . What I am trying to add is static text before the xpath_node on line 34 . Any suggestions on how I could accomplish it.

Thank You.

 

<perform_batch>
<sequential_dependent>
<hierarchy_select result_name="creditstatus">
<primary_table>place</primary_table>
<attrs>
<attr>request.place_id</attr>
<attr>place.credit_status</attr>
</attrs>
<from>
<table>request</table>
<table>place</table>
</from>
<where>
<data_constraint>
<constraint>
<left_operand>request.request_id</left_operand>
<operator>eq</operator>
<right_operand>@request_id</right_operand>
</constraint>
</data_constraint>
<join_constraint>
<constraint>
<left_operand>request.place_id</left_operand>
<operator>equi</operator>
<right_operand>place.place_id</right_operand>
</constraint>
</join_constraint>
</where>
</hierarchy_select>
<update_request_event>
<request_event>
<request_id>@request_id</request_id>
<event_type>HOLD</event_type>
<description xpath_node ="//place_hierarchy_select_result[@result_name = 'creditstatus']/place/credit_status"/>
<insert is_initialized="False" />
</request_event >
</update_request_event>
</sequential_dependent>
</perform_batch>

 


1 reply

Userlevel 7
Badge +22

Hi @rperiyasamy ,

There is no straight forward method to concatenate a result coming from xpath with another string. You could have concatenated this with <perform_evaluate_expression> MPM but since there is a join with two tables, not entirely sure whether you could accomplish this. If that was the case, you can simply get the result coming from the expression and then add it via xpath to your update xml.

<perform_evaluate_expression>

  <parameters>

    <table_name>contract</table_name>

    <keys>

      <key_item>

        <column_name>contract_id</column_name>

        <column_value>127</column_value>

      </key_item>

      <key_item>

        <column_name>contract_version</column_name>

        <column_value>1</column_value>

      </key_item>

    </keys>

    <expression>”Contract Period” + (contract.end_dt - contract.start_dt) </expression>

   </parameters>

</perform_evaluate_expression>


Or either you could add the place.credit_status via the ui designer (as a hidden field) on the relevant screen that you’re going to update request_event. Then you can simply add the credit_status for the direct xml update message (without the hierarchy select) as below.

<update_request_event>
<request_event>
<request_id>@request_id</request_id>
<event_type>HOLD</event_type>
<description>@expression["Your Text" + place.credit_status] </description>
<insert is_initialized="False" />
</request_event >
</update_request_event>

If none of this work, the easiest way to accomplish this would be to create a separate view to get the concatenated result,  declare the view in custom metadata, then join it with keys and finally add that view’s concatenated result column via xpath.

Reply