Search code examples
oracle12csoabpelfilenet-p8ibm-content-navigator

how to unlock objects in IBM content navigator from a SOA webservice call


In my SOA, there are two apps trading document information back and forth. One of them is IBM's filenet/content navigator. Now the other app cannot call upon documents in filenet when these document are checked out in filenet. This usually is solvable by manually logging into Filenet and right clicking the document and selecting to undo the checkout.

Since the holdup really screws with my SOA integration I want to be able to perform this "undo checkout" action in filenet through a webservice call in my SOA. This would save a lot of time spent on manual actions unlocking the documents. I am using Oracle's SOA suite 11g (and 12c), and my process is heavily carried by BPELs. I already have a nice webservice interacting with Filenet. However, I will need to create a new operation "UnlockDocument" to interact and perform this action in filenet.

What I need: I need to have the code that would cover the "UnlockDocument" operation in a filenet environment, or some similar trick that would get the job done. Any information (also non-code!) on how I could proceed is very welcome, and I´ll keep updating my post if I find more info myself!

Thank you for your help!

Jesper


Solution

  • It turns out there is no possible "UnlockDocument" or "CancelCheckout" operation in filenet's webservice. However, I have found a neat workaround that let's you do just that.

    When a document is checked out in filenet through the client or through a webservicecall of the operation: "CheckoutAction". A copy of the document is made internally in filenet with the same VersionSeriesId as the original document, but with the property Isreserved = 'true'. If you perform a "DeleteAction" on this copy, you essentially recreate the manual "Cancel Checkout" step available in the filenet client. "DeleteAction" requires an ObjectIdand doesn't work on the VersionSeriesId. In order to get this ObjectID through a webservice call, you need to make a SOAPCall that obtains this ObjectID. To cancel the initial checkout, a second SOAPCall should be made that deletes the document with the in the previous step obtained ObjectID, aka: "the copy". Herefollows two examples of usable SOAPCalls:

    ExecuteSearchRequest SoapCall:

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:sch="http://www.filenet.com/ns/fnce/2006/11/ws/schema">
       <soap:Header>
          <sch:Localization>
             <sch:Locale>en_EN</sch:Locale>
             <sch:Timezone/>
          </sch:Localization>
       </soap:Header>
       <soap:Body>
          <sch:ExecuteSearchRequest xsi:type="RepositorySearch" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
             <sch:SearchScope xsi:type="ObjectStoreScope" objectStore="ObjectStoreXXX"/>
             <sch:SearchSQL>SELECT [Id] FROM Document WHERE VersionSeries = {"enter the VersionSeriesID of the initial document without quotes"} AND IsReserved = true</sch:SearchSQL>
          </sch:ExecuteSearchRequest>
       </soap:Body>
    </soap:Envelope>
    

    DeleteActionRequest SoapCall:

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:sch="http://www.filenet.com/ns/fnce/2006/11/ws/schema">
       <soap:Header>
          <sch:Localization>
             <sch:Locale>en-EN</sch:Locale>
             <sch:Timezone/>
          </sch:Localization>
       </soap:Header>
       <soap:Body>
          <sch:ExecuteChangesRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
             <sch:ChangeRequest>
                <sch:TargetSpecification classId="Document" objectId="{"enter the objectId of the previously obtained document without quotes"}" objectStore="ObjectStoreO7"/>
                <sch:Action xsi:type="sch:DeleteAction"/>
             </sch:ChangeRequest>
          </sch:ExecuteChangesRequest>
       </soap:Body>
    </soap:Envelope>
    

    Now in order to get this to work from a SOA, you'll need to invoke filenet's webservice twice from your BPEL. First with the first operation: ExecuteSearchRequest, which yields you the ObjectId required to cancel the checkout, afterwards with the second operation ExecuteChangesRequest, which deletes the correct document, undoing the initial checkout. These operations are listed in the above SOAP examples. Additionally you need to add WS-security in your outgoing header with working credentials to access the Filenet service. Otherwise you won't be able to connect with filenet.

    This has cost me a lot of time so I hope this helps someone besides me. Enjoy your mastery of filenet checkout deletion!