filenet-p8filenet-content-enginefilenet-cpe

Updating Creator property in FileNet P8


I am trying to update the Creator property in a FileNetP8 implementation. I tried to update it using the grant of "Modify Certain System Properties" however it seems that this grant does not apply to "Creator" and rather applies to other properties such as "LastModifiedBy" and so on.

I have also tried to alter the property template itself on my class through the "propertyTemplate" property to "Read-Write", however an error is being returned when I try to save it, stating that

"The operation violates a constraint of the implementation. Inherited Settability constraint on property Creator of class"

Any help is appreciated.


Solution

  • It seems like IBM Support has already been asked this question and they provided "Some How" and answer to this here:

    https://www.ibm.com/support/pages/setting-selected-system-properties-ibm-filenet-p8-document-versions

    IBM's take on this as they highlighted in the summary section of the shared link is that

    The code needed to set Creator, DateCreated, LastModifier and DateLastModified are not complex, but they are somewhat different to the code normally used for more common properties. The above steps should allow a developer to set these values when called for.

    To summarize the approach they followed:

    1. Create a new Document, setting the Creator property to the desired value
    2. Checkout the current document with the Reservation Properties parameter set to the new Document properties object using Document.getProperties() Method.
    3. Set the content for the checked out document to a new file, in my case I used the code below to copy the content from the Document to the Reservation object.

      ContentElementList docContentList = oldVersion.get_ContentElements();
      ContentTransfer contentTransfer = (ContentTransfer) docContentList.get(0);
      
      ContentElementList docContentList = oldVersion.get_ContentElements();
      ContentTransfer contentTransfer = (ContentTransfer) docContentList.get(0);
      
      ContentTransfer updatedContentTransfer = Factory.ContentTransfer.createInstance();
      updatedContentTransfer.setCaptureSource(contentTransfer.accessContentStream());
      
      ContentElementList contentElementList = Factory.ContentElement.createList();
      contentElementList.add(updatedContentTransfer);
      reservation.set_ContentElements(contentElementList);
      
    4. Checkin the document and the Creator is now updated

    I am not entirely convinced with the solution, however it is what IBM provided and it worked (except for adding an extra version) well for me