![]() |
![]() |
|
|
Publishing Workflow Objects
This section describes publishable objects, and explains how to publish workflow objects, including the following topics:
For more information about the methods described in this section, see the com.bea.wlpi.server.admin.Admin Javadoc. For information about publishing workflow objects using the WebLogic Integration Studio, see Defining Workflow Templates in Using the WebLogic Integration Studio.
What Is a Publishable Object?
A publishable object consists of any object that implements the com.bea.wlpi.common.Publishable interface. The Publishable interface provides support for creating, exporting, and importing packages.
Using the WebLogic Integration Studio or a custom design client, you can create, export, or import workflow objects that are valid publishable objects.
The following table lists the publishable objects defined by the Publishable interface, along with their corresponding types.
Table 18-1 Publishable Objects and Types
The following table lists the methods, provided by the Publishable interface, that can be used to get publishable object information.
Table 18-2 Publishable Interface Methods
For more information, see the com.bea.wlpi.common.Publishable Javadoc.
Creating a Package Entry
To create a package entry in preparation of exporting, you must create a com.bea.wlpi.common.PackageEntry object.
The following example provides the constructor for creating a new PackageEntry object:
public PackageEntry(
com.bea.wlpi.common.Publishable p,
java.util.Map r,
boolean b
)
The following table describes the PackageEntry object data, the constructor parameters used to define the data, and the get and set methods that can be used to access that data after the object is defined.
Table 18-3 PackageEntry Object Data
For more information, see the com.bea.wlpi.common.PackageEntry Javadoc.
Exporting a Package of Publishable Objects
To export a package of publishable objects to a JAR file, use the following com.bea.wlpi.server.admin.Admin method:
public byte[] exportPackage(
java.util.Map publishables,
java.lang.Object credential
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the exportPackage() method parameters for which you must specify values.
Table 18-4 exportPackage() Method Parameters
This method returns a byte[] array that is an image of a JAR file containing all exported objects.
For example, the following code exports a package of publishable objects specified by the previously defined publishable Map object. In this example, admin represents the EJBObject reference to the Admin EJB.
byte[] exportResults = admin.exportPackage(publishableMap);
For more information about the exportPackage() method, see the com.bea.wlpi.server.admin.Admin Javadoc.
Importing a Package of Publishable Objects
To import a package of publishable objects, use the following com.bea.wlpi.server.admin.Admin method:
public java.lang.String importPackage(
byte[] pkg,
java.util.Map publishables,
java.lang.String orgId,
boolean activate,
java.lang.Object credential
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the importPackage() method parameters for which you must specify values.
Table 18-5 importPackage() Method Parameters
This method returns a string value containing any reported issues, such as unresolved references.
For example, the following code imports the publishable objects to the ORG1 organization as specified in the shipping.jar file and publishPackage map. In this example, admin represents the EJBObject reference to the Admin EJB:
byte[] pkg = readFile("shipping.jar");
Map contents = admin.readPackage(pkg, "abcd");
Map spec = getImportSpecification(contents);
String importResults = admin.importPackage(
pkg, spec, "ORG1", true, "abcd");
In this example, the readFile() method reads the specified file into a byte array in memory. The getImportSpecification() method identifies the package contents to be imported. The publishable objects are activated upon import (the activate value is set to true), and the password used is abcd.
For more information about the importPackage() method, see the com.bea.wlpi.server.admin.Admin Javadoc.
Reading a Package of Publishable Objects
To read a package of publishable objects, use the following com.bea.wlpi.server.admin.Admin method:
public java.util.Map readPackage(
byte[] pkg,
java.lang.Object credential
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the readPackage() method parameters for which you must specify values.
Table 18-6 readPackage() Method Parameters
This method returns a java.util.Map object with key-value pairs, specifying the publishable types as the key, and a hetereogenous java.util.List object containing the xxxInfo object corresponding to the publishable type, as the value. For a list of valid publishable objects and types, see the table Publishable Objects and Types.
For example, the following code reads the publishable objects specified in the shipping.jar file, using the password abcd. In this example, admin represents the EJBObject reference to the Admin EJB.
byte[] pkg = readFile("shipping.jar");
Map contents = admin.readPackage(pkg, "abcd");
For more information about the readPackage() method, see the com.bea.wlpi.server.admin.Admin Javadoc.
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|