
package ext;

import wt.auth.*;
import wt.fc.*;
import wt.query.*;
import wt.part.*;
import wt.epm.*;
import wt.doc.*;
import wt.workflow.*;
import wt.workflow.engine.*;
import wt.org.WTOrganization;
import wt.inf.container.*;
import wt.inf.container.WTContainer;
import wt.content.ApplicationData;
import wt.method.RemoteMethodServer;
import wt.httpgw.GatewayAuthenticator;

public class lifecycle_State {

	public static void main(String[] args) throws Exception{
		RemoteMethodServer rms = RemoteMethodServer.getDefault();
		GatewayAuthenticator auth = new GatewayAuthenticator();
		auth.setRemoteUser("wcadmin");
		rms.setAuthenticator(auth);

		String ObjStg;

		System.out.println("\n");

		QueryResult resORG=PersistenceHelper.manager.find(new QuerySpec(wt.lifecycle.State.class));
		while(resORG.hasMoreElements()) {
			wt.lifecycle.State.class orgm = (wt.lifecycle.State.class)resORG.nextElement();
			System.out.println( "state: " + orgm.getName() );
		}
		System.out.println("\nNumber of state: "+resORG.size()+"\n");

	}
}