It seems that the action is properly fired as I get error messages if I stuff up the syntax of the delete-action target-query. The query itself seems to point to the right object as well as I can use it with the REST interface returning the correct SLD.

But anyway, once I delete the service version, the SLD still remains. any idea ?

Re: How to automatically delete associated SLD

I think you need to include the original Service Version being deleted, in the query, so it only finds the SLD for that SV. Something like:

<delete-action
target-query="//*/gep63_provides(.)"/>

The original query looked like it would delete all SLDs in WSRR.

However... this query will not work. When the modifier is run, the Service Version has already been deleted, so running the above query will not find the Service Version. The only things available are the properties on the Service Version which has been deleted.

What I can think of, is that you store a user-defined property on the Service Version called "sldBsrURI". This UDP stores the bsrURI of the SLD. Then your rule is to use this property to find and delete the SLD, triggered from deleting the Service Version.

<action-configuration
name="DeleteSLD"
xmlns="http://www.ibm.com/xmlns/prod/serviceregistry/Actions"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/xmlns/prod/serviceregistry/Actions Actions.xsd">
<delete-action
target-query="/WSRR/GenericObject"/>
</action-configuration>
To get this set on the SV you can make another modifier rule. Perhaps a rule which triggers on the update of a Service Version (with the gep63_provides relationship having a target added if you want to be exact). You can in the action then use "copy" to pull the bsrURI value from the SLD. Something like:

I haven't tried the above. But it should, when the trigger is the SV, look for generic objects with the bsrURI of the SV, follow the gep63_provides relationship and get the SLD back. Then set a property on the SV taking the value of the SLD bsrURI.

Re: How to automatically delete associated SLD

I think you need to include the original Service Version being deleted, in the query, so it only finds the SLD for that SV. Something like:

<delete-action
target-query="//*/gep63_provides(.)"/>

The original query looked like it would delete all SLDs in WSRR.

However... this query will not work. When the modifier is run, the Service Version has already been deleted, so running the above query will not find the Service Version. The only things available are the properties on the Service Version which has been deleted.

What I can think of, is that you store a user-defined property on the Service Version called "sldBsrURI". This UDP stores the bsrURI of the SLD. Then your rule is to use this property to find and delete the SLD, triggered from deleting the Service Version.

<action-configuration
name="DeleteSLD"
xmlns="http://www.ibm.com/xmlns/prod/serviceregistry/Actions"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/xmlns/prod/serviceregistry/Actions Actions.xsd">
<delete-action
target-query="/WSRR/GenericObject"/>
</action-configuration>
To get this set on the SV you can make another modifier rule. Perhaps a rule which triggers on the update of a Service Version (with the gep63_provides relationship having a target added if you want to be exact). You can in the action then use "copy" to pull the bsrURI value from the SLD. Something like:

I haven't tried the above. But it should, when the trigger is the SV, look for generic objects with the bsrURI of the SV, follow the gep63_provides relationship and get the SLD back. Then set a property on the SV taking the value of the SLD bsrURI.