记下另一种获取状态等UUID相关信息的方法

import java.util.*;
import com.hansky.intf.stateflow.*;
import com.hansky.intf.sat.*;
import com.hansky.intf.butterfly.*;
import com.hansky.sln.spdbank.extraclass.Common;
import com.hansky.apps.butterfly.server.ButterflyServer;

 	  
 
	        String  data="";
		ButterflyServer bs = ButterflyServer.getSingleton();
		String  udboid ="62BF0B61-8E59-3CA2-CBC2-4B699C3F89A5";
		IButterflyContext ctx = (IButterflyContext)request.getAttribute("hs.butterfly.context");
		ISession session = bs.getServerContext().getUserDB(udboid).getSessionManager().createSession();
		try {
		 
        ILOV  lv =  ctx.getLOV("name", "cmsf_changecate");
        List ops = lv.getOptions();
     
	
		 for(int i =0 ;i < ops.size() ;i++){
		   IOption st = (IOption)ops.get(i);
		   data+=st.getOID()+":"+st.getText("zh_CN")+"<BR>";
			 
		 }
	 
	} catch (PersistenceException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	finally{
		
		try {
			session.txClose();
		} catch (PersistenceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}

	  response.setContentType("text/html;charset=utf-8"); 


		response.getWriter().write(data+"<br>");


 

 

 

 

 

 

 

import java.util.*;
import com.hansky.intf.stateflow.*;
import com.hansky.intf.sat.*;
import com.hansky.intf.butterfly.*;
import com.hansky.sln.spdbank.extraclass.Common;
import com.hansky.apps.butterfly.server.ButterflyServer;

   
	        String  data="";
		ButterflyServer bs = ButterflyServer.getSingleton();
		String  udboid ="62BF0B61-8E59-3CA2-CBC2-4B699C3F89A5";
		IButterflyContext ctx = (IButterflyContext)request.getAttribute("hs.butterfly.context");
		ISession session = bs.getServerContext().getUserDB(udboid).getSessionManager().createSession();
		try {
		 
		 IStateflow sflow =	ctx.getStateflow("name", "annual_req_management");
		 List states = sflow.getStateList();
 
	
		 for(int i =0 ;i < states.size() ;i++){
		   IState st = (IState)states.get(i);
		   data+=st.getOID()+":"+st.getDisplayName("zh_CN",session)+"<BR>";
			 
		 }
	 
	} catch (PersistenceException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	finally{
		
		try {
			session.txClose();
		} catch (PersistenceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}
	  response.setContentType("text/html;charset=utf-8"); 
	
		response.getWriter().write(data);
	


 

import java.util.*;
import com.hansky.intf.stateflow.*;
import com.hansky.intf.sat.*;
import com.hansky.intf.butterfly.*;
import com.hansky.sln.spdbank.extraclass.Common;
import com.hansky.apps.butterfly.server.ButterflyServer;
import com.spdb.General.*;
 String  data="";
		ButterflyServer bs = ButterflyServer.getSingleton();
		String  udboid ="62BF0B61-8E59-3CA2-CBC2-4B699C3F89A5";
		IButterflyContext ctx = (IButterflyContext)request.getAttribute("hs.butterfly.context");
		ISession session = bs.getServerContext().getUserDB(udboid).getSessionManager().createSession();
		try {
		 
		 IStateflow sflow =	ctx.getStateflow("name", "annual_req_management");
		 List trans = sflow.getTransitionList();
 
	
		 for(int i =0 ;i < trans.size() ;i++){
		   ITransition st = (ITransition)trans.get(i);
		   data+=st.getOID()+":"+st.getName()+":"+st.getDisplayName("zh_CN", session)+"<BR>";
			 
		 }
	 
	} catch (PersistenceException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	finally{
		
		try {
			session.txClose();
		} catch (PersistenceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}
	  response.setContentType("text/html;charset=utf-8"); 
	
		response.getWriter().write(data);


 

各存为一个bsh文件,放到chtml目录 ,网页访问下

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值