MicroStrategy ONE

Idling and Resuming a Project

The code samples shown below illustrate how to idle and resume a project.

Code sample: Idling a project

public void idleProject() throws WebObjectsException

{  

 // Get factory object information from session properties

  WebClusterSource cs = factory.getClusterSource();

  WebClusterMembership cm = cs.getConnectedClusterMembership();

  WebClusterMember member = cm.get("localhost");

  WebProjectInstances projs = factory.getProjectSource().getProjects();

  WebProjectInstance proj = projs.itemByName("MicroStrategy Tutorial");

  WebProjectManipulator manip = member.getManipulator();

  

  //idle a project

  int action = EnumDSSXMLProjectActions.DssXmlIdleProject;

  int status = EnumDSSXMLProjectStatus.DssXmlProjectStatusRequestIdle;

  

  manip.setAction(action);

  manip.setStatus(status);

  manip.applyChanges(proj);

}

Code sample: Resuming a project

public void resumeProject() throws WebObjectsException

{  

  // Get factory object information from session properties

  WebClusterSource cs = factory.getClusterSource();

  WebClusterMembership cm = cs.getConnectedClusterMembership();

  WebClusterMember member = cm.get("localhost");

  WebProjectInstances projs = factory.getProjectSource().getProjects();

  WebProjectInstance proj = projs.itemByName("MicroStrategy Tutorial");

  WebProjectManipulator manip = member.getManipulator();

  

  // resume a project

  int action = EnumDSSXMLProjectActions.DssXmlResumeProject;

  int status = EnumDSSXMLProjectStatus.DssXmlProjectStatusRequestIdle;

  

  manip.setAction(action);

  manip.setStatus(status);

  manip.applyChanges(proj);

}