I need to prepare to clean up the mess left by the recent
ImportObject.keepFolderLinks() bug.
This will require two steps:
- Identify objects that have links. In our testing and production systems, we do not permit links. Therefore, any links present in these systems are the result of the bug.
- Swap the link location with the home folder location.
Step 1 I have already accomplished using this SQL query:
-- Based on query provided by Matthew Bailey at Automic
-- https://community.automic.com/discussion/comment/2673/#Comment_2673
with object_paths as (
select (select OH_Client from oh where oh_idnr = child) Client
, (select OH_OType from oh where oh_idnr = child) Type
, (select OH_Name from oh where oh_idnr = child) Object_Name
, (select OH_ModDate from oh where oh_idnr = child) Mod_Date
, Path
, ofs_link Link
from (select level
, ofs_oh_idnr_f as parent
, ofs_oh_idnr_o as child
, oh_name
, replace(SYS_CONNECT_BY_PATH(
case when oh_otype='FOLD'
then substr(oh_name,instr(oh_name,'k\',1)+2)
else oh_name
end,'|'),'|','/') as Path
, ofs_link
from ofs
, oh
where oh_idnr = ofs_oh_idnr_f
start with ofs_oh_idnr_f = (select oh_idnr
from oh
where oh_otype = 'CLNT'
and oh_client = 110)
connect by prior ofs_oh_idnr_o = ofs_oh_idnr_f)
Object_links as
(select Object_Name,
count(distinct(path)) as link_count
from object_paths
where Link = 1
group by Object_Name
order by Object_Name
)
Select * from object_paths op1
where exists (select 1 from Objects_links where op1.object_name = Objects_with_links.Object_name and link_count = 2 )
order by Object_Name
For step 2, I'll use the Java APIs. I saw that in AWI 12.3.2, when you right-click on a link in the Process Assembly perspective, there is an option called
Swap Link With Object.