Highlighted
Trusted Contributor.
Trusted Contributor.
194 views

Deleting relationships

I have a jython discovery job that creates relationships from a server to a CI Collection CI, based on text found in a configuration file on the server.  If the contents of the configuration file changes, I can create a relationship to a new CI but the old relationship should no longer exist.

 

I have not been able to do this via automatic deletion (selecting the relationship).  I can't wait for the old relationship to age off.  How can I delete a relationship in the jython script?

 

0 Likes
5 Replies
Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Re: Deleting relationships

Hello Everett ,

 

I hope you are doing well .

 

My name is Melissa Carranza and I am a UCMDB representative and will be researching your question with our group internally. I will respond when i have the next step in this situation .

 

Best Regards,

Melissa Carranza Mejias
Customer Support Engineer

If you find that this or any other post resolves your issue, please be sure to mark it as an accepted solution.
If you are satisfied with anyone’s response please remember to give them a KUDOS by clicking on the STAR at the bottom left of the post and show your appreciation. “
0 Likes
Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Re: Deleting relationships

Hello Everett ,

 

I hope you are doing well .

 

Would you please compare the properties and history of the old and new relationship? Please inform me if both are the same or if you find a difference . 

 

 

 

Best Regards,

Melissa Carranza Mejias
Customer Support Engineer

If you find that this or any other post resolves your issue, please be sure to mark it as an accepted solution.
If you are satisfied with anyone’s response please remember to give them a KUDOS by clicking on the STAR at the bottom left of the post and show your appreciation. “
0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: Deleting relationships

The only differences are 

global ID, last access time, last modified time, create time

 

They are the same relationship type, but with a different CI at the end2.

 

Can I delete all of a relationship where the current CI (in the object state holder) is end1?  I could do this before discovering and parsing the file that defines the CI to be related to.

 

Something like "delete * from theRelationshipType where end1=mycurrentGlobalID.

 

 

 

 

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: Deleting relationships

Hoping the experts can weigh in on this question.

 

 

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Deleting relationships

Hi,

I believe what you want is not possible.
However i am not part of the HP Experts 🙂 So maybe I am wrong.
But I can suggest a relatively simple workaround:

On the adapter side include the existing relationship in the input query. In the script perform a check so that if you are creating a new relationship, an attribute will be updated to the old one that will state it need to be deleted. Create an Enrichment rule that checks for related CIs with this attribute in the relationship and delete the link.(you might need to add a custom attribute or use one of the unnecessary existing ones.)

Regards,
Nick
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.