Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
1 reply Latest Post - ‏2012-11-15T14:42:56Z by SystemAdmin
SystemAdmin
SystemAdmin
693 Posts
ACCEPTED ANSWER

Pinned topic Creating a Java API to update the value w/n a metadata property

‏2012-09-27T13:13:58Z |
I'm looking to update the metadata of one of the metadata properties attached to the document and then fire off the custom event.

Without trying to update the property the code works fine -- just wanted to see what I was missing and is someone could give a hand -- thanks for the help in advance:

----
public static void getQueryANC(Domain dom, ObjectStore os) {

SearchSQL sqlANC = new SearchSQL("SELECT This, ReviewDate FROM Document WHERE Document.This INFOLDER " + " '/Guidelines/Ancillary Services Guidelines'" + " AND VersionStatus=1 AND IsCurrentVersion = TRUE AND IsReserved = false " + " AND WorkflowInProgress = 'No' " +
" AND (ReviewDate > 20120915T040000Z AND ReviewDate <= 20120922T040000Z)");

SearchScope scope = new SearchScope(os);
IndependentObjectSet set = scope.fetchObjects(sqlANC, null, null, false);

// loop through result set -- NEED TO KNOW IF THIS IS
VALID CODE

for (Iterator i = set.iterator(); i.hasNext();)

{
// Get the Document - run through and for each document that got
// pulled from the query fire off the "kickoff event"

Document obj = (Document) i.next();
String AnnualReview = "";

com.filenet.api.property.PropertyFilter pf = new
PropertyFilter();
pf.addIncludeProperty(new FilterElement (null,
null, null, "AnnualReview", null));

com.filenet.api.property.Properties props =
obj.getProperties();
props.putValue(AnnualReview, "Yes");

CustomEvent evt = Factory.CustomEvent.createInstance(os,"ANCGuidelineAnnualReviewEvent");
obj.raiseEvent(evt);
obj.save(RefreshMode.NO_REFRESH);

}

// return customObjects;

}
Updated on 2012-11-15T14:42:56Z at 2012-11-15T14:42:56Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    693 Posts
    ACCEPTED ANSWER

    Re: Creating a Java API to update the value w/n a metadata property

    ‏2012-11-15T14:42:56Z  in response to SystemAdmin
    Hi Ryan,

    i think that at first you must save your changes "obj.save(RefreshMode.NO_REFRESH);" and followed by raise event.
    Otherwise your event will be raised on unchanged object.

    Rickie