How to link two archive rules?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2019 06:48 AM
I am trying to archive catalog request record. Along with requests I need to archive request items(RITM) and tasks. I also need to archive catalog variables. For that I need to archive Options [ sc_item_option ] and Variable Ownership [ sc_item_option_mtom ] . I am trying to archive records which are 2.5 years old. Number of requests are pretty huge. Each request have some variables. Archive Rules executes on batches like 1000 per run. If one request is archived then all the variables which are associated with this request also need to be archive. I tried to write independent archive rules for table but not able to achieve this. Do you guys have any idea regarding this problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2020 01:53 AM
Hi sdiloreto,
Thanks for your reply!
I have been able to capture the sc_item_option_mtom records as you suggest above.
The issue I am facing is archiving the associated sc_item_option (Option table) records - where the sc_item_option record sys_id is referenced in the sc_item_option_mtom.sc_item_option column.
Have you any suggested method for these records?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2020 08:02 AM
I continued to experiment on this topic and I see exactly what you mean.
I don't think it is possible and let me explain why. The archive rules, through the "archive related records", has this trickling down effect. It cannot "trickle UP" and that is what you want with the "sc_item_option" records.
The sc_request archive rule will trigger archiving on the sc_req_item table through an "archive related records" for "requested items". Then the sc_req_item archive rule will trigger archiving on the sc_item_option_mtom table through an "archive related records" for the "variable ownership". Up to this point, you have been trickling down and to trigger the archive of "sc_item_option" records you have to "trickle up" which is not possible and that is why you have to go straight to that table and handle it with its own separate archive rule.
A question for you: as you are archiving sc_item_option_mtom from the sc_req_item table archive rule, are you archiving sc_item_variables_task fromt he sc_task table archive rule?
If I helped you with your case, please click the Thumb Icon and mark as Correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2020 05:14 AM
Creating a second standalone rule for the sc_item_option table may have to suffice. You loose the ability to guarantee you are archiving the records associated with the other sc_request rule I guess.
I'm not archiving the sc_item_variables_task table. We don't really utilize it and the record count is low.
Thanks for your input!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2020 10:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2020 11:45 AM
Let's make sure you covered the basics. Unfortunately I cannot see the "estimated number" at the top. I would temporarily remove the "created.." condition and leave just the "number..." one and check if the estimate is 1. That would mean the system sees that REQ number in the sc_request table and it has been archived/restored yet.
If these first step doesn't work, nothing will "trickle down".
If it works, it will archive the REQ number and then move on to the corresponding RITM, but... on the "Requests" archive rule, you don't need to add the "Request Items (Related... )" at the "reference table rule", having the "Requests" archive rule as the parent of the "Request Items (Related... )" archive rule is ENOUGH.
Hope this helps.
If I helped you with your case, please click the Thumb Icon and mark as Correct.