Precisely Enterworks

 View Only
  • 1.  Need Suggestions - CN related

    Posted 03-07-2024 19:11

    Hi Community, I need some inputs.

    Attribute X of XYZ repo has code set values 1-9. My requirement is to capture changes for X - 'only' when it changes from 9 to any other value between 2-7 and then update a value A in different repository ABC (the primary key is common in both repositories).

    I tried to use CN but there is no way to track updates from one particular number to another number in a range. As the 'CN Conditions in Condition tab of CN Registry' can only track one value (like old value = 9 or new value in 2-7) not both (from '9' to anything between '2-7').

    I have set up a condition for tracking changes on X when it is updated to any number between 2 to 7, then I used CN-LOGS filtering on old value as 9 and new value as 2-7 but even that is limited as there is a ~5 min delay in updating the CN_LOGS.

    Is there a way to circumvent this to get instant updates?

     



    ------------------------------
    Vijay Zarapala
    ------------------------------


  • 2.  RE: Need Suggestions - CN related

    Posted 03-07-2024 21:19
    Edited by Matthew Hounslow 03-07-2024 21:20

    Hello Vijay,

    You would need to use a CN_Registry and a Transformation.

    The Registry would serve as your conditional trigger and the Transformation would perform the update of the data in the target repo.

    On the Registry you would use some SQL like this in the CN_External_SQL attribute

    SELECT CASE WHEN ||X Attribute_OLD_VALUE|| = 9 AND ||X Attribute_NEW_VALUE|| BETWEEN 2 AND 7 THEN 'true' ELSE 'false' END AS booleanValue FROM XYZRepo WHERE PrimaryKey = ||PrimaryKey||

    Where you replace the value "X Attribute" with the friendly name of the attribute you want to monitor, likewise for PrimaryKey and the View name of the repository where the trigger is being executed, if the attribute you are monitoring is a VARCHAR field you may need to add single quotes.

    On the Attributes tab you will also want to ensure you enter the Attribute you want to monitor and set the CN_Attribute_All_Action to "Changed"

    On the Conditions tab of the registry you would add an entry for the CN_Conditions repeatable field where the CN_Condition_Attribute_Name is "booleanValue" without the quotes (this is the alias name given to the CASE statement outlined in the SQL), set the operator to "=" and the CN_Condition_Attribute_Value to "true", also without quotes.

    This way only if the SQL returns a true value; because the old value was 9 and the new value is between 2 & 4, will it fire the associated transformation.

    On the associated transformation, you can define a string literal or use SQL to set a variable value in your target repository

    Here is a link to the Change Notification Admin Guide (just in case you don't already have it) EnterWorks-Change-Notification-Guide

    Let me know if you have any questions and good luck!



    ------------------------------
    Matthew Hounslow

    ObjectEdge

    ------------------------------