© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
A. S. BluckIBM Software Systems Integration https://doi.org/10.1007/978-1-4842-8861-0_2

2. Configuring Java Custom Components

Alan S. Bluck1  
(1)
Ashley Heath, Hampshire, UK
 

This chapter covers the creation and configuration of Java customizations required for processing Events triggered by the IBM FileNet Content Engine. It describes the development of custom Java code and the deployment of a Code Module which is invoked. The use of Workflow Subscriptions which enable a workflow to be launched on the storage of a document in the Content Engine Object Store is described with a step-by-step example.

The full Content Engine Java API documentation can be found with the following link:

www.ibm.com/docs/en/filenet-p8-platform/5.5.x?topic=development-content-engine-java-api-reference

Note

IBM recommends that Content Engine Web Services can be used where a system is not compatible with the use of the IBM FileNet Java or .NET API. For further Content Engine Web Service code examples, see

www.ibm.com/docs/en/filenet-p8-platform/5.5.x?topic=development-content-engine-web-service-developers-guide

For the application of a Code Module for IBM Business Process Automation, see

www.ibm.com/docs/en/baw/20.x?topic=events-using-event-handler-filenet-content-manager

Chapter Organization

This chapter contains the following five Parts:

Part 1 – Supporting Documents. This Part provides references to freely downloadable documents which provide additional reading material supporting the chapter.

Part 2 – Configuring Java Components for Content Engine Events. In this Part, a Java project is built, step by step, to create and deploy the example fn_eventhandlers.jar file, which we then show how to deploy, for use with the Audit Master solution covered in Chapter 1.

Part 3 – Testing the Add Document to Folder Event. In this Part, we test the Add Document to Folder Event. The TestHarness code in the Eclipse project requires a valid Document Object to be used to link to an existing AUDIT_TEST folder which is created and used as a test setup for the EventHandler code.

Part 4 – The DbExecute Workflow Step for Calling Database Stored Procedures. In this Part, we describe the use of the DbExecute workflow step. This allows a Database Stored procedure to be invoked from an IBM Case Manager Workflow step. This is supported using the IBM FileNet P8 Process Designer tool.

Part 5 – Standalone Process Designer Installation. This Part describes the installation and configuration required to install the Windows Client Standalone Process Designer, which is then used to add a DbExecute workflow step to the Audit Master Solution we created in Chapter 1.

Part 1 – Supporting Documents

There are two very useful downloads which provide additional examples and links to downloadable Java code supplied freely by IBM.

IBM FileNet Java API Call Examples

This MS Word document can be downloaded as shown in Figure 2-1. It describes the download of an IBM DemoJava.zip file and the configuration of the Java Eclipse IDE which can be configured to run working examples to show the use of the IBM FileNet Content Manager Java API calls to create, store, and retrieve Document and Folder objects in a Content Object Store.

A screenshot represents the I B M FileNet P 8 development java document. The download and the read file buttons are placed on the right side.

Figure 2-1

Download the free IBM FileNet P8 Java Development Document

This gives the downloaded document, entitled

“IBM FileNet P8 Java Development on ECM Cloud Private Container P8 Examples”

This free download document, IBMFileNetP8JavaDevelopmentonECMCloudPrivateContainerP8Examples.docx, can be downloaded using the URL link:

https://doi.org/10.13140/RG.2.2.20160.69129

Java Code Development

The Java code developed for custom events should be compiled into an appropriately named Java archive, or “jar” file. To install this code, the jar file should be made accessible to a machine that has access to the acce (IBM Administrative Console for Content Platform Engine) application.

“IBM FileNet P8 Java Development on ECM Cloud Private Container P8 Examples”

This describes the download and installation of an Eclipse IDE for Java development and the basic configuration of the supporting Java jar files for the IBM FileNet API on a Red Hat RHEL 8.0 Linux system.

For the Audit system, the following Java code in this chapter provides the custom event, AddDocToFolder. This Java code will work on Red Hat Linux or MS Windows operating systems which have IBM FileNet Content Engine installed.

In enterprise applications, normally code needs to be included in a “war” file and deployed so that its classes are accessible. The Content Engine Event code, however, uses a Java jar file with the classes required for events which can be contained within the Content Engine Object Store. This makes for easy deployment and maintenance. The jar file is added to the Object Store through the acce tool, which has the ability to choose hidden classes.

Part 2 – Configuring Java Components for Content Engine Events

In this Part, we will build a Java project, step by step, to create and deploy the example fn_eventhandlers.jar file, which we then show how to deploy, for use with the Audit Master solution covered in Chapter 1.

The final Java project structure we build in the Eclipse Java IDE will have the main Java components as shown in Figure 2-2.

A screenshot of the project explorer tab, with the add doc to folder dot java option selected.

Figure 2-2

The AuditEventHandler Eclipse Java project structure

The Java code project is created using the following steps:
  1. 1.
    In the Eclipse Java IDE, select the menu items File ➤ New Project.

    A screenshot of the eclipse software, with a new project tab opened.

    Figure 2-3

    Open a New Project in Eclipse

     
  1. 2.
    Eclipse supports a number of different project types; we will select a standard Java project type.

    A screenshot of a new project window with the java project folder opened and selected from the project wizard lists.

    Figure 2-4

    Select the Java Project type from the Project Wizard types

     
  1. 3.
    The Next command is clicked to add the Project attributes.

    A screenshot of the java project option selected and highlighted and the next button below is also highlighted.

    Figure 2-5

    Select the Next command button to add the Project attributes

     
  1. 4.
    The Project name is entered as AuditEventHandler.

    A screenshot of the new java project window, with the project name as Audit Event Handler, and the type selected to j r e, and a finish button at the bottom. All these options are highlighted.

    Figure 2-6

    Select the Finish command button to create the Project outline

     
  1. 5.
    The module-info.java was created as follows.

    A screenshot represents the module name as an audit event handler, and create button is highlighted.

    Figure 2-7

    Enter the Module name as AuditEventHandler and click Create

     
  1. 6.
    The Eclipse IDE prompts you to check if you wish to open the Java perspective. This predefines the window frames that are opened and the panels that are displayed, which are considered most useful for Java program development.

    A screenshot of the open associated perspective window and the open perspective button is highlighted.

    Figure 2-8

    Click the Open Perspective command to view the standard Java layout

     
  1. 7.
    At this point, we have just one empty Java class and the Java JRE System Library defined for the project.

    A screenshot of the basic java project window with package explorer tab, audit event handler, J R E system library, s r c, and module info dot java file displayed in a menu.

    Figure 2-9

    The basic Java project shown in the standard Java layout

     
  1. 8.
    To create a new Java package, com.asb.ce, we need to right-click the src folder, highlighted in Figure 2-9, and select the NewPackage option from the menu drop-downs. We can then enter the package name as shown in Figure 2-10.

    A screenshot of the new java package window, with space for the source folder, and the name, with cancel and finish buttons at the bottom.

    Figure 2-10

    The Java package com.asb.ce is created under the Java src folder

     
  1. 9.
    We can now add Java code as a Java Class to the “empty” com.asb.ce package by right-clicking the com.asb.ce package we created in step 8 and then selecting the menu items, NewClass (highlighted in Figure 2-11).

    A screenshot of the eclipse workspace window. The package explorer menu is opened with a few drop down options.

    Figure 2-11

    A new Java Class is added to the Java package com.asb.ce

     
  1. 10.
    The attributes required for the Java Class are displayed; we just add the name of the class we want to give as CEConnection. This class will be called to create a Java connection object to enable access to the IBM FileNet Content Engine Object Store.

    A screenshot of the new C E Connection Java Class Content engine with source folder, package, superclass, interfaces, and other input and checkboxes.

    Figure 2-12

    A new CEConnection Java Class is added to the Java package

     
  1. 11.
    For the CEConnection.java Java code, we just cut and paste a Standard IBM code example as shown in Figure 2-13 and listed fully in Listing 2-1 later in this chapter.

    A screenshot illustrates a new C E Connection Java Class Content engine events with a set of instructions, which includes packages, library functions, and initializations.

    Figure 2-13

    A new CEConnection Java Class is added to the Java package

     
  1. 12.
    Notice in Figure 2-13 that the imports for all the com.filenet.api… packages are flagged with errors (a white cross on a red background). This is because we need to add the IBM FileNet API jar files to the Java project properties, which we will now provide in the next steps.

    A screenshot of a project menu with properties highlighted.

    Figure 2-14

    The Project Properties are selected to update the Classpath details

     
First, we have to copy the IBM FileNet client jar files from their installed location on the Linux server to the reference classpath directory we create using
mkdir /opt/FileNetJars

A screenshot represents the I B M FileNet A P I commands.

Figure 2-15

The IBM FileNet Client API Content Engine .jar files are copied

A screenshot represents the continuation of the I B M FileNet A P I commands.

Figure 2-16

The IBM FileNet Client API Process Engine .jar files are copied

  1. 13.
    Next, we can add the copied .jar files created in step 12 to the Project Classpath.

    A screenshot of the properties for an audit event handler window, with java build path as the main tab, with selected classpath. Add external J A R s command is highlighted.

    Figure 2-17

    The Add External JARs command is clicked on the highlighted Classpath node

     
  1. 14.
    The files are added as shown in Figure 2-18 from the /opt/FileNetJars directory.

    A screenshot of the add external J A R window, with a few highlighted and selected folders.

    Figure 2-18

    The Add External JARs command is clicked on the highlighted Classpath node

     
It can be seen that the result of adding the jar files has corrected the errors as highlighted in Figure 2-19. However, there are still some import failures showing on the java.util… package imports and the javax.security package.

A screenshot illustrates the addition of external J A R s command Content engine events with a set of instructions, which includes packages, library functions, and initializations.

Figure 2-19

The Add External JARs command fixes the highlighted imports

  1. 15.
    To correct the Java package import errors, we need to add a JRE library, using the Add Library command, to the Project Classpath as indicated in Figure 2-20.

    A screenshot illustrates how the add library command resolves the java package imports.

    Figure 2-20

    The Add Library command fixes the Java package imports

     
  1. 16.
    We need to add a JRE System Library type which we select and then click the Next> command button to show a command which will give a list of the available JRE versions.

    A screenshot of the J R E system library option selection, and the next button is highlighted.

    Figure 2-21

    The JRE System Library option is selected and Next> is clicked

     
  1. 17.
    The Installed JREs command is clicked to allow a choice of installed JRE Java System .jar files.

    A screenshot of the add library window, with the workspace default J R E selected for the system library, and the installed J R E s is highlighted.

    Figure 2-22

    The Installed JREs command button is selected

    A screenshot represents the installed system content engine events with filtered preferences and installed J R E s.

    Figure 2-23

    The Installed system JRE is selected, and the Apply and Close is clicked

     
  1. 18.
    As shown in Figure 2-23, the Add command is used to add the JRE to the Classpath for the project, and then the Apply and Close command is clicked.

    A screenshot represents the properties for Audit Event Handler with java build path and libraries including module path, and class path displayed.

    Figure 2-24

    The JRE System Library appears in the Project Classpath

     
The Properties for the AuditEventHandler project now show the JRE System Library in the Java Build Classpath.
  1. 19.
    In order to ensure the correct import packages are used to build the project, it is sometimes necessary to use a specific order of .jar files, so that the earlier versions of a package are consistent with the functions required, since it is possible that a Class module with the same name appears in more than one .jar file. The Classpath order of the referenced .jar files can be adjusted using the panel shown in Figure 2-25.

    A screenshot represents the properties for Audit Event Handler. The java build path has files in it, with order and export menu.

    Figure 2-25

    The final working order of the Classpath libraries is set

     
  1. 20.
    The CEConnection.java source code is now free of errors.

    A screenshot represents the working C E connection java code and audit event handler with s r c.

    Figure 2-26

    The working CEConnection.java code

     

This code is deployed as follows:

Create the Project and add the CEConnection.java (Standard IBM code).
package com.asb.ce;
import java.util.Iterator;
import java.util.ResourceBundle;
import java.util.Vector;
import javax.security.auth.Subject;
import com.filenet.api.collection.ObjectStoreSet;
import com.filenet.api.core.Connection;
import com.filenet.api.core.Domain;
import com.filenet.api.core.Factory;
import com.filenet.api.core.ObjectStore;
import com.filenet.api.util.UserContext;
/**
* This object represents the connection with the Content Engine. Once
* connection is established it initialises the Domain and ObjectStoreSet object with
* the available Target Store Domain and ObjectStoreSet.
*
*/
public class CEConnection {
private Connection con;
private Domain dom;
private String domainName;
private ObjectStoreSet ost;
private Vector osnames;
private boolean isConnected;
private UserContext uc;
// ASB001
private String _username = "";
// ASB002
private static final String encryption_delimiter = " "; // Newline
/*
* constructor
*/
public CEConnection() {
     con = null;
     uc = UserContext.get();
     dom = null;
     domainName = null;
     ost = null;
     osnames = new Vector();
     isConnected = false;
}
// Object Finalize (called before Garbage collection)
// ASB003.
protected void finalize() {
     this.disconnect();
}
// ASB004.
public void disconnect() {
     if (isConnected) {
          uc.popSubject();
          con = null;
          dom = null;
          isConnected = false;
     }
}
// ASB005
public String getCurrentUser() {
     return _username;
}
// ASB006 Returns the IBM Object Store java Object
public ObjectStore getObjectStore(String ObjectStore)
{
     // This hard coded example would have String variables read from  an encrypted Config.xml or config.properties file
     // in a Production Environment!
     //                Values passed are User , password , the stanza jaas.conf.WSI value, MTOM SOAP URL link
     // The jaas.conf.WSI is a file in the path /opt/IBM/ECMClient/configure/CE_API/
     // The stanza is as follows in the jaas.conf.WSI file :
     //   FileNetP8WSI {
    //         com.filenet.api.util.WSILoginModule required;
    //   };
     this.establishUnencryptedConnection("Alan", "filenet", "FileNetP8WSI", "http://localhost:9080/wsi/FNCEWS40MTOM/");
     return fetchOS(ObjectStore);
}
/*
* Establishes connection with Content Engine using supplied username,
* password, JAAS stanza and CE Uri.
*/
public void establishUnencryptedConnection(String userName, String password, String stanza, String uri) {
     con = Factory.Connection.getConnection(uri);
     Subject sub = UserContext.createSubject(con, userName, password, stanza);
     uc.pushSubject(sub);
     dom = fetchDomain();
     domainName = dom.get_Name();
     ost = getOSSet();
     isConnected = true;
     _username = userName;
}
// ASB007 The form of the method called in the CodeModule distribution
public void establishConnection(String userName, String password, ResourceBundle ResourceBundle) {
     String stanza = ResourceBundle.getString("stanza");
     String uri = ResourceBundle.getString("uri");
     // Delegate method
     establishUnencryptedConnection(userName, password, stanza, uri);
}
/*
* Returns Domain object.
*/
public Domain fetchDomain() {
     dom = Factory.Domain.fetchInstance(con, null, null);
     return dom;
}
/*
* Returns ObjectStoreSet from Domain
*/
public ObjectStoreSet getOSSet() {
     ost = dom.get_ObjectStores();
     return ost;
}
/*
* Returns vector containing ObjectStore names from object stores available
* in ObjectStoreSet.
*/
public Vector getOSNames() {
     if (osnames.isEmpty()) {
          Iterator it = ost.iterator();
          while (it.hasNext()) {
               ObjectStore os = (ObjectStore) it.next();
               osnames.add(os.get_DisplayName());
          }
     }
     return osnames;
}
/*
* Boolean method which checks whether the connection has been established with the Content Engine or not.
*/
public boolean isConnected() {
     return isConnected;
}
/*
* Returns the IBM FileNet ObjectStore object for the passed object store name string.
*/
public ObjectStore fetchOS(String name) {
     ObjectStore os = Factory.ObjectStore.fetchInstance(dom, name, null);
     return os;
}
/*
* Getter method which Returns the domain name.
*/
public String getDomainName() {
     return domainName;
}
/*
* Getter method which Returns the current connection object.
*/
public Connection getCurrentConnection() {
     return con;
}
/*
* Getter method which Returns the domain object.
*/
public Domain getCurrentDomain() {
     return dom;
}
}
Listing 2-1

The CEConnection Java class object

Now we can create another Java Class for the project. This is the Event Handler itself, so we add a new class package, com.ibm.filenet.p8.ce.eventhandlers.codemodules, as shown in Figure 2-27.

A screenshot illustrates the process of creating a new Java package, specifying the source folder and name, with the Finish button.

Figure 2-27

The AuditModule Class package is created

Next, the AuditModule Java class is created under this package using the screen in Figure 2-28.

A screenshot illustrates the new java class window, with source folder, package, name, and superclass as input boxes, and the cancel and finish button below.

Figure 2-28

The AuditModule Java class is created

The following code is the main CodeModule class with the Event Handler AuditModule class for the addDocToFolder Java method.
package com.ibm.filenet.p8.ce.eventhandlers.codemodules;
import java.util.Iterator;
import org.apache.log4j.Logger;
import com.filenet.api.collection.ContentElementList;
import com.filenet.api.collection.ReferentialContainmentRelationshipSet;
import com.filenet.api.collection.StringList;
import com.filenet.api.constants.AutoUniqueName;
import com.filenet.api.constants.DefineSecurityParentage;
import com.filenet.api.constants.RefreshMode;
import com.filenet.api.core.Annotation;
import com.filenet.api.core.ContentElement;
import com.filenet.api.core.CustomObject;
import com.filenet.api.core.Document;
import com.filenet.api.core.DynamicReferentialContainmentRelationship;
import com.filenet.api.core.Factory;
import com.filenet.api.core.Folder;
import com.filenet.api.core.ObjectStore;
import com.filenet.api.events.ObjectChangeEvent;
import com.filenet.api.query.SearchSQL;
import com.filenet.api.query.SearchScope;
import com.filenet.api.util.Id;
public class AuditModule {
     private static Logger logger;
     static {
          System.setProperty("log4j.configuration", "events_log4j.xml");
          logger = Logger.getLogger(AuditModule.class);
     }
     public void addDocToFolder(Document d) {
          //We retrieve the folder ID from the Document folder_Id_to_file_in property
          //(which is added to the Audit Document Class)
          String propNames[] = {"AUD_folder_Id_to_file_in"};
          d.fetchProperties(propNames);
          //The folderId string contains a GUID as a string as in our test example e.g.: {00D14A81-0000-C31E-A7D2-F2B7CF2D4803}
            String folderId = d.getProperties().getStringValue("AUD_folder_Id_to_file_in");
          //IBM FileNet Folder object is retrieved from the ObjectStore based on the string folderId
            Folder parentFolder = Factory.Folder.fetchInstance(d.getObjectStore(), folderId, null);
          //The IBM FileNet drcr Object is a linking IBM FileNet object which links a Document Object to a Folder Object
            DynamicReferentialContainmentRelationship drcr = (DynamicReferentialContainmentRelationship) parentFolder.file(d, AutoUniqueName.AUTO_UNIQUE, null, DefineSecurityParentage.DO_NOT_DEFINE_SECURITY_PARENTAGE);
          drcr.save(RefreshMode.NO_REFRESH);
     }
}
Listing 2-2

The AuditModule Java class object

The next Java class, TestHarness, is used to test the Event method(s).

A screenshot represents the test harness java class content engine events with source folder, package, name, superclass, and buttons for cancel and finish.

Figure 2-29

The TestHarness Java class is created

package com.ibm.filenet.p8.ce.eventhandlers.test;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import org.apache.log4j.Logger;
import com.asb.ce.CEConnection;
import com.filenet.api.collection.ContentElementList;
import com.filenet.api.core.ContentTransfer;
import com.filenet.api.core.Document;
import com.filenet.api.core.ObjectStore;
import com.ibm.filenet.p8.ce.eventhandlers.codemodules.AuditModule;
/**
* Test method for the
* {@link com.ibm.filenet.ps.ciops.AuditOperations#getFolderDocuments(VWAttachment)}
* method. It uses a test folder in the object store as input.
*
* @throws Exception
*/
public class TestHarness {
           Logger l4j = Logger.getLogger(TestHarness.class.getName());
      // @Test
           public static void main(String args[])
            {
                // The IBM FileNet Connection object is set up to point to our IBM Case Manager Target Object Store
                CEConnection cec = new CEConnection();
                TestHarness th = new TestHarness();
                th.os = cec.getObjectStore("OS2");
                System.out.println(th.os.get_Name());
           //
                try {
                     th.test_AddDocToFolder();
                } catch (Exception e) {
                     // TODO Auto-generated catch block
                     e.printStackTrace();
                }
            }
           //The Test Document ID for AC.pdf file is {00D14A81-0000-C31E-A7D2-F2B7CF2D4803}
           private void test_AddDocToFolder() throws Exception {
                l4j.debug("test_AddDocToFolder");
                Document d = (Document) os.getObject("Document", "{00D14A81-0000-C31E-A7D2-F2B7CF2D4803}");
                am.addDocToFolder(d);
           }
// Test using the AUDIT_TEST folder Id = {896F3369-7AF8-405E-85A7-3E18F90ACE43}
     private ObjectStore os;
     private AuditModule am = new AuditModule();
     public static InputStream getDocContentStream(com.filenet.api.core.Document doc) {
          ContentElementList docContentList = doc.get_ContentElements();
          Iterator iter = docContentList.iterator();
          InputStream stream = null;
          while (iter.hasNext()) {
               ContentTransfer ct = (ContentTransfer) iter.next();
               ct.set_RetrievalName("AuditDocTest"); // ASB Test Document name
               int docLen = ct.get_ContentSize().intValue();
               byte[] buf = new byte[docLen];
               stream = ct.accessContentStream();
               try {
                    stream.read(buf, 0, docLen);
                    String readStr = new String(buf);
                    System.out.println("Content: " + readStr);
               } catch (IOException ioe) {
                    ioe.printStackTrace();
               }
               System.out.println(" Element Sequence number: " + ct.get_ElementSequenceNumber().intValue() + " "
                         + "Content type: " + ct.get_ContentType() + " ");
          }
          return stream;
     }
}
Listing 2-3

The TestHarness Java class object

The integration with the IBM FileNet Event system is interfaced using the AddDocToFolder Event Java Class. This implements the abstract IBM FileNet Content Engine class, EventActionHandler, using the code listed as follows.
package com.ibm.filenet.p8.ce.eventhandlers;
import org.apache.log4j.Logger;
import com.filenet.api.core.Document;
import com.filenet.api.engine.EventActionHandler;
import com.filenet.api.events.ObjectChangeEvent;
import com.filenet.api.exception.EngineRuntimeException;
import com.filenet.api.util.Id;
import com.ibm.filenet.p8.ce.eventhandlers.codemodules.AuditModule;
public class AddDocToFolder implements EventActionHandler {
     private static Logger logger = Logger.getLogger(AddDocToFolder.class.getName());
     private static final String M_NAME = "AddDocToFolder";
     private AuditModule AMModule = new AuditModule(); //Construct a new Audit Master event handler
     public AddDocToFolder(){
          logger.debug(M_NAME + " Constructor");
     }
     public void onEvent(ObjectChangeEvent event, Id arg1) throws EngineRuntimeException {
          logger.debug(M_NAME + " Started");
          try {
               Document d = AMModule.getDocument(event);
               AMModule.addDocToFolder(d);
          }
          catch (Exception e){
               logger.error(M_NAME + " failed - " + e.getMessage(),e);
               EngineRuntimeException ere = new EngineRuntimeException();
               ere.setStackTrace(e.getStackTrace());
               throw ere;
          }
          finally {
               logger.debug(M_NAME + " Finished");
          }
     }
}
Listing 2-4

The AddDocToFolder Event Java Class object code

Add the FileNet 5.5.x jar libraries to the project AuditEventHandler, TestHarness class module run configurations:

Modulepath
Jace.jar
eeapi.jar
log4j-1.2.17.jar
pe.jar
peResources.jar
log4j.jar
Classpath
AuditEventHandler
JRE System Library[jre]
peResources.jar
pe.jar
log4j-1.2.17.jar
log4j.jar
Jace.jar
eapi.jar

A screenshot of the run configurations window for the test harness.

Figure 2-30

The TestHarness Run Configurations for the Classpath

This AuditModule Code Module contains one Event Handler class, addDocToFolder. This is passed the Case Audit Report document object to be filed in an AUDIT_TEST common Folder for ease of access to audits using the IBM Case Manager Audit Master solution.

The code loads the Audit Report class Document Objects with the String property, AUD_folder_Id_to_file_in, which contains the GUID of the Case Target Object Store’s AUDIT_TEST folder. The addDocToFolder Event Handler is triggered and causes a new DRCR (Dynamic Referential Containment Relationship Object) Folder link object to be created, which is the standard linking method to allow an IBM FileNet Folder to link in a many-to-many relationship with the FileNet Audit Report Document objects.

Custom Code Module Java JAR API Call Development

  1. 1.
    Confirm that the “CodeModules” folder exists. This is a root-level folder of class “Folder.” It only has one special attribute. It is a “hidden” folder and so is not visible in IBM Content Navigator. If this folder does not exist, create it as you would create any other folder, and then change its “isHiddenContainer” attribute as shown in Figure 2-31.

    A screenshot represents the code modules folder, with properties of four columns for the property name, property value, data type, and cardinality.

    Figure 2-31

    The CodeModules Folder isHiddenContainer property is set to True

     

Adding a Code Module

  1. 2.
    Create a new Document in this folder. Right-click the “CodeModules” folder in the tree view, and select “New Document.”

    A screenshot represents the code modules folder new document menu item highlighted and selected.

    Figure 2-32

    The CodeModules folder New Document menu item is selected

     
  1. 3.
    You will be presented with the AddDocument wizard. Enter a name (DocumentTitle) for the Document. We will see this later when we come to configure the Events. This will show as the name of the code module.

    A screenshot of a new document tab opened with document title as an input box and class with a dropdown menu with code module highlighted.

    Figure 2-33

    The Document title and Class of Code Module is selected

     
  1. 4.
    Select “Next>”, ensuring that the tick box is selected to indicate that the content is to be provided for the Code Module.

    A screenshot represents the next command in the java runtime environment code module. The next button is highlighted with the class input box highlighted and filled as code module.

    Figure 2-34

    The Next command is selected with the With content tick box ticked

     
  1. 5.
    On the next wizard page, use the “Add” button to select your jar file (fn_eventhandlers.jar).

    A screenshot represents the mime type java runtime environment code module, where the mime type is changed to application.

    Figure 2-35

    The mime type is changed to application/x-zip-compressed

     
  1. 6.

    Change the MIME type before adding the File.

     
You will need to enter this as application/x-zip-compressed.

A screenshot of the add content element pop up window with file name, browse and add content highlighted.

Figure 2-36

Click the Add button to add the compiled fn_eventhandlers.jar file

The Browse button is used to find the compiled fn_eventhandlers.jar file. On our Linux system, this is in the path /root/eclipse/java-2021-12/eclipse, but this is system dependent.

A screenshot represents the file upload window, the open button highlighted, and the file name f n event handlers dot jar also highlighted.

Figure 2-37

The Browse button shows the fn_eventhandlers.jar which is selected

The Open command button is then used to select the fn_eventhandlers.jar file for the Add Content button in Figure 2-36 to add into the Object store.

A screenshot represents the system to identify the java runtime environment code module, and also specifies the content elements.

Figure 2-38

The system identifies the Mime type as applicationjava-archive

On clicking the Next> command button, we see Figure 2-39.

A screenshot represents the system to identify the java runtime environment code module, and the add button is highlighted.

Figure 2-39

The Next button is clicked again

The Property values for the fn_eventhandlers Code Module are displayed; we just click the Next> command again (highlighted in Figure 2-40).

A screenshot of the new document window with property name, value, data type and cardinality input columns.

Figure 2-40

The Next> command is clicked (no changes are required here)

The next screen shows the Version property options for the document; in this case, we use the default options as shown in Figure 2-41.

A screenshot represents the new document window for the default version property, and the next button is highlighted.

Figure 2-41

The default Version property is used here

The Next> command shows the Retention time options for the document, which can be set to allow automatic removal after a selected time interval.

For this functionality, we use the default, which never deletes the document.

A screenshot of the next button being highlighted and clicked for the new document window.

Figure 2-42

The Next command is clicked to use the defaults

The next screen shows the Code Modules Storage area. We set this to the default using the drop-down highlighted in Figure 2-43 and then click the Next> command button.

A screenshot represents the default database storage area in the java runtime environment module.

Figure 2-43

The Default Database Storage Area is selected

Finally, we can create the AuditEventHandler Code Module by clicking the Finish command highlighted in Figure 2-44.

A screenshot represents the finish command that creates the code module document in J R E.

Figure 2-44

The Finish command creates the Code Module document

A screenshot of the status of a new document created, with an open and close button.

Figure 2-45

The status of the Document creation is displayed

The Code Module can now be seen in the CodeModules folder.

A screenshot represents the audit event handler from the folder code modules, and the table with eight columns of containment name, document name, date created, created by class, and major version number.

Figure 2-46

The AuditEventHandler Code Module is now ready to be used

Creating a Custom Event Object

Before the AuditEventHandler Code Module can be integrated as a new Custom Event in the OS2 Object Store for IBM Case Manager, it has to be linked to other Object Store objects. The first of these is the Event Object.

We will now create a new Event Object called AddDocToFolder.

You will need to perform the following steps for the Event:
  1. 1.
    In the acce tree view, expand “Events, Actions, Processes” and select “Event Actions.” Right-click “Event Actions” and select “New Event Action.” You will be presented with the “Name and Describe the Event Action” wizard.

    A screenshot represents the new event action from the event actions folder in the events, actions, processes main folder.

    Figure 2-47

    The New Event Action menu is clicked

     
The AddDocToFolder Display name and Description boxes for the event are entered as shown in Figure 2-48.

A screenshot represents the name and describes the event action wizard along with a list of event actions.

Figure 2-48

The “Name and Describe the Event Action” wizard

  1. 2.
    Select “Next.” In the “Name and Describe the Event Action” wizard page, enter “AddDocToFolder” in the name. The description is optional and defaults to the same as the name value. In this case, we select a slightly more detailed description.

    A screenshot represents the java class handler from the specified type of event action with status, event action type, and type.

    Figure 2-49

    The Java class handler full package name and class are entered

     
  1. 3.

    Select “Next.” On the next wizard page, enter the “Event Action Handler Java Class Name.” This value is as follows for the event:

     

com.ibm.filenet.p8.ce.eventhandlers.AddDocToFolder

and select the “Configure Code Module” checkbox shown in Figure 2-49.

A screenshot represents the load existing command button, to specify the code module in the new event action.

Figure 2-50

The Load Existing command button is clicked

  1. 4.
    Click “Next.” On the next wizard page, click the “Load Existing” button; you should see a list with the code module name we created in the “Create Code Module Step 2” earlier. Select this item.

    A screenshot represents the audit event handler code module in the select a code module, with ok and cancel buttons below.

    Figure 2-51

    The AuditEventHandler code module we created is selected to be used

     
  1. 5.
    Click OK.

    A screenshot represents the next command in specify the code module, from the new event action.

    Figure 2-52

    The Next command is selected

     
  1. 6.
    Click “Next.” The parameters to be run to create an Event Handler are displayed.

    A screenshot represents the finish to build the event handler object and summary with two columns for name and value.

    Figure 2-53

    Click Finish to build the Event Handler object and links

     
  1. 7.
    Click “Finish” to complete the wizard.

    A screenshot represents the status of the new event handler with start time, end time, and elapsed time.

    Figure 2-54

    The status of the New Event Handler creation process is shown

    A screenshot represents the add doc to the folder with a few columns titled; display name, is enabled, description, prog I D, creator, and date created and four rows.

    Figure 2-55

    The new AddDocToFolder Event Action is created in the OS2 Target Object Store

     

Configuring Workflow Subscriptions

Content Engine Objects, such as Folders and Documents, can subscribe to certain events and have the preceding “event action” code fire on these events. We will now describe how to subscribe the creation event of a Document of class “Audit Report” to the AddDocToFolder event action.

Note

The AddDocToFolder event code creates a link of the created Audit Report Document to the AUDIT_TEST folder that is defined.

  1. 1.
    In acce, select Classes ➤ Document ➤ Audit Report from the tree view.

    A screenshot represents the audit report class java customization workflow subscription in the object store.

    Figure 2-56

    The Audit Report class is navigated down to

     
  1. 2.
    Right-click the Audit Report class and select “New Subscription” from the context menu.

    A screenshot represents the new subscription java customization from the context menu for the audit report class.

    Figure 2-57

    Select “New Subscription” from the context menu for the Audit Report class

     
  1. 3.
    Enter the Subscription Name as AUD_AddDocumentToFolder and click “Next” on the “Create Subscription” screen.

    A screenshot represents the subscription name and description.

    Figure 2-58

    Enter the Subscription Name as AUD_AddDocumentToFolder

     
  1. 4.
    Select a name for the subscription that describes it for this type of object. This is because Event Actions can be used for multiple object types and for multiple events (Create, Update, etc.), and so well-named subscriptions are easier to understand and maintain.

    A screenshot represents the default of applies to all objects of this class is left, and next is highlighted.

    Figure 2-59

    The default of Applies to all Objects of this class is left; Next> is clicked

     
At this point, you can see that there is an option to Create a workflow subscription.
  1. 5.
    Click “Next.” The one or more system events (or custom events) can now be selected using tick boxes. We are just going to select the Document Object Creation Event.

    A screenshot represents new subscription window, where create event is selected for triggering the event handler.

    Figure 2-60

    The Creation Event is selected for triggering the Event Handler

     
  1. 6.
    On the “Select the Triggers” screen, select “Creation Event” from the list and click “Next.”

    A screenshot represents the back, next, finish, and cancel options at the top, as well as selecting an event action and adding a doc to the folder event handler action created.

    Figure 2-61

    The AddDocToFolder Event Handler action we created is selected

     
  1. 7.
    Click “Next.” On the “Specify an Event Action” page, select “AddDocToFolder” from the drop-down.

    A screenshot represents the enable the subscription tick box, and the next button is clicked.

    Figure 2-62

    The Enable this subscription tick box is selected, and Next> is clicked

     
  1. 8.
    Select “Next.”

    A screenshot represents the finish command to build the event action subscription with a summary and two columns for name and value.

    Figure 2-63

    The Finish command is clicked to build the Event Action Subscription

    A screenshot of the O S 2, code modules, audit report, and new subscription in the A U D add the document to folder subscription is created.

    Figure 2-64

    The AUD_AddDocumentToFolder Subscription is created

     

Click Finish. The preceding screen is displayed showing the status of the AUD_AddDocumentToFolder New subscription creation.

This subscription can now be tested by creating a document of class “Audit Report.” Once created, you should see the Document linked to the AUDIT_TEST folder.

Creating the fn_eventshandler.jar

The following steps were used to create the fn_eventshandler.jar, Events Handler jar file, which we used in the previous section, from the Eclipse Project.

A screenshot represents the eclipse file in the export menu selected for the audit event handler java project.

Figure 2-65

The Eclipse FileExport menu option is selected for the AuditEventHandler Java project

In the Eclipse Java IDE tool, we can export the Project classes and supporting files to the fn_eventshandler.jar file we need for integration with IBM Case Manager.

A screenshot represents the java from J A R file export wizard option selected and the next command is clicked.

Figure 2-66

The Java ➤ JAR file export wizard option is selected, and the Next> command is clicked

The Eclipse Java JAR file export wizard is selected and the Next> command is clicked as shown in Figure 2-66.

A screenshot represents the audit event handler project selected with the classpath and project attributes included.

Figure 2-67

The AuditEventHandler project is selected with the classpath and project attributes included

The defaults shown in Figure 2-67 are selected for the AuditEventHandler project. Then the Browse button is used to choose the exported JAR file destination path.

A screenshot depicts the home, documents, downloads, music, pictures, videos, eclipse, and other locations on the left, as well as configuration, drop ins, plugins, and readme.

Figure 2-68

The Browse button allows the Folder Path and the export JAR file name to be entered

The default Eclipse path shown in Figure 2-68 was used with the file name entered as fn_eventhandlers.jar.

A screenshot represents the finish command that is clicked to create the jar file.

Figure 2-69

The Finish command button is clicked to create the fn_eventhandlers.jar file

Part 3 – Testing the Add Document to Folder Event

The TestHarness code in the Eclipse project requires a valid Document Object to be used to link to an existing AUDIT_TEST folder which we need to create, and also we need to note the Object Id property values which identify them. These Id property values uniquely identify Folder and Document objects in the IBM FileNet Target Object Store which is used by the IBM Case Manager system.

A screenshot represents the I B M administrative console login for content, user name and password, and login command.

Figure 2-70

Log in to the IBM FileNet acce administration web application tool

In acce, the IBM Administrative Console for Content Platform Engine, we can create Folder objects, import and view Document and property template classes, and identify the Document Id values for a specific Object Store class object.

A screenshot represents the audit report document from data design in the object store.

Figure 2-71

The Audit Report document class Properties tab is highlighted in acce

The IBM Case Builder web application of the IBM Case Manager system can also be used to create new Document Classes and their related properties. We will create the new property with the symbolic name, AUD_folder_Id_to_file_in.

A screenshot represents the I B M case manager builder with audit master, auto claims, and A S B test.

Figure 2-72

The Audit Master solution created in Chapter 1 is edited again

We are going to add the property as a Global Solution property template as follows.

A screenshot represents the audit master, with add property in the new drop down menu, selected.

Figure 2-73

The Add Property ➤ New menu item is selected on the Solution Properties tab

We select to add a New property and enter the property details shown in the screen in Figure 2-74.

A screenshot illustrates the option to add a New property and enter the property details on the screen with the newly created Symbolic name.

Figure 2-74

The property with the SymbolicName AUD_folder_Id_to_file_in is created

A screenshot represents the property with name, type, attributes, and description in the audit master solution.

Figure 2-75

The property can be seen displayed in the Audit Master solution

Next, we need to add this new property to the Audit Report Document class so we can programmatically read the Folder Id string property from it and so identify the Folder to link the Audit Report class documents to. (This is the function of the Java Event program we have developed, which is now available in the Target Object Store.)

A screenshot represents the property tab of the audit report document class selected in the audit master.

Figure 2-76

The Properties tab of the Audit Report Document class is selected

A screenshot illustrates the add property drop down, and the existing folder is opened, to display properties created.

Figure 2-77

The Add Property drop-down is used to select the Existing folder_id_to_file_in property we created

The new Audit Report Document class, folder_id_to_file_in class property, is now defined in the updated Audit Master solution. Now we need to redeploy the Audit Master Solution (stored in the IBM Case Manager Design Object Store, OS1) to the working Target Object Store (OS2). This process will update the existing Audit Report document class with the new property we have created.

A screenshot represents the name, type, attributes, and description in columns for the audit report document.

Figure 2-78

The Audit Report Document class can be seen to have the new folder_id_to_file_in property

After we save and close the changes to the Audit Master solution, we use the Redeploy All menu option shown in Figure 2-79.

A screenshot represents the redeploy all menu option used in the I B M case manager builder to deploy the updated solution.

Figure 2-79

The Redeploy All menu option is used in the IBM Case Manager Builder to deploy the updated solution

A screenshot represents the deploy command button to start the audit master solution redeployment in the confirmation.

Figure 2-80

The Deploy command button is clicked to start the Audit Master Solution redeployment

If there are changes edited into the Audit Master solution, and these are not deployed, a yellow warning triangle appears below the green tick mark icon.

This yellow warning triangle disappears after a successful redeployment.

A screenshot represents the audit master and auto claims. The audit master solution is successfully redeployed to the O S 2 target objected store.

Figure 2-81

The Audit Master solution is successfully redeployed to the OS2 Target Object store

Now we create the AUDIT_TEST folder in the OS2 Target Object store using the IBM FileNet acce web application tool. We right-click the Root Folder node and select the New Folder menu option to show a New Folder tab as shown in Figure 2-82.

A screenshot represents the audit test folder created in the O S 2 target object store under the root folder.

Figure 2-82

The AUDIT_TEST folder is created in the OS2 Target object store under the Root Folder

A screenshot represents the next command used to leave the default retention options.

Figure 2-83

The Next> command is used to leave the default Retention options

The Finish command is used, as shown in Figure 2-84, to create the Folder AUDIT_TEST, which we will use to hold links to all the Audit Report case Documents of the Audit Master solution.

A screenshot represents the finish command in the new folder with a summary, and two columns for name and value to create an audit test.

Figure 2-84

The Finish command is used to create the AUDIT_TEST folder

The status window shows the Date and Time of the folder creation and the time taken.

A screenshot represents the status of the new folder of the audit test in the java customization testing document in the object store.

Figure 2-85

The status of the New Folder creation of AUDIT_TEST is shown

We now need to find and display the unique Id of the AUDIT_TEST folder object we created and use this in our TestHarness Java program to test the functionality of our AddDocToFolder Event Java Class.

A screenshot represents the I D property of the audit test folder which is displayed.

Figure 2-86

The ID property of the AUDIT_TEST folder is displayed

The AUDIT_TEST folder ID string value is found to be {896F3369-7AF8-405E-85A7-3E18F90ACE43} for the Object Store I am using and can be copied and pasted to the TestHarness Java program to run a test in the Eclipse Java IDE. First, we need to create an Audit Department Case to use for the Tests.

A screenshot represents the cases and work tab. The add the case, search folder, and the new case is created using the add case dropdown.

Figure 2-87

A new Case is created using the Add Case drop-down

A screenshot represents the case description.

Figure 2-88

The Case description is added

The case is searched for using the % wildcard for the Case Identifier as shown in Figure 2-89.

A screenshot represents the search button in cases of the I B M case manager.

Figure 2-89

A Search shows that this case is the first Case entered in the system

Since we have redeployed the Solution, this case is now the first Case entered in the system.

A screenshot represents the A U D audit department name, number, completion date, and audit object details entered for the case.

Figure 2-90

The Audit Department Audit details are entered for the Case

To test that an Audit Report Document is created, we use the Add ➤ Add Document from Local System option shown in Figure 2-91.

A screenshot represents documents, tasks, and history tab. The add a document from the local system option is selected for the case audit report document.

Figure 2-91

The Add Document from Local System option is selected for the Case Audit Report document

A screenshot represents the audit report class of the document selected and the ok and cancels buttons.

Figure 2-92

The highlighted Audit Report class of Document is selected from the drop-down choice

The Audit Report Document class is selected as shown for our test.

A screenshot represents the p d f document for the document content using the browse command.

Figure 2-93

A pdf document called AC.pdf is selected for the Document content using the Browse command

We can now enter the Audit Report Document Class properties, which now include our AUDIT_TEST folder Id string in the folder_id_to_file_in property.

A screenshot represents the properties of the audit report class, document title, number, name, and manager, of the I B M case manager.

Figure 2-94

The Audit Report Document class properties are entered and committed using the Add command

A screenshot represents the A C p d f document. The filename is highlighted and added to the case.

Figure 2-95

The AC.pdf document (highlighted) is added to the Case

We can now run the TestHarness Java program in the Eclipse IDE and use the unique SymbolicName property AUD_folder_Id_to_file_in String value, {896F3369-7AF8-405E-85A7-3E18F90ACE43}, to link the test document to the AUDIT_TEST folder.

A screenshot represents the folder I D in the A C p d f properties.

Figure 2-96

The Folder Id {896F3369-7AF8-405E-85A7-3E18F90ACE43} is in the AC.pdf Properties

We also need to manually add the AC.pdf example file’s Audit Report Document class Id to the TestHarness code to allow it to locate and link the document. In the live usage of the Event Handler, the Custom Event subscription automatically passes the Document’s Id to the Event Java module.

A screenshot represents the detail of the A C p d f document. The Property name and value are highlighted.

Figure 2-97

Detail of the AC.pdf Document Property ID is shown highlighted

The Test Document ID for the AC.pdf file shown earlier is {00D14A81-0000-C31E-A7D2-F2B7CF2D4803}; this is then entered into the TestHarness code.
           //The Test Document ID for AC.pdf file is {00D14A81-0000-C31E-A7D2-F2B7CF2D4803}
           private void test_AddDocToFolder() throws Exception {
                l4j.debug("test_AddDocToFolder");
                Document d = (Document) os.getObject("Document", "{00D14A81-0000-C31E-A7D2-F2B7CF2D4803}");
                am.addDocToFolder(d);
           }
Listing 2-5

The test_AddDocToFolder Java Class code

In the preceding code, the Document, AC.pdf, is retrieved into the Java Object d, which is an Audit Report FileNet Content Engine Document class. The document now has the Id of the AUDIT_TEST folder it is to be linked to.

A screenshot represents the display value option with indexation I D, and the current version is true or false.

Figure 2-98

The Display Value option allows a unique Id to be copied and so can then be pasted

A screenshot represents the display value with options undo, cut, copy, paste, delete, and so on. The close button is at the bottom.

Figure 2-99

A unique Id can be selected for copy in acce by using the drop-down menu Copy item (highlighted)

The TestHarness.java code is shown in Figure 2-100.

A screenshot represents the test harness java code which includes the exception handling instructions block.

Figure 2-100

The TestHarness.java program

For the code block, see Listing 2-3 listed in the section “Configuring Java Components for Content Engine Events.”

In order to successfully run the TestHarness.java, we have to ensure the Classpath for the Run configurations option of the TestHarness.java program contain the references to all the .jar files it references.

A screenshot represents the test harness run configuration menu item selected to set the required classpath.

Figure 2-101

The TestHarness Run Configurations… menu item is selected to set the required Classpath

In order to run the TestHarness program without “Class Not Found” Java errors, we need to check that all the program dependencies, including the required supporting Java library files, are on the Classpath.

A screenshot represents the dependence tab selected.

Figure 2-102

The Dependencies tab is selected

A screenshot represents the list of classpath j a r files. The classpath entries are highlighted.

Figure 2-103

The list of Classpath .jar files we used is shown highlighted

After running the TestHarness program, we can see that the AC.pdf file has been successfully linked to the AUDIT_TEST folder in the OS2 target object store Content Store.

A screenshot represents the A C p d f file that appears linked to the audit test folder.

Figure 2-104

The AC.pdf file appears linked to the AUDIT_TEST folder

During the initial TestHarness program runs, we noticed that we get Java log4j warnings about a missing appender. This requires us to initialize the log4j system which we are using to send debug output (and which the IBM FileNet API jar file, jace.jar, also uses to log messages for debug).

A screenshot represents the new s r c selection, where other option is used to create a log 4 j dot x m l configuration file and the log 4 j dot d t d file.

Figure 2-105

The NewOther option is used to create a log4j.xml configuration file and the log4j.dtd file

The src folder needs to be updated with a log4j.xml and log4j.dtd file for configuring the logger commands.

A screenshot represents the logger warn messages in the java customization testing folder event to define appenders.

Figure 2-106

The logger WARN messages indicate that we need to add a log4j.xml file to define appenders

A screenshot represents the general, file option in the java customization testing document from the select a wizard window.

Figure 2-107

The GeneralFile option is selected for adding the log4j.xml file

The file is expected to be called log4j.xml with an XML format with standard tags to define the appenders.

A screenshot represents the create a new file resource with the file name log 4 j dot x m l entered in the folder.

Figure 2-108

The log4j.xml file name is entered

A screenshot represents the standard x m l file in the java customization testing document with a set of instructions.

Figure 2-109

The XML for the standard log4j.xml file content is shown

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd" >
<log4j:configuration>
     <appender name="stdout" class="org.apache.log4j.ConsoleAppender">
          <layout class="org.apache.log4j.PatternLayout">
               <param name="ConversionPattern" value="%m%n" />
          </layout>
          <filter class="org.apache.log4j.varia.LevelRangeFilter">
             <param name="levelMin" value="DEBUG" />
            <param name="levelMax" value="INFO" />
        </filter>
      </appender>
     <appender name="rfa" class="org.apache.log4j.RollingFileAppender">
         <param name="file" value="/opt/filenet_app.log"/>
         <param name="MaxFileSize" value="100KB"/>
         <!-- Keep some backup files -->
         <param name="MaxBackupIndex" value="10"/>
         <layout class="org.apache.log4j.PatternLayout">
                <param name="ConversionPattern" value="%p %t %c - %m%n"/>
         </layout>
         <filter class="org.apache.log4j.varia.LevelRangeFilter">
             <param name="levelMin" value="WARN" />
            <param name="levelMax" value="FATAL" />
        </filter>
       </appender>
     <logger name="com.ibm.filenet.ce" additivity="false">
          <level value="debug" />
          <appender-ref ref="rfa" />
          <appender-ref ref="stdout" />
     </logger>
     <logger name="filenet_error.api.com.filenet.apiimpl.util.ConfigValueLookup" additivity="false">
          <level value="debug" />
          <appender-ref ref="rfa" />
          <appender-ref ref="stdout" />
     </logger>
     <logger name="filenet_tracing.api.detail.moderate.summary.com.filenet.apiimpl.util.ConfigValueLookup" additivity="false">
          <level value="debug" />
          <appender-ref ref="rfa" />
          <appender-ref ref="stdout" />
     </logger>
</log4j:configuration>
Listing 2-6

The log4j.xml file content

We have entered the content for the log4j.xml and also a standard log4j.dtd from the apache download site.

A screenshot represents the x m l file from the apache download site and the contents are saved using the eclipse file save command.

Figure 2-110

The log4j.xml file and contents are saved, using the Eclipse file Save command

But, after saving the log4j.xml and rerunning the TestHarness program, we still get the following warnings.

A screenshot represents the logger appender and the class name is highlighted.

Figure 2-111

The logger appender is still requested and displays the highlighted class

As highlighted in Figure 2-111, we need to add the appender for the filenet_error.api.com.filenet.apiimpl.util.ConfigValueLookup class to the log4j.xml file.

A screenshot represents the set of instructions where appender x m l is highlighted.

Figure 2-112

The highlighted appender XML is added which corrects the WARN messages

Next, we re-export the fn_eventhandlers.jar file which now includes the updated log4j.xml and log4j.dtd files.

A screenshot represents the file, the export command used to create an updated f n event handlers dot j a r file.

Figure 2-113

The FileExport command is used to create an updated fn_eventhandlers.jar file

A screenshot represents the J A R file from the export wizard in the java customizations testing document, and the next command i d clicked.

Figure 2-114

The JavaJAR file export wizard is selected, and the Next> command is clicked

A screenshot represents the full path to the f n event handlers, the j a r file is selected and the finish is clicked.

Figure 2-115

The full path to the fn_eventhandlers.jar file is selected, and Finish is clicked

The updated fn_eventhandlers.jar file created earlier is shown in the Linux folder path in Figure 2-116.

A screenshot represents the compiled jar file java customizations testing document, and the file is in the Linux eclipse folder.

Figure 2-116

The compiled fn_eventhandlers.jar file is shown in the Linux Eclipse folder

We can now retest the Audit Solution cases.

Retest results of the Audit Master solution updates are shown in Figure 2-117.

A screenshot represents the test audit events document linked to the audit test folder which has a contents table, with containment name, document name, date created, created, class, major and minor version number.

Figure 2-117

The Test Audit Events document is linked to the AUDIT_TEST folder by the Event call

A screenshot of I B M case manager opened in Mozilla Firefox. It represents the settings for general and properties. It highlights the button to browse the P D F file, the document title, the folder I D to file in, and the add button at the end.

Figure 2-118

A second test Audit Report class Case document is added to the Case

We can add multiple documents of type Audit Report to the same Audit Department case, and they should also appear in the AUDIT_TEST folder.

A screenshot of I B M case manager opened in a browser. It represents the available files in the case details with business objects tab. It highlights a file named, audit event test version 2.

Figure 2-119

The highlighted document is shown saved in the case

In the AUDIT_TEST folder, we now also see the same highlighted document appear linked. We should emphasize here that this is a single document version copy with links in multiple folders.

A screenshot of the administration console opened in Mozilla Firefox. It highlights the files under the audit test folder. A table at the right represents the containment name, document name, creation date, class, and version numbers.

Figure 2-120

The test successfully shows the Audit Report document highlighted appearing

In the preceding examples we tested, we have manually added the Folder Id, for AUDIT_TEST folder, which is the string GUID, {896F3369-7AF8-405E-85A7-3E18F90ACE43}, to the Audit Report Document class String property, folder_Id_to_file_in (with the full unique Id, AUD_folder_Id_to_file_in).

However, we have the option to set this Folder Id as a default value for the folder_Id_to_file_in property of the Audit Report document class by editing it into the Audit Master solution. What is more interesting is that the default value stored in this way could be set differently for different Document classes, which would open up the possibility of automatically filing different types of documents in different folders, using the same Java code module we have created. We will now show this just for the Audit Report document class at the moment.

A screenshot of the I B M case manager builder opened in a browser. It highlights a text, audit master.

Figure 2-121

Click the Audit Master solution highlighted to open the IBM Case Builder editor

The IBM Case Builder web application can now be used to modify our initial Audit Master solution again.

A screenshot of the I B M case manager builder opened in a browser. It highlights the document tab in the Audit master solution editor.

Figure 2-122

Select the Documents tab of the Audit Master Solution editor

A screenshot of the Audit master solution editor opened in a web browser. It highlights the audit report under the button to add document class.

Figure 2-123

Select the Audit Report Document Class to update the properties

We can now update the folder_id_to_file_in property of the Audit Report Document class by selecting the Properties tab, and using the mouse-over, we can see the Edit icon (highlighted in Figure 2-124).

A screenshot of the Audit master editor opened in a web browser. It highlights the edit icon under the table consisting of the details of the name, type, attribute, and description of the audit report.

Figure 2-124

The folder_Id_to_file_in property of the Audit Report Document class is edited

Now, we can set the Default value for the folder_Id_to_file_in property to the AUDIT_TEST folder Id property value (which is the string GUID {896F3369-7AF8-405E-85A7-3E18F90ACE43}).

A screenshot of a table comprising the details of the name, type, attributes, and description of the audit report. It highlights the ok button and a checkbox alongside the text, hidden.

Figure 2-125

The Default value of the folder_id_to_file_in property is set to {896F3369-7AF8-405E-85A7-3E18F90ACE43}

In addition, notice that there is a Hidden boolean option available (highlighted) for properties, which we could utilize if required, so that a normal user would not even be aware that this property existed. The Audit Reports would appear “as if by magic” to this user in the AUDIT_TEST folder!

A screenshot represents the buttons for the locked items naming, validate, save, save and close, and close. It highlights the save and close button.

Figure 2-126

The Audit Master Solution is updated with the Save and Close command button

Having updated the Audit Master solution again, we can now deploy the changed solution as shown in Figure 2-127.

A screenshot represents 2 blocks titled Audit master and Auto claims. It highlights the deploy icon in the audit master. A box at the bottom reads the following, deploy the changed solution artifacts into a test environment.

Figure 2-127

The Deploy icon can be clicked to redeploy the solution we updated

A Confirmation pop-up dialog window is then displayed as shown in Figure 2-128.

A screenshot of a box titled confirmation. It comprises a table with the names of the solutions. It highlights the deploy button and a checked box beside the following text, commit my changes and make them available for deployment.

Figure 2-128

The Deploy command is used to redeploy the edited Audit Master solution

A screenshot of a box titled audit master along with the details about the modifier and modification date. It highlights a green tick mark at the top left corner.

Figure 2-129

The green tick icon highlighted shows the Audit Master solution is successfully deployed

On adding an Audit Report document class to a new Case now, we automatically have the folder_Id_to_file_in property filled with the AUDIT_TEST folder Id value.

A screenshot of I B M case manager opened in a browser. It represents the options under general and properties, It highlights the folder I D to file in, under the properties option.

Figure 2-130

The folder_Id_to_file_in property is now filled automatically with the default value

A screenshot of I B M case manager opened in a browser. It represents the filled details of the document title, department number, department name, department manager, and folder i d under the properties option.

Figure 2-131

A new Automatic Folder ID added Audit Report Document is added to test the Event Handler

A screenshot of the I B M case manager opened in a browser. It represents the details of a document under the case details with business objects tab. It highlights the save and close buttons at the top.

Figure 2-132

The saved document appears in the Audit Master case

In the preceding screen, it should be noted that the Auditor can be still actively using the Case, in the IBM Case Manager application, because as soon as the system detects the Create Event for the Audit Report document class, it will appear (on selecting the Refresh command) in the acce web application shown in Figure 2-133.

A screenshot of the I B M administrative console opened in a browser. It represents a table comprising the containment and document names, creation date, and version numbers under the audit test folder. It highlights a document naming, automatic folder I D added.

Figure 2-133

The Audit Report document is also found linked to the AUDIT_TEST folder

In summary, the Audit Report Document class Creation Event triggers the AddDocToFolder Java EventHandler, a Class in the fn_eventhandlers.jar (which is registered as a Code Module in the OS2 Object Store). This links the new Audit Report document of class type AUD_AuditReport to the AUDIT_TEST folder using the property AUD_folder_Id_to_file_in which contains the unique ID (GUID) of the AUDIT_TEST folder.

This functionality can then be used to automatically provide a second link to all the Audit Report case documents, which can then be viewed centrally in one Folder location.

Part 4 – The DbExecute Workflow Step for Calling Database Stored Procedures

One other integration we cover in this chapter is the DbExecute workflow step. This allows a Database Stored procedure to be invoked from an IBM Case Manager Workflow step. This is supported using the IBM FileNet P8 Process Designer tool. This tool is available as a .jar applet and also a standalone Java program version running on Windows as a client application linked to the IBM Case Manager server.

The IBM Auto-Claims Case Manager Solution Example

The following free download covers the example DB2 Stored Procedure for an Insurance Company, IBM Case Manager Auto Claims Solution:

https://doi.org/10.13140/RG.2.2.16987.52008

“Importing Case Manager Solution Auto Claims example into Case Manager 5.3.3 on RHEL 8.0”

A screenshot represents a box with the following title. importing case manager solution auto claims example into the case manager. There are buttons to download and read the file at the bottom.

Figure 2-134

The free download Document web page for details of a DB2 Stored Procedure development

There are several points of integration with the IBM FileNet P8 Process Designer for building an IBM Case Manager workflow, shown in this section.

Methods of Displaying a Case Type Task Workflow

Figure 2-136 highlights the web-based Process Designer applet menu, which can be launched for the development of the Solution Case Type Workflow tasks used to process and display active Cases to Auditors and Case Administrators.

A screenshot of the audit master represents a context menu highlighting the option to open FileNet P 8 process designer.

Figure 2-135

The IBM Case Builder Solution display web page, with the link for FileNet P8 Process Designer

There is also a graphical view available of the same workflow as used in FileNet P8 Process Designer, which can be displayed in the IBM Case Builder web application tool as follows.

First, we load the Audit Master solution by clicking the blue Audit Master link shown in Figure 2-135.

A screenshot of the I B M case manager builder opened in a browser. It represents the add case type button under the case types tab.

Figure 2-136

The Case Types tab is selected from the Audit Master solution IBM Case Builder view

  1. 1.

    We then click the Audit Department Case type shown earlier to display the attributes of the Case Type as shown in Figure 2-137.

     
  2. 2.
    From here, we select the Tasks option from Audit Department Case Type menu options.

    A screenshot of the I B M case manager builder opened in a browser. It represents a list of options under case type attributes. It highlights the tasks option under the case type in the left pane.

    Figure 2-137

    The Audit Department type is double-clicked to access the Case Type attributes

     

The Figure 2-137 screen has a drop-down which allows a document loaded into the IBM OS2 Target Object Store to automatically invoke the Audit Master solution Audit Department task workflow, if we select a Starting document class from the drop-down shown earlier. For the moment, we will leave the default option, which is to start the Audit Department Task manually from each Case, when this is required.

The Tasks option Audit Process page is shown in Figure 2-138.

A screenshot of the I B M case manager builder opened in a browser. It represents the options under the tasks menu. It highlights an icon under the required tasks section labeled, Open FileNet p 8 process designer.

Figure 2-138

The highlighted icon can be selected to launch the IBM FileNet P8 Process Designer applet

Now, we have two options to view the Workflow here. The first option, shown in Figure 2-138, launches the IBM FileNet P8 Process Designer as an embedded Java Applet. (But see later why this is rarely able to be used!)

The Case Builder Workflow Step Designer Application

The second option is to use the Step Designer, shown using the highlighted icon in Figure 2-139.

A screenshot of the I B M case manager builder represents the available options under the tasks menu. It highlights an icon under the required tasks section labeled, edit steps.

Figure 2-139

The Edit Workflow steps option can be selected using the highlighted icon

Clicking the icon highlighted in Figure 2-139 gives the Task Workflow, Step Designer, a high-level Workflow design page for the IBM Case Builder, shown in Figure 2-140.

A screenshot of the I B M case manager builder represents the Step Designer page containing various options under the palette menu. A text at the bottom reads, drag and drop swim lanes into this workspace.

Figure 2-140

The Task Workflow Step Designer page is displayed using the Edit Steps icon

The Palette on the left-hand side of the screen, shown in Figure 2-140, of the Workflow Step Designer contains different types of Workflow step and Role Lanes which can be dragged and dropped using the mouse to the right-hand pane in the dragged lanes which are then defined for each Security Role.

Unfortunately, in our requirement, for which we wish to use the DbExecute step (which is a Stub Step dragged into the System Lane), the details of the DbExecute step have to be entered using the IBM FileNet P8 Process Designer Java program.

A screenshot of the I B M case manager builder represents the Step Designer page containing various options under the palette menu. It highlights the stub step option and the description of stub step properties.

Figure 2-141

The Stub Step1 is dragged into the System Lane

The Process Designer Plugin Applet in IBM Content Navigator

The next option for accessing the IBM FileNet P8 Process Designer is to configure the access from the IBM FileNet Content Navigator web application, using the IBM FileNet P8 Process Designer plugin applet.

This is accessed using the link from our IBM Content Navigator web application server, ecmukdemo6, using the URL:

http://ecmukdemo6:9081/navigator/?desktop=admin

A screenshot of the I B M content navigator page opened in a browser. It highlights the content navigator path in the address bar, and the user name, password, and login button on the page.

Figure 2-142

The login screen for the IBM Content Navigator web application

After logging in to the IBM Content Navigator web application tool shown in Figure 2-142, we can select the Plug-ins menu item as follows.

A screenshot of the I B M content navigator page. It highlights the plug-ins option in the left pane and the new plug-in button under the plug-ins tab on the main context page. A table contains the name and version of the plugins at the bottom.

Figure 2-143

The New Plug-in command is selected from the Plug-ins administration menu

The Content Platform Engine CPEAppletsPlugin.jar file is available by downloading it from the installed Content Platform Engine server (ecmukdemo6) using the URL:

http://ecmukdemo6:9080/peengine/plugins/CPEAppletsPlugin.jar

A screenshot of a new tab opened in the Mozilla Firefox browser. It highlights a file path in the address bar, along with the save file and ok buttons in a dialog box on the page.

Figure 2-144

The CPEAppletsPlugin.jar file is downloaded for access by the IBM Content Navigator admin

The Content Platform Engine CPEAppletsPlugin.jar file is then available from the /root/Downloads Linux directory path for use.

A screenshot represents the downloaded C P E applet plug-in file with the status and size of the file.

Figure 2-145

The Content Platform Engine CPEAppletsPlugin.jar file

A screenshot represents the location of the downloaded C P E Applets plugin file in the library.

Figure 2-146

The CPEAppletsPlugin.jar file is downloaded to the /root/Downloads folder

The downloaded CPEAppletsPlugin.jar file name and path have to be manually typed into the selected admin JAR File path as /root/Downloads/CPEAppletsPlugin.jar to Load it from the Linux directory as shown in the highlighted screenshot in Figure 2-147.

A screenshot of the I B M content navigator highlights the jar file path for the C P E applets plug-in. It also highlights the load button alongside.

Figure 2-147

The Load command is clicked to import the /root/Downloads/CPEAppletsPlugin.jar file

The loaded CPEAppletsPlugin.jar file displays the Version details and the contained Actions available.

A screenshot of the I B M content navigator represents the details of the I B M content platform engine applets support. it includes the name, version, actions, repository type, viewers, features, and layout details of the plug-in.

Figure 2-148

The details of the CPEAppletsPlugin.jar are displayed after loading

The CPEAppletsPlugin.jar security must be changed before loading as follows.

We can use the Linux command:
chmod 775 CPEAppletsPlugin.jar
Without this, there will be Load errors in the Content Navigator web application.

A text document presents the command to change the security.

Figure 2-149

The security is changed using the Linux command cmod 775 CPEAppletsPlugin.jar

On refreshing the desktop, the Plug-ins tab page should now have the highlighted IBM FileNet P8 Process Designer and Process Tracker Actions plugin:

A screenshot of the I B M content navigator represents a table with the name and versions of the plug-ins. It highlights the I B M content platform engine applets support with version 5.5.0.

Figure 2-150

The IBM FileNet P8 Process Designer and Process Tracker Actions plugin

The next step is to select the IBM Content Navigator Repositories menu highlighted as follows, in order to create new connections to the IBM Case Manager Design (OS1) and Target (OS2) Object stores.

A screenshot of the I B M content navigator page highlights the repositories option in the left pane.

Figure 2-151

The Repositories (IBM FileNet Object Store) menu is selected

A New Repository connection can be added using the FileNet Content Manager drop-down option.

A screenshot of the I B M content navigator page highlights the FileNet content manager option under the context menu of the new repository tab.

Figure 2-152

The New RepositoryFileNet Content Manager menu option is selected

The connection parameters are then filled out as highlighted in Figure 2-153.

A screenshot of the I B M content navigator page highlights the general data of the new repository including, the name, I D, protocol, server U R L, and object store names along with the connect button at the end.

Figure 2-153

The new Repository connection parameters are filled out

The EJB connection string is used, iop://ecmukdemo6:2809/FileNet/Engine.

The user login credentials for access to the IBM FileNet P8 OS2 Content Object store are prompted for.

A screenshot of a login box with the filled-in details of the user name and password along with the buttons to log in and cancel at the bottom.

Figure 2-154

The login to OS2 is prompted for

On acceptance of the credentials by the IBM FileNet Content Manager system, the list of tabs is enabled for configuration. We need to select the Configuration Parameters tab shown in Figure 2-155.

A screenshot of the I B M content navigator page highlights the configuration parameters tab under the new repository option.

Figure 2-155

The tabs are all enabled, and we can now select the Configuration Parameters tab

We now have to enable the Display workflow definition class option shown on the next screen.

A screenshot of the I B M content navigator page highlights the represent workflow definition class and a radio button labeled yes, under the configuration parameters.

Figure 2-156

The highlighted Display workflow definition class option is selected as Yes

The preceding procedure is repeated to add the OS2 repository.

A screenshot of the I B M content navigator page highlights the O S 2 repository in the table containing the name, I D, server type, and server name of the repositories.

Figure 2-157

The OS2 repository is configured

The Copy option can be selected for the Default repository folder context menu.

A screenshot represents the selected default repository folder context menu under the menus tab. It highlights the copy button on the page.

Figure 2-158

The menu option named Default repository folder context menu is copied

This is a template menu which is found by scrolling down to the highlighted position shown in Figure 2-159.

A screenshot of the I B M content navigator page represents a table with details of the name, I D, type, and description of the menus. It highlights the default repository folder context menu.

Figure 2-159

The highlighted menu template is copied for configuration

The copied menu now shows the Open Process Designer and Open Process Tracker menu actions.

A screenshot of the I B M content navigator page represents the details about the name, I D, description, and the type of the new menu. It highlights 2 items named, open process designer and open process tracker.

Figure 2-160

The new Open Process Designer and Open Process Tracker menu items are added

The highlighted arrow key in Figure 2-160 is used to copy the selected Open Process Designer and Open Process Tracker options, and then their positions can be edited using the up/down arrow keys on the right of the panel to change the menu item order.

A screenshot of the I B M content navigator page highlights the save and close button along with 2 items in the selected section naming, open process designer, and open process tracker, under the new menu tab.

Figure 2-161

The menu items are shown transferred to the copied menu item list

Configuring the DbExecute Connection

In order to call the DbExecute step from a Task Workflow, calling a database stored procedure, we have to log in to the IBM FileNet Content Manager acce administration tool and create a DbExecute connection using the highlighted tab in Figure 2-162.

A screenshot highlights the workflow system on the left pane and D b Execute Connections and new tabs on the main content page at the right.

Figure 2-162

The DbExecute Connections tab on OS1 is selected, and the New command button is clicked

The Design Object Store OS1 does not have any DbExecute Connections.

The Target Object Store OS2 already has a DbExecute connection which we set up for the standard IBM Auto Insurance Claims example solution.

A screenshot represents a table with name, database type, and J D B C driver U R L under the D b Execute Connections tab. it highlights the demo D B and its driver U R L from the table.

Figure 2-163

The IBM Auto Insurance Claims example solution DbExecute connection

The Edit command shows the example connection parameters as shown in Figure 2-164.

A screenshot represents the options to edit D b Execute connection with connection name, database type, database name, host, port, along with database user name, and database password.

Figure 2-164

The Edit DbExecute Connection for the Auto Claims Solution is displayed

The Additional Desktop Components for IBM Content Navigator are also changed to enable the display of the Global toolbar.

A screenshot represents the options under the additional desktop components. It highlights the represent radio button for the global toolbar.

Figure 2-165

The Global toolbar settings are changed to show the Process Designer plugin menu actions

In the Advanced settings of the IBM Case Manager administration client desktop, we must also select the tick box to “Enable the desktop for FileNet P8 workflow email notifications,” as shown in Figure 2-166.

A screenshot of the I B M case manager administration client page highlights a checkbox beside the following text, enable the desktop for FileNet P B workflow email notification.

Figure 2-166

The option to enable the IBM Case Manager administration client desktop to display emails

Figure 2-167 is a zoom in to show the mouse-over information against this option.

A screenshot highlights a checkbox beside the following text, enable the desktop for FileNet P B workflow email notification. It represents the details of the item.

Figure 2-167

The details of the Information icon help for the option are displayed on mouse-over

A screenshot highlights the C P E Process Designer menu under the feature context menus of the process designer tab.

Figure 2-168

The Process Designer Desktop tab shows the CPE Process Designer menu we created

In Figure 2-168, the copy of the Repository folder context menu we made can be seen in the drop-down. We can now select our copy of this menu type for our IBM Content Navigator Desktop, which we named CPE Process Designer.

See the following web pages for details of running the Workflow Process Designer Applet in IBM Content Navigator:

www.ibm.com/support/pages/do-you-know-now-you-can-run-process-designer-and-process-tracker-ibm-content-navigator-icn

For setting up IBM Case Manager for using the Process Designer:

www.ibm.com/docs/en/case-manager/5.3.3?topic=cdecnd-configuring-case-manager-use-stand-alone-process-designer

Also, this has useful information:

www.ibm.com/docs/en/filenet-p8-platform/5.5.x?topic=workflows-running-filenet-process-designer

To register the IBM Content Navigator plugins, see

www.ibm.com/docs/en/filenet-p8-platform/5.5.x?topic=navigator-registering-process-applets-plug-in

Followed by this web page section:

www.ibm.com/docs/en/filenet-p8-platform/5.5.x?topic=navigator-configuring-process-designer

Part 5 – Standalone Process Designer Installation

In the current release of browsers, the embedded applet jar file used by the IBM FileNet Workflow Process Designer is often disabled by the browser (including on my systems!). So, this Part describes the installation and configuration required to install the Windows Client Standalone Process Designer, which is then used to add a DbExecute workflow step to the Audit Master Solution we created in Chapter 1.

References are as follows:

www.ibm.com/docs/en/case-manager/5.3.3?topic=cdecnd-configuring-case-manager-use-stand-alone-process-designer

www.ibm.com/docs/en/filenet-p8-platform/5.2.1?topic=system-setting-dbexecute-connections

For viewing the error logs in FileNet, the following link is useful:

www.ibm.com/docs/en/filenet-p8-platform/5.5.x?topic=logging-viewing-filenet-p8-logs

We will install the IBM FileNet Process Engine Client tools using the Windows client installer for IBM Content Foundation, Content Platform Engine for Windows system, which can be downloaded from the IBM Software Catalog as a zip file, ICF_5.5.0_WINDOWS_ML.zip.

We first unzip the ICF_5.5.0_WINDOWS_ML.zip software package to subfolders as in the example shown in Figure 2-169.

A screenshot highlights the 5.5.0 I C F C P E application file inside the I C F E 5.5.0 windows M L zip folder.

Figure 2-169

The unpacked ICF_5.5.0_WINDOWS_ML.zip software package

Next, we run the 5.5.0-ICFCPE-WIN.EXE program by right-clicking the program and selecting Run as administrator as shown in Figure 2-170.

A screenshot represents the selected 5.5.0 I C F C P E WIN dot E X E application file with the options to open and run as administrator.

Figure 2-170

The 5.5.0-ICFCPE-WIN.EXE program is run as the Windows Administrator

The installation program checks for existing deployments and ensures the required prerequisites are installed.

A screenshot represents the progress status bar of the installation with 2 % progress.

Figure 2-171

The progress status bar of the installation. It can take several minutes to prepare the installation

After accepting the windows pop-up for the installer to use the Windows Administrator, we see the progress status bar shown in Figure 2-171.

After several minutes, the following initial installation window is displayed.

A screenshot of a dialog box to install content platform engine. It represents the details under the introduction along with the next and cancel buttons at the bottom.

Figure 2-172

The initial installation window shows the version of the IBM Content Platform Engine

We click the Next command button to show the IBM License Acceptance splash screen, with a scrollable license text window.

A screenshot of a dialog box to install content platform engine. It represents the details for the software license agreement, along with the buttons to go next, previous, and cancel.

Figure 2-173

The I Accept… option is selected, and click the Next command button

The installation options are chosen on the next screen.

A screenshot of a dialog box to install content platform engine. It represents the options to choose components, along with the buttons to go next, previous, and cancel.

Figure 2-174

The installation option for the Content Platform Engine Server is deselected

We just need to install the Client tools for the IBM Content Platform Engine, so we just select for the .NET Clients and the Tools.

A screenshot of a dialog box to install content platform engine. It represents the path of the process designer J R E directory, along with the buttons to go next, previous, and cancel.

Figure 2-175

The Process Designer JRE Directory was left as the default (but see the following text!)

Note

The preceding default path does not exist on our MS Windows client system, so we had to post-edit the Process Designer environment batch file later. Also, if a valid path is entered, you must ensure that it does not contain any spaces (so, use the DOS short form for a directory, e.g., “C:PROGRA~1…” rather than the “C:Program Files…” directory name).

A screenshot of a dialog box to install content platform engine. It represents the option to choose the installation path, along with the buttons to go next, previous, and cancel. It highlights the next button.

Figure 2-176

The Next command is used after reading the information that we have an older version

We will be asked in the next installation screen to enter the IBM FileNet P8 Content Engine Service Definition SOAP WSDL URL link. This can be tested in a browser which can connect to the Linux ecmukdemo6 server (the Windows hosts file should have an entry for the IP address).

This SOAP URL is http://ecmukdemo6:9080/wsi/FNCEWS40MTOM.

A screenshot of an X M L file opened in a web browser. It highlights its path in the address bar.

Figure 2-177

The output expected from a correctly configured SOAP URL link

A screenshot of a dialog box to install content platform engine. It represents the C C L server U R L under the dot net A P I com compatibility layer server, along with the buttons to go next, previous, and cancel.

Figure 2-178

The SOAP URL link used for the COM CCL API layer

The tested URL is entered in the screen in Figure 2-178.

This URL link is also used by the Java API in a properties file called WcmApiConfig.properties, so this is also entered in the next screen shown as follows.

A screenshot of a dialog box to install content platform engine. It represents the U R L used in W c m a p i config properties file, along with the buttons to go next, previous, and cancel. it highlights the next button.

Figure 2-179

The SOAP link is entered to be used in the WcmApiConfig.properties file

The following screen, shown on clicking the Next command button in Figure 2-179, shows a summary of the selected installation options which can be initiated by clicking the Install command button.

A screenshot of a dialog box to install content platform engine. It represents the pre-installation summary, along with the buttons to go previous and cancel. It highlights the install button.

Figure 2-180

The Install command button is clicked to start the installation

The installation status is shown in the next Install screen in Figure 2-181.

A screenshot of a dialog box represents the process of installing the content platform engine. There is an installation progress bar with a 14% progress at the bottom.

Figure 2-181

The installation progress status bar is shown

After the installation is completed, there is an option to launch the configuration manager with a tick box, which in this instance we don’t require, since we are using the Windows Client for the Standalone Process Designer Java application. (The Configuration Manager is used to prepare and install a new IBM Content Platform Engine server system.)

A screenshot of a dialog box indicates the completion of the installation of the content platform engine. It highlights a button labeled, done.

Figure 2-182

The Done command button is clicked to exit from the final installation screen

Fixing the Process Designer Shell Script Environment Variables

The Windows DOS cmd.exe command window (run as the Windows Administrator) can now be used to run the pedesigner.bat Windows shell script file. However, as will be seen later, we have to do some editing on the environment variable initiation shell scripting to obtain a working JAVA_HOME and CLASSPATH environment configuration!

A screenshot illustrates the location of p e designer dot bat file inside the c drive. It highlights the file path and file name in the P E folder.

Figure 2-183

The location of the pedesigner.bat file which will launch the Standalone Process Designer

A screenshot of a set of commands in the command prompt. It represents the available files in the P E directory.

Figure 2-184

The launch of the pedesigner.bat shell script to load the Standalone Process Designer

We have to include the Process Engine Connection point for the Designer Object Store which has the name CP1.

A screenshot of a set of commands in the command prompt. It exhibits the command line including the connection point C P 1.

Figure 2-185

The correct command line including the Connection Point, CP1

Unfortunately, we have the JAVA_HOME Windows environment variable pointing at a JRE Classpath which does not exist.

However, we also have a Folder path with spaces, which does not work for the shell script!

A screenshot of a set of commands in the command prompt. It exhibits the following text, the system cannot find the path specified.

Figure 2-186

The system error message appears

A screenshot of a notepad containing a set of codes. It highlights the following text in it. fix for environment path spaces, P R O G R A 2.

Figure 2-187

The highlighted changes are made in the pedesigner.bat shell script

In Figure 2-187, we make changes to ensure there are no spaces in the classpath which we can achieve by using the DOS short form of the directory path for the top level c:Program Files (x86) directory, which has a DOS short form of c:PROGRA~2.

Then, we also have to edit the cpetoolenv.bat shell script file, which is called by the main pedesigner.bat shell script file, as shown in Figure 2-188.

A screenshot of a notepad containing a set of codes. It highlights the file name, c p tool e n v dot bat, and the folder program file x 86 in the c drive.

Figure 2-188

The highlighted change is made in the cpetoolenv.bat shell script

This results in the updated shell script file in Figure 2-189.

A screenshot of the notepad containing a set of codes. It highlights the path of i b m underscore s d k 80 file in the C drive.

Figure 2-189

The updated cpetoolenv.bat file

We can now launch the Standalone Process Designer Java program using the Windows cmd.exe DOS window, with the commands as follows:
cd c:PROGRA~2IBMFileNetContentEnginePE
pedesigner.bat CP1
This loads a pop-up window prompting us for a Process Engine administrator login.

A screenshot of the login box for the workflow system. It consists of the filled-in details of user name and password along with the buttons to log in cancel, and help.

Figure 2-190

The User Name and Password are entered, and the Log In command button is clicked

We now see the first screen of the IBM Standalone Java program, Process Designer, which we can use for the editing of IBM Case Manager solution Task workflows.

A screenshot represents the edit screen of the process designer application. An icon in the middle reads launch step. There is a list of workflow properties at the bottom of the screen.

Figure 2-191

The first edit screen of the Process Designer Java program

We can now load the Audit Department Task Workflow of our Audit Master Case Manager Solution.

The first step is to use the FileSolutionEdit… menu option as shown in Figure 192.

A screenshot represents the edit screen of the process designer application. It highlights the file tab with a popped-up context menu. It highlights the solution and edit options in the menu.

Figure 2-192

The menu option is selected to navigate to the Audit Master solution to edit the Task Workflow

We now see the option to select from the available IBM FileNet Object Stores, used by Case Manager for the Design (OS1) and Target (OS2) object stores, where our solution is stored. We select the OS1 Design Object store where the Audit Master solution is developed.

A screenshot illustrates the text, object stores, inside a textbox besides the look-in operation. It highlights O S 1 from the available object stores.

Figure 2-193

The Design Object Store, OS1, is selected

From the OS1 Object Store, we navigate down to the Audit Master solution following the Object Store folder path OS1IBM Case ManagerSolutionsAudit Master, as shown in Figure 2-194.

A screenshot represents the Audit Master folder is selected under the solutions in O S 1.

Figure 2-194

The path to the Audit Master solution is selected and opened

We are now presented with a list of IBM Case Manager Solution components. For the Workflows, we select the Solution Definition file shown in Figure 2-195.

A screenshot highlights the solution definition under the audit department workflow definition along with the open button at the bottom right corner.

Figure 2-195

The Solution Definition file for the Audit Master solution is selected and Open clicked

We are now shown a pop-up window with a drop-down which shows the Case Types available. (For the Audit Master solution, we only have one Case Type at the moment, Audit Department… there can be many!)

A screenshot of the case type selection dialog box highlights the audit department. There are buttons to cancel and help at the bottom.

Figure 2-196

The Audit Department Case Type is selected

The selected Case Type then shows the AUD_AuditProcess Task Workflow to be used. (There can be many Case Type workflows!)

A screenshot of the case type selection dialog box represents the audit department under case type and audit process under task workflow. It highlights the ok button at the bottom.

Figure 2-197

The AUD_AuditProcess Task Workflow for the Audit Department Case Type is selected

We can now add the DbExecute Workflow step.

The DbExecute Workflow Step Addition

The following URL covers the system setup for DbExecute:

www.ibm.com/docs/en/filenet-p8-platform/5.2.1?topic=system-setting-dbexecute-connections

The following procedure is used in the IBM FileNet acce web application to configure the database JDBC link required by the Workflow DbExecute step. It defines the JDBC URL which allows the FileNet system to connect to a server database, by an administrator specifying a server name and port number and entering the required database name and logon details to access the Stored Procedure to be used.

Procedure to Configure a DbExecute Connection in the Content Engine Store

To set a DbExecute connection:
  1. 1.
    Access the DbExecute Connections tab in the administration console:
    1. a.

      In the domain navigation pane, select the object store.

       
    2. b.

      In the object store navigation pane, click AdministrativeWorkflow System.

       
    3. c.

      In the details pane, click the DbExecute Connections tab.

       
     

A screenshot of the I B M administrative console page highlights the workflow system under O S 1 in the left navigation pane and D b execute connections tab on the right side.

Figure 2-198

The DbExecute Connections in the Design Object Store

  1. 2.

    Click New.

     
  2. 3.

    Enter the connection information and database parameters.

     

A screenshot of a form titled new d b execute connection. It contains the details of the connection name, database type, name, host, port, user name, and password. There are ok, cancel, and validate buttons at the bottom.

Figure 2-199

The AuditDB connection parameters are entered

Click Validate to test the database connection.

A screenshot of the new d b execute connection dialog box. It represents a pop-up text box with the following text, validation of the database connection audit d b was successful.

Figure 2-200

The status of the AuditDb connection is shown

We can now see the AuditDb object we have successfully created in the DbExecute Connections tab.

A screenshot represents the created audit d b file in the d b execute connection. There are buttons to save, refresh, action, and close at the top.

Figure 2-201

The AuditDb object is successfully created in the DbExecute Connections tab of OS1

The preceding steps were repeated for the OS2 Target Object Store.

A screenshot represents the created audit d b file in the d b execute connections. It highlights the audit d b file and the save button.

Figure 2-202

The AuditDB object is successfully created in the DbExecute Connections tab of OS2

We can now insert test rows into the AUDIT_DEPT table which is in the DB2 auditdb database.

A screenshot represents a set of commands in a text box.

Figure 2-203

The IBM Data Studio is used to view and add test rows in the DB2 auditdb database

The DbExecute Stored Procedure SQL

A screenshot of a text editor represents a set of commands. It lists the procedure to add audit department.

Figure 2-204

The Stored Procedure ADD_AUDIT_DEPT is edited in the file SetAddAudit_Stored_ProcedureV1.sql

The Stored Procedure, ADD_AUDIT_DEPT, listed in Figure 2-204, which we have developed, can be called by the DbExecute step to add a row to the DB2INST1.AUDIT_DEPT table in the auditdb database, using parameters passed for each column of the table.

A screenshot of a text editor represents the information regarding the database connection.

Figure 2-205

The stored procedure is created in the auditdb database, using the preceding db2 commands

A screenshot of a text editor represents a set of commands. A text at the bottom reads, the S Q L command completed successfully.

Figure 2-206

The install of the DB2INST1.AUDIT_DEPT stored procedure is successfully loaded into auditdb

See the following web page for the full DbExecute procedure steps:

www.ibm.com/docs/en/filenet-p8-platform/5.5.x?topic=activity-dbexecute-system-function

Configuring the Workflow for the DbExecute Step

We can now define the DbExecute system step for the workflow system using the installed Standalone Process Designer.

Note

To create a new DbExecute connection, an XA and non-XA JDBC Datasource will need to be set up for the IBM FileNet WebSphere application server to enable access for the database.

See the link for a full description of an alternative JDBC DbExecute connection creation (on Page 51 of the document):

https://doi.org/10.13140/RG.2.2.16987.52008

“Importing Case Manager solution Auto Claims example into Case Manager 5.3.3 on RHEL 8.0” Document download:

ImportingCaseManagersolutionAutoClaimsexampleintoCaseManager5.3.3onRHEL8.0.docx

Procedure to Add the DbExecute System Step to the Task Workflow

To specify a new DbExecute system step:
  1. 1.
    From the General System Palette, use the mouse to drag a DbExecute step onto the workflow map.

    A screenshot of the process designer application highlights the general system palette under the list of options for open palette window.

    Figure 2-207

    The General System Palette window is ticked in Process Designer

     
After the General System Palette select box is ticked, the icons open up as shown in Figure 2-208. Then the highlighted DbExecute step can be dragged and dropped into the Process Designer work area.

A screenshot of the process designer application highlights the icon of d b execute work flow step.

Figure 2-208

The DbExecute workflow step icon is as highlighted

  1. 2.

    Enter the database name in the parameter window shown in Figure 2-209.

     
Note

The name that is used to create a stored procedure is used to call it in the Workflow. Process Designer does not allow a Stored Procedure name to be entered with quotes for the DbExecute system step. See the link as follows for the full details:

www.ibm.com/docs/en/filenet-p8-platform/5.5.x?topic=activity-dbexecute-system-function

  1. 3.

    Enter the name of the stored procedure to execute (ADD_AUDIT_DEPT).

     

A screenshot of the process designer application represents an arrow mark from launch step to d b execute. The procedure name at the bottom reads, add underscore audit underscores D E P T.

Figure 2-209

The parameters for the ADD_AUDIT_DEPT Stored Procedure are entered

In Figure 2-209, we have entered the required DbExecute step parameters which require the Database Connection Alias we set up.

A screenshot of the process designer application represents a dialog box with a list of selected properties. It highlights the A U D underscore department name along with the ok, cancel, and help buttons.

Figure 2-210

The Case field properties are now selected for assigning to the Stored Procedure

  1. 4.
    The different supported databases for the DbExecute calls must have all of its parameters declared as follows:
    • out – SQL Server

    • in out – Oracle

    • inout – DB2

     

The preceding parameter types are set to allow the values to be maintained bidirectionally. This allows the updated values to reflect the stored values passed in as parameters to the stored procedure.

The parameter data types passed in must match the types that are specified in the stored procedure SQL and can be of the following types:

Designer Param Type

Oracle Param Type

SQL Server Param Type

DB2 Param Type

String

varchar

Varchar

varchar

Integer

number

Int

int

Boolean

number

Bit

number

Float

number

Float

float

Time

date

Datetime

timestamp

Stored Procedure Parameter Limitations

Arrays are not supported for Stored Procedure parameters.

Note

If a Date/time, Integer, Boolean, or Float parameter is set to null by a stored procedure, an exception will be thrown.

 

Oracle

SQL Server

DB2

Maximum number of parameters in procedure

1024

1024

1024

String parameter maximum characters

4000

4000

4000

Example SQL Table Creation for the DB2 Database

The table in the auditdb database we are interested in has the following DDL.
CREATE TABLE "DB2INST1"."AUDIT_DEPT" (
          "AUDITOR_NAME" CHAR(40 OCTETS) NOT NULL,
          "DEPTNO" INTEGER NOT NULL,
          "AUDIT_DATE" DATE,
          "COMMENTS" CHAR(200 OCTETS) NOT NULL,
          "AUDIT_STATUS" CHAR(10 OCTETS) NOT NULL
     )
     ORGANIZE BY ROW
     DATA CAPTURE NONE
     IN "USERSPACE1"
     COMPRESS NO;
Listing 2-7

The Create Audit_Dept table SQL script

DbExecute Stored Procedure Installation

The following db2 commands are used to install the Stored Procedure SQL code. The code was edited into a SetAddAudit_Stored_ProcedureV1.sql file containing the SQL.
db2 connect to auditdb
db2 -td@ -vf SetAddAudit_Stored_ProcedureV1.sql
The SQL code we enter for the Stored Procedure is as follows.
CREATE OR REPLACE PROCEDURE ADD_AUDIT_DEPT (INOUT VARRESULT INT,
                                           INOUT AUDITOR VARCHAR(10),
                                           INOUT DEPTNO INT,
                                           INOUT  AUDITDATE VARCHAR(20),
                                           INOUT COMMENTS VARCHAR(200),
                                           INOUT   AUDITSTATUS VARCHAR(10))
LANGUAGE SQL
MODIFIES SQL DATA
P1: BEGIN
DECLARE VARRESULT INT;
DECLARE AUDITORVAR VARCHAR(10);
DECLARE DEPTNOVAR INT;
DECLARE AUDITDATEVAR VARCHAR(20);
DECLARE COMMENTSVAR VARCHAR(20);
DECLARE AUDIT_STATUSVAR    VARCHAR(256);
        -- #####################################################################
-- # PROCEDURE ADD_AUDIT_DEPT.
-- #  Alan S. Bluck, Director, ASB Software Development Limited
-- #
-- # This stored procedure writes a row of Audit Department
-- # data to the DB2INST1.AUDIT_DEPT table in the auditdb database
-- #
-- # NB Any date fields which are set empty on initial Add of a CASE
-- #    may cause insert failure!
#####################################################################
SET AUDITORVAR=AUDITOR;
SET DEPTNOVAR = DEPTNO;
SET AUDITDATEVAR = AUDITDATE;
SET COMMENTSVAR = COMMENTS;
SET AUDIT_STATUSVAR = AUDITSTATUS;
INSERT INTO
        DB2INST1.AUDIT_DEPT (AUDITOR_NAME,DEPTNO,AUDIT_DATE,COMMENTS,AUDIT_STATUS)
VALUES(AUDITORVAR, DEPTNOVAR, AUDITDATEVAR, COMMENTSVAR, AUDIT_STATUSVAR);
SET VARRESULT=1;
END
@
Listing 2-8

The ADD_AUDIT_DEPT Stored Procedure DB2 SQL script

A screenshot of the process designer application represents a table at the bottom with the name, type, merge type, expression, and description of the data fields.

Figure 2-211

The Data Fields are set up in the Workflow Properties tab for the AUD_AuditProcess Workflow

To support the transfer of the IBM Case Manager Audit Master solution Audit Department case data to the separate auditdb database server table AUDIT_DEPT, we need to define some Workflow Data Fields to hold the Case Data. These are set up with initial default values in the Workflow Properties, Data Fields tab shown in Figure 2-211.

A screenshot of the process designer application represents a table at the bottom with the name and expression of the field assignments.

Figure 2-212

The Workflow LaunchStep parameters are first set up with test data using local String constants

The LaunchStep Field Assignment parameters are first set up with String values to test the Stored Procedure and Workflow during “debugging” as shown in Figure 2-212.

A screenshot of the expression builder highlighting the case task under the business object field, and A U D underscore auditor under the properties.

Figure 2-213

The Case Task Fields are selected for the Field Assignments

The Case Task Fields can be added next, after testing the Stored Procedure with fixed values for a “live” test of triggering the DbExecute step to populate the AUDIT_DEPT table.

A screenshot of the project designer application represents a table at the bottom with the name and expressions of the field assignments. It highlights the department number in the table.

Figure 2-214

The Field Assignments are now populated from the Case Task Business Object values

In Figure 2-214, we now have the Field Assignments set with Case Task values for the Audit Case.

A screenshot of the project designer application represents a table at the bottom with a list of field names. The step name at the left of the table reads d b execute and the procedure name reads, Add underscore audit underscore D E P T.

Figure 2-215

The six DbExecute Stored Procedure parameters are mapped to the Workflow Data Fields

After the LaunchStep Workflow Data Field Assignments are configured to the Case Fields, we can now select the DbExecute step and choose the Workflow Data Fields, in the order they are required to be used as Parameters for the Stored Procedure, as shown in Figure 2-215.

A screenshot of the project designer application highlights the validate workflow under the action tab.

Figure 2-216

The Validate Workflow Action menu is selected to check for any syntax errors

Now the DbExecute step is completed, we can use the Validate Workflow menu action to ensure the Workflow “compiles” with no syntax errors (the workflow can either be stored as the industry standard XPDL, or there is an IBM FileNet P8 proprietary workflow .pep file structure which can be used).

A screenshot of the project designer application represents a table at the bottom with the name and expression of the field assignments. It highlights the department number.

Figure 2-217

The Field Assignments are updated to convert the Comments to add a date/time string

A few minor changes were made to the Comments field to use one of the built-in Functions available in the Workflow design system, as shown in Figure 2-217.

A screenshot of a popup screen reads the workflow validation was successful.

Figure 2-218

The Workflow validation test was completed successfully

A screenshot of the project designer application highlights the save and close option in the context menu of the solution under the file tab.

Figure 2-219

The Workflow(s) for the Solution are saved for testing

After the Workflow DbExecute step has been entered and validated, we can Save and Close the Audit Master Solution Task workflow we have created and redeploy the Audit Master solution using the IBM Case Builder web application as shown in Figure 2-220.

A screenshot of the audit master page highlights a triangle-shaped icon at the top left corner.

Figure 2-220

The IBM Case Builder has detected that the Audit Master solution has new changes

In the IBM Case Builder, we should see a Warning triangle (if a refresh of the Case Builder application has been conducted). This also shows the User and Date and Time that the solution was last modified.

A screenshot of the audit master page highlights the deploy icon at the bottom indicating the following text, deploy the changed solution artifacts into a test environment.

Figure 2-221

The Deploy the changed solution icon is clicked

We can now deploy the updated Audit Master solution, which now has a Task workflow with our DbExecute workflow step.

A screenshot of the pop-up page with a table containing the details about the type and name of the deploying item. Ther are two buttons at the bottom to deploy and cancel.

Figure 2-222

The Deploy pop-up window shows the Audit Process Task has changes

We now get a pop-up window which lists the detected changes which require deployment. Notice that the system locks the items as a warning, because the IBM Case Builder supports multiple Solution editors for the same Solution, as long as they are working on different areas of a Solution. In this case, we have a lock from the Standalone Process Designer.

A screenshot of the text editor highlights a command to select an item from the database. It highlights the auditor's name, department number, audit date, comments, and audit status at the bottom.

Figure 2-223

The query from IBM Data Studio on the Linux server shows that there is a row in the table

We can check the result of adding records into the AUDIT_DEPT table using the IBM Data Studio application. Initially, we have the record from the Test Insert SQL we ran earlier in the development.

A screenshot of the Audit master page which highlights an icon at the bottom indicating the following text, start the I B M case manager client to test the solution.

Figure 2-224

The icon to start the IBM Case Manager Client is selected from the IBM Case Builder

We can now create a new Audit Department Case from the deployed Audit Master solution which is now deployed to the Target Object Store (OS2). This can then be accessed to launch our Task workflow.

A screenshot of the I B M case manager page on a web browser. It highlights the required audit process at the bottom along with a table containing department I D, auditor, audit date, comments, and status.

Figure 2-225

The Audit Process Task is shown Started after selecting the manual Start link

We can now start the Audit Process task as shown in Figure 2-225.

A text document represents some instructions to grant execution on the procedure to add the audit department to the public.

Figure 2-226

The Stored Procedure is required to have a GRANT on it to allow it to execute

The first test showed that we need to grant security access on the ADD_AUDIT_DEPT stored procedure to give it execute permissions.

A text document represents the values of output parameters.

Figure 2-227

The Stored Procedure was tested using a db2 call to show that it would function correctly

After the Security update, we used the db2 command line to launch the ADD_AUDIT_DEPT stored procedure to check that it was functioning correctly. This is shown using the db2 command in Figure 2-227. Notice that on the Linux system, we have to wrap the call command in double quotes, as follows:
db2 "call ADD_AUDIT_DEPT (1, 'A S Bluck',00003,'2022-06-18','Test of the Procedure','Working')"

A screenshot represents a table with the details of the auditor's name, department number, audit date, comments, and audit status of an audit department.

Figure 2-228

The row is added from the db2 call test for the ADD_AUDIT_DEPT stored procedure

We can now check that the Table row has been inserted into the AUDIT_DEPT table, which can be seen in Figure 2-228.

A screenshot of the process designer application represents a table at the bottom containing the name, type, merge type, expression, and description of the data fields.

Figure 2-229

The Data Fields are configured in the Workflow

The Data Fields are all initialized now as String values, except for the VARRESULT status parameter, which is left as an Integer.

A screenshot of the process designer application represents a table at the bottom containing the name and expression of the field assignments. It highlights the comments in the table.

Figure 2-230

The Data Field Assignments from the LaunchStep are now set

We can run a first test using the local String variables to eliminate any Null field issues.

A screenshot of the process designer application represents a table containing the name and expression of the field assignments. It highlights a comment which reads, the test of the procedure.

Figure 2-231

The first test using hard-coded values for the parameters

If issues are found with Null values (such as in a date field, e.g., as found with the AutoClaims Solution, where the Field is set to NOT NULL in the table), then the test parameters in the Workflow can be temporarily hard-coded to eliminate issues.

A screenshot of a text editor represents a list of values of output parameters.

Figure 2-232

The Stored Procedure call is retested after minor changes

Note

In the preceding db2 call on the Linux server, the Stored Procedure call has to be surrounded by double quotes to be executed with the db2 command-line processor.

Testing on Different Database Platforms

If you want to compare SQL statements in different databases, a website called SQL Fiddle allows a developer to switch between different database providers.

It supports a drop-down for MySQL, PostgreSQL, MS SQL Server, and SQLite, which you can run test some SQL queries and the syntax against.

This is very useful if a database platform would take time to install and configure and you have time constraints. Using SQL Fiddle, you just create your database and can run the queries in the web-based application!

See the following link:

http://sqlfiddle.com

A screenshot of a web page of S Q L fiddle opened in a browser. It contains a set of codes in the text editor. There is a table at the bottom containing the details of the auditor's name, department number, audit date, comment, and audit status.

Figure 2-233

The sqlfiddle.​com free web application SQL test environment

Oracle Version of the Stored Procedure SQL Code

Generate the Stored Procedure for DbExecute using Oracle.
CREATE OR REPLACE PROCEDURE OS2.ADD_AUDIT_DEPT (
VARRESULT IN OUT INT,
AUDITOR IN OUT VARCHAR2,
DEPTNO IN OUT INT,
AUDITDATE IN OUT VARCHAR2,
COMMENTS IN OUT VARCHAR2,
AUDIT_STATUS IN OUT VARCHAR2
)
-- # PROCEDURE ADD_AUDIT_DEPT.
-- #  Alan S. Bluck, Director, ASB Software Development Limited
-- #
-- # This stored procedure writes a row of Audit Department
-- # data to the OS2.AUDIT_DEPT table in the OS2 database
-- #
-- # NB Any date fields which are set empty on initial Add of a CASE
-- #    may cause insert failure!
IS
   v_STATUS  INT;
BEGIN
   VARRESULT := 0;
   INSERT INTO OS2.AUDIT_DEPT
(AUDITOR_NAME,DEPTNO,AUDIT_DATE,COMMENTS,AUDIT_STATUS)
   VALUES (AUDITOR, DEPTNO, AUDITDATE, COMMENTS, AUDIT_STATUS
);
   VARRESULT := 1;
END;
/
Test run the procedure above using:
SQL> variable CALLSTATUS NUMBER;
SQL> execute OS2.ADD_AUDIT_DEPT ('A S Bluck','00001','2022-06-19', 'Test Stored Procedure','Working',:CALLSTATUS);
PL/SQL procedure successfully completed.
SQL> print CALLSTATUS;
CALLSTATUS
----------
    1
Listing 2-9

The Oracle example stored procedure

MS SQL Server Version of the Stored Procedure SQL Code

Generate the Stored Procedure for DbExecute using MS SQL Server.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'ADD_AUDIT_DEPT') AND type in (N'P', N'PC')) DROP PROCEDURE ADD_AUDIT_DEPT;
GO
CREATE PROCEDURE ADD_AUDIT_DEPT
     @VARRESULT BIGINT,
    @AUDITOR nvarchar(10),
    @DEPTNO nvarchar BIGINT,
    @AUDITDATE nvarchar(20),
    @COMMENTS nvarchar(20),
    @AUDIT_STATUS nvarchar(256)
-- # PROCEDURE ADD_AUDIT_DEPT.
-- #  Alan S. Bluck, Director, ASB Software Development Limited
-- #
-- # This stored procedure writes a row of Audit Department
-- # data to the DBO.AUDIT_DEPT table in the auditdb database
-- #
-- # NB Any date fields which are set empty on initial Add of a CASE
-- #    may cause insert failure!
AS
BEGIN
     --DECLARE THE VARIABLES
     DECLARE @VARRESULT BIGINT
     ,@AUDITORVAR VARCHAR(10)
     ,@DEPTNOVAR BIGINT
     ,@AUDITDATEVAR VARCHAR(20)
     ,@COMMENTSVAR VARCHAR(20)
     ,@AUDIT_STATUSVAR VARCHAR(256)
     SET @AUDITORVAR = @AUDITOR
      SET @DEPTNOVAR = @DEPTNO
      SET @AUDITDATEVAR = @AUDITDATE
      SET @COMMENTSVAR = @COMMENTS
      SET @AUDIT_STATUSVAR = @AUDIT_STATUS
    BEGIN
        BEGIN TRANSACTION
Insert into dbo.AUDIT_DEPT
(AUDITOR_NAME,DEPTNO,AUDIT_DATE,COMMENTS,AUDIT_STATUS)
VALUES (@AUDITORVAR, @DEPTNOVAR, @AUDITDATEVAR, @COMMENTSVAR, @AUDIT_STATUSVAR);
        COMMIT TRANSACTION
END;
Listing 2-10

The MS SQL Server example stored procedure

Test run the preceding procedure using
EXEC dbo.ADD_AUDIT_DEPT 1,N'A S Bluck', N'2022-06-19',N'Test Run',N'Working';

Chapter 2 Exercises

The following questions cover the functions using Code Module Events, IBM Process Designer, and DbExecute, which we covered in this chapter.

MULTIPLE CHOICE QUESTIONS
  1. 1.
    What IBM application would you use to confirm that the “CodeModules” folder exists?
    1. a)

      The IBM Content Navigator

       
    2. b)

      The IBM acce Administrative Console for Content Platform Engine

       
    3. c)

      The IBM Case Builder

       
    4. d)

      The IBM Process Designer

       
     
  2. 2.
    An IBM Stored Procedure String parameter for the Oracle Database system is limited to
    1. a)

      64 characters

       
    2. b)

      1333 characters

       
    3. c)

      4000 characters

       
    4. d)

      1024 characters

       
     
  3. 3.
    The IBM Standalone Process Designer Tool is initially installed using the program
    1. a)

      cmd.exe

       
    2. b)

      pedesigner.bat

       
    3. c)

      5.5.0-ICFCPE-WIN.EXE

       
    4. d)

      cpetoolenv.bat

       
     
  4. 4.
    The main purpose of a Workflow Subscription is
    1. a)

      To enable the creation of a Folder Object

       
    2. b)

      To enable the creation of a Document Object

       
    3. c)

      To enable a workflow to be launched on the storage of a document

       
    4. d)

      To enable a Case to be created in IBM Case Manager

       
     
MULTIPLE CHOICE ANSWERS
  1. 1.

    b) The IBM acce Administrative Console for Content Platform Engine

     
  2. 2.

    c) 4000 characters

     
  3. 3.

    c) 5.5.0-ICFCPE-WIN.EXE

     
  4. 4.

    c) To enable a workflow to be launched on the storage of a document

     
QUESTIONS
  1. 1.

    Describe what steps you would use to install a new Custom Event, given that you have been given a working fn_eventshandler.jar file and have been asked to configure an AddFolder Java Class Event Handler triggered on the creation of a new Folder.

     
  2. 2.

    What databases does IBM Case Manager Workflow support and what types of Datasource are recommended to be configured to support a connection for use with DbExecute?

     
  3. 3.

    What methods are used for resolving issues in the deployment of an IBM Case Manager Solution?

     

In Chapter 3, we will cover the use of the Java language to customize Workflow Components with the example development of a Java jar file for the IBM Java Messaging Service calls and its deployment for use in an IBM Case Manager Workflow.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.9.223