Using JiGlue.Util to Create a COM Object Representing a Java Object

The jiglue.dll library includes the JiGlue.Util class. To create a COM object representing a Java™ object, use the JiGlue.newInstance method.

Using JiGlue.newInstance()

The JiGlue.newInstance method creates a COM object that represents the specified Java object. In most cases, you need only to create a session object (VWSession) to be able to access other Process API objects. The VWSession class is the most commonly-used Process Java API. Another common usage for JiGlue.newInstance is to create a COM object representing the VWAttachment class in order to access the identity, associated object store, type, Document ID, and version series of an attachment used in a workflow step. Visual Basic® and VBScript code samples to dimension and instantiate the COM object representing the Java object are provided below.

Note: The Jiglue.newInstance method can only instantiate an object whose class has a default constructor (without any argument).

newInstance Syntax

newInstance(className)

Parameters

className: String. Specifies the name of the object to create. The string must contain the package location of the Java class being instantiated. For example, if you want to create an instance of the VWAttachment class in an ASP application, you would specify a command similar to the following:

   set vwAttachment = JiGlue.newInstance("filenet.vw.api.VWAttachment")

Visual Basic example:

    Dim objJiGlue As New JiGlue.JiGlueUtil
    Dim objAttachment As Object
    Set objAttachment = objJiGlue.newInstance("filenet.vw.api.Attachment") 

VBScript example:

    dim objJiGlue, objAttachment
set objJiGlue = CreateObject("JiGlue.Util")
set objAttachment = objJiGlue.newInstance("filenet.vw.api.Attachment")

Returns

A COM object representing the Java class specified in the className parameter.