The jiglue.dll library includes the JiGlue.Util class. To create a COM object representing a Java object, use the JiGlue.newInstance method.
This topic includes sample Visual Basic and VBScript code samples that illustrate how to use the JiGlue.newInstance method to create a COM object representing the VWAttachment Java object (to access an attachment used in a workflow).
Reminder To use the JiGlue COM Bridge in Visual Basic, add it to your current Visual Basic project. If you are using VBScript and you plan to use the JiGlue COM Bridge without using FileNet Workplace or FileNet Web Services or FileNet Open Client as your web application, you must register the jiglue.dll on the web server; for information, see Register the JiGlue Library (jiglue.dll). For additional information, also see Using the JiGlue COM Bridge with VBScript.
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 by creating an instance of the VWSession object 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 Java object 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 (that is, without any argument).
newInstance(className)
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")
A COM object representing the Java class specified in the className parameter.