Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

scheduler task to change properties of document

I create a scheduelr task for change properties of document. I followed the example to prakash.

Run but but not change nothing. the code is:

public class rellena implements ISchedulerTask {

public rellena(){

super();

}

public void run( String id, Properties properties ) {

// implement the tasks to be scheduled

try {

//prueba//

//cojo un documento y le cambio las propiedades

RID rid=RID.getRID("/documents/adios.txt");

IUser user=WPUMFactory.getServiceUserFactory().getServiceUser("cmadmin_service");

ResourceContext ctxt = new ResourceContext(user);

IResource reVersioned =(IResource) ResourceFactory.getInstance().getResource(rid,ctxt);

IContent content=reVersioned.getContent();

IPropertyMap prop=reVersioned.getProperties();

IPropertyIterator iter=prop.iterator();

while(iter.hasNext()){

IProperty property=iter.next();

if(property.getPropertyName().getNamespace().equalsIgnoreCase("Clientes")){

property.getMutable().setStringValue("CambioValorSchedulerTask");

}

}

reVersioned.checkOut();

reVersioned.checkIn(content,prop,true);

}

}catch(Exception e){

e.printStackTrace();

}

}

public static void main (String args[]) {

rellena nu=new rellena();

String id="rellena";

Properties properties=null;

nu.run(id,properties);

}

}

what debbug this code???

why not run??

Former Member
Not what you were looking for? View more on this topic or Ask a question