filenet pe入门操作

1、roster的含义:装载工作流实例的根工作项 (Root Work Item) 以及部分一般工作项(Normal Work Item) 的记录
连接ce
System.setProperty("java.security.auth.login.config",
"D:\\Project_tools\\jre\\PEfile\\jaas.conf.WSI");
System.setProperty("wasp.location",
"D:\\Project_tools\\jre\\PEfile\\wsi\\");
m_vwSession = new VWSession();
m_vwSession.setBootstrapCEURI("http://192.168.0.1:9080/wsi/FNCEWS40DIME");
m_vwSession.logon(m_userName, m_password, m_routerPath);
找到用户自己的工作项
queues = this.m_vwSession.getQueueNames(false);
VWQueue queue=this.m_vwSession.getQueue("Inbox");
int queryFlag = VWQueue.QUERY_READ_LOCKED;
int queryType = VWFetchType.FETCH_TYPE_STEP_ELEMENT;
int number=0;
for (VWQueueQuery query = queue.createQuery(null, null, null,
queryFlag, null, null, queryType); query.hasNext();) {
VWStepElement step1 = (VWStepElement) query.next();
}
查找(实例)根工作项的所有信息:
   public void testRetrieveWorkflowInstance() throws VWException {
VWRoster vwRoster = vwSession.getRoster("DefaultRoster");
String filter = "F_WobNum=F_WorkFlowNumber and F_SUBJECT=:subject";
String subject = "SampleParticipantFlowInstance1";
Object[] substitutionVars = new Object[] { subject  };
VWRosterQuery rQuery = vwRoster.createQuery(
            null, null, null, VWRoster.QUERY_NO_OPTIONS,
            filter, substitutionVars,
            VWFetchType.FETCH_TYPE_WORKOBJECT);
        while (rQuery.hasNext()) {
            VWWorkObject workObject = (VWWorkObject) rQuery.next();
        printFlowInstance(workObject);                     
    }
}

找个一个工作流的所有实例:
public void testListWorkflowInstancesByWorkClassName() throws VWException {
         String workClassName = "SampleParticipantFlow";
         VWRoster vwRoster = vwSession.getRoster("DefaultRoster");
                      String filter = "F_WobNum = F_WorkFlowNumber";
Object[] substitutionVars = null; VWRosterQuery rQuery = vwRoster.createQuery(
         null, null, null,
         VWRoster.QUERY_NO_OPTIONS, filter, substitutionVars,
         VWFetchType.FETCH_TYPE_WORKOBJECT);
while (rQuery.hasNext()) { VWWorkObject flowInstance = (VWWorkObject) rQuery.next();
if (workClassName.equals(flowInstance.getWorkClassName()))
            { printFlowInstance(flowInstance); } }
}


判断一个工作项是不是根工作项的依据:
F_WobNum = F_WorkFlowNumber

查看队列的任务列表
public void testListWorkQueueWorkItems() throws VWException {
String workQueueName = "Checkers";
String[] queueNames = vwSession.fetchQueueNames(VWSession.QUEUE_PROCESS);
for (int i = 0; i < queueNames.length; i++) {
String queueName = queueNames;
VWQueue vwQueue = vwSession.getQueue(queueName);
                       
           int queryFlags = VWQueue.QUERY_READ_LOCKED;
           if (workQueueName.equals(queueName)) {
               VWQueueQuery qQuery = vwQueue.createQuery(
                   null, null, null, queryFlags, null, null,
VWFetchType.FETCH_TYPE_WORKOBJECT);
               while (qQuery.hasNext()) {
VWWorkObject workObject = (VWWorkObject) qQuery.next();                                                
         printNormalWorkObject(workObject);
               }
           }       
}               
}
驱动流程前进----即对相应的字段进行赋值
VWStepElement step1 = (VWStepElement) query.next();
step1.doLock(true);
step1.setParameterValue("option1", true, true);
step1.doDispatch();

F_WobNum – 工作项号(对于根工作项,它的值和 F_WorkFlowNumber 相同 )
F_WorkFlowNumber – 工作流实例号
F_Class – 转移至 PE 中的工作流定义名
F_WorkClassId – 转移至 PE 中的工作流定义 ID
F_InstrSheetId – 工作流定义中的图 (Map) 定义 ID
F_WorkOrderId – 图定义中的节点定义 ID
F_Locked – 工作项是否被加锁

2、Queue 主要有两种类型,一种是 User Queue,另一种是 WorkQueue
转摘自:http://www.itpub.net/thread-1144008-1-1.html

你可能感兴趣的:(thread,工作,.net,F#,Security)