【问题标题】:get workflow malfunction exception with java api使用 java api 获取工作流故障异常
【发布时间】:2018-05-15 16:18:37
【问题描述】:

有谁知道如何使用 java pe api 获取工作流故障错误消息?我正在运行 IBM 提供的 QueueSample java 代码,我不清楚如何执行此操作。任何帮助将不胜感激!

【问题讨论】:

    标签: filenet-p8 filenet filenet-process-engine


    【解决方案1】:

    我在 VWParticipantHistory.getLogFields() 数组中找到了我的工作流的故障错误消息。我修改了使用 IBM FileNet P8 API 开发应用程序红皮书的示例代码:

    // Create session object and log onto Process Engine
    ...
    // Get the specific work item
    ...
    // Get VWProcess object from work object
    VWProcess process = stepElement.fetchProcess();
    // Get workflow definitions from the VWProcess
    VWWorkflowDefinition workflowDefinition =
    process.fetchWorkflowDefinition(false);
    // Get maps for each workflow definition
    VWMapDefinition[] workflowMaps = workflowDefinition.getMaps();
    
    // Iterate through each map in the workflow Definition
    for (int i = 0; i < workflowMaps.length; i++) {
        // Get map ID and map name for each map definition
        int mapID = workflowMaps[i].getMapId();
        String mapName = workflowMaps[i].getName();
        // Get workflow history information for each map
        VWWorkflowHistory workflowHistory = process.fetchWorkflowHistory(mapID);
        String workflowOriginator = workflowHistory.getOriginator();
    
        // Iterate through each item in the Workflow History
        while (workflowHistory.hasNext()) {
            // Get step history objects for each workflow history
            VWStepHistory stepHistory = workflowHistory.next();
            String stepName = stepHistory.getStepName();
            System.out.println("step history name = " + stepName);
            // Iterate through each item in the Step History
            while (stepHistory.hasNext()) {
                // Get step occurrence history
                // objects for each step history object
                VWStepOccurrenceHistory stepOccurenceHistory = stepHistory.next();
                Date stepOcurrenceDateReceived = stepOccurenceHistory.getDateReceived();
                Date stepOcurrenceDateCompleted = stepOccurenceHistory.getCompletionDate();
    
                while (stepOccurenceHistory.hasNext()) {
                    // Get step work object information
                    // for each step occurrence
                    VWStepWorkObjectHistory stepWorkObjectHistory = stepOccurenceHistory.next();
                    stepWorkObjectHistory.resetFetch();
                    // Get participant information for each work object
                    while (stepWorkObjectHistory.hasNext()) {
                        VWParticipantHistory participantHistory = stepWorkObjectHistory.next();
    
                        String opName = participantHistory.getOperationName();
                        System.out.println("operation name = " + opName);
                        Date participantDateReceived = participantHistory.getDateReceived();
                        String participantComments = participantHistory.getComments();
                        String participantUser = participantHistory.getUserName();
                        String participantName = participantHistory.getParticipantName();
    
                        VWDataField[] logFields = participantHistory.getLogFields();
                        System.out.println("** start get log fields **");
                        for (int index=0; index<logFields.length; index++){
                            VWDataField dataField = logFields[index];  
                            String name = dataField.getName();
                            String val = dataField.getStringValue();
                            System.out.println("name = " + name + " , value = " + val);
                        }
                        System.out.println("** end get log fields **");
                    } // while stepWorkObjectHistory
                } // while stepOccurenceHistory
            } // while stepHistory
        } // while workflowHistory
    } // for workflow maps
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-10-14
      • 1970-01-01
      • 1970-01-01
      • 2023-03-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多