Is it possible to flush the Clarity caches programmatically?
search cancel

Is it possible to flush the Clarity caches programmatically?

book

Article ID: 249516

calendar_today

Updated On:

Products

Clarity PPM On Premise Clarity PPM SaaS

Issue/Introduction

Is it possible to flush the Clarity caches programmatically (e.g.: via WSDL web service)?

Environment

Release :Any

Resolution

WARNING: Flushing Clarity Server Cache via a process regularly is unsupported and strongly discouraged. Caching helps the application be faster, so flushing the cache will lead to temporary slowness in Clarity. Flushing the caches regularly will lead to degraded performance and can only be done at your own risk

  1. Navigate to http://<server>/niku/wsdl/ > InvokeAction > FlushAllCaches to verify the web service definition.
  2. You can do a SOAP request with the following code:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inv="http://www.niku.com/xog/InvokeAction">
   <soapenv:Header>
      <inv:Auth>
         <!--Optional:-->
         <inv:SessionID>?</inv:SessionID>
         <!--Optional:-->
         <inv:TenantID>?</inv:TenantID>
         <!--Optional:-->
         <inv:Username>?</inv:Username>
         <!--Optional:-->
         <inv:Password>?</inv:Password>
      </inv:Auth>
   </soapenv:Header>
   <soapenv:Body>
      <inv:FlushAllcaches/>
   </soapenv:Body>
</soapenv:Envelope>

to this Endpoint: http://<server>/niku/wsdl/InvokeAction/FlushAllCaches

You should include a SessionID, or username/password. Tenant is likely not needed and can be removed.

 

This may be added inside of a gel script, like:

<gel:script xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
            xmlns:core="jelly:core"
            xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
            xmlns:soap="jelly:com.niku.union.gel.SOAPTagLibrary"
            xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
            xmlns:sql="jelly:sql"
            xmlns:xog="http://www.niku.com/xog"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

 <soap:invoke endpoint="<server>/niku/xog"
              var="auth">
  <soap:message>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inv="http://www.niku.com/xog/InvokeAction">
    [...]
   </soapenv:Envelope>
  </soap:message>
 </soap:invoke>
 
</gel:script>