![]() |
![]() |
|
|
Creating and Managing Workflow Template Definitions
A workflow template definition specifies the operations of a business processes. One or more definitions can be created for each workflow template.
This section explains how to create and manage workflow template definitions, 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 managing workflow templates definitions using Studio, see Defining and Maintaining Workflows in Using the BEA WebLogic Process Integrator Studio.
Creating a Template Definition
To create a workflow template definition, use one of the following com.bea.wlpi.server.admin.Admin methods:
Method 1
public java.lang.String createTemplateDefinition(
java.lang.String templateId,
java.lang.String name,
java.lang.String xml
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
Method 2
public java.lang.String createTemplateDefinition(
java.lang.String templateId,
java.lang.String name,
java.lang.String xml,
java.lang.Object transactionId
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The first method can be used in a nonclustered environment. The second method is recommended for use in a clustered environment. In this case, using the specified transaction ID, the system tracks the method execution status so that the method is not reissued after the transaction is committed, or in the event of a server crash or failover.
The following table describes the createTemplateDefinition() method parameters for which you must specify values.
The method returns the ID of the new template definition.
For example, the following code creates a new template definition named Order Processing based on the orderprocessing.xml file. In this example, admin represents the EJBObject reference to the Admin EJB.
String id = admin.createTemplateDefinition(
template.getId(),"Order Processing", "orderprocessing.xml");
The template ID is obtained using the methods associated with the com.bea.wlpi.common.TemplateInfo object, template. The template object can be obtained using the methods described in Getting a Template.
For more information about the createTemplateDefinition() method, see the com.bea.wlpi.server.admin.Admin javadoc.
Getting Template Definition Information
To get a workflow template definition, use the following com.bea.wlpi.server.admin.Admin method:
public com.bea.wlpi.common.TemplateDefinitionInfo getTemplateDefinition(
java.lang.String templateDefinitionId
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the getTemplateDefinition() method parameter for which you must specify a value.
The method returns a com.bea.wlpi.common.TemplateDefinitionInfo object. To access information about the template definition, use the TemplateDefinitionInfo object methods described in TemplateDefinitionInfo Object.
For example, the following code gets the template definition associated with the specified ID. In this example, admin represents the EJBObject reference to the Admin EJB.
TemplateDefinitionInfo info =
admin.getTemplateDefinitions(templateDefinitionID);
For more information about the getTemplateDefinition() method, see the com.bea.wlpi.server.admin.Admin javadoc.
Getting Definitions for a Template
To get the definitions for a specific workflow template, use the following com.bea.wlpi.server.admin.Admin method:
public java.util.List getTemplateDefinitions(
java.lang.String templateId
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the getTemplateDefinitions() method parameter for which you must specify a value.
This method returns a list of com.bea.wlpi.common.TemplateDefinitionInfo objects. To access information about each template, use the TemplateDefinitinoInfo object methods described in TemplateDefinitionInfo Object.
For example, the following code gets all templates associated with the Order Processing template. In this example, admin represents the EJBObject reference to the Admin EJB.
List tempdefs = admin.getTemplateDefinitions("Order Processing");
For more information about the getTemplateDefinitions() method, see the com.bea.wlpi.server.admin.Admin javadoc.
Getting the Template Definition Content
To get the content of a template definition, use the following com.bea.wlpi.server.admin.Admin method:
public java.lang.String getTemplateDefinitionContent(
java.lang.String templateDefinitionId
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the getTemplateDefinitionContent() method parameter for which you must specify a value.
This method returns an XML document that is compliant with the Template Definition DTD, as described in Template Definition DTD.
For example, the following code gets the contents for the specified template definition. In this example, admin represents the EJBObject reference to the Admin EJB.
String content =
admin.getTemplateDefinitionContent(tempDef.getId());
The template definition ID is obtained using the methods associated with the com.bea.wlpi.common.TemplateDefinitionInfo object, definition. The definition object can be obtained using the methods described in Getting Definitions for a Template.
For more information about the getTemplateDefinitionContent() method, see the com.bea.wlpi.server.admin.Admin javadoc.
Setting the Template Definition Content
To set the template definition content, use the following com.bea.wlpi.server.admin.Admin method:
public void setTemplateDefinitionContent(
java.lang.String templateDefinitionId,
java.lang.String xml
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the setTemplateDefinitionContent() method parameter for which you must specify a value.
For example, the following code sets the contents for the specified template definition using the contents of the specified XML file, new.xml. In this example, admin represents the EJBObject reference to the Admin EJB.
admin.setTemplateDefinitionContent(tempDef.getId(), "new.xml");
The template definition ID is obtained using the methods associated with the com.bea.wlpi.common.TemplateDefinitionInfo object, definition. The definition object can be obtained using the methods described in Getting Definitions for a Template.
For more information about the setTemplateDefinitionContent() method, see the com.bea.wlpi.server.admin.Admin javadoc.
Deleting a Template Definition
To delete a template definition, use the following com.bea.wlpi.server.admin.Admin method:
public void deleteTemplateDefinition(
java.lang.String templateDefinitionId
) throws java.rmi.RemoteException,
com.bea.wlpi.common.WorkflowException
The following table describes the deleteTemplateDefinition() method parameter for which you must specify a value.
For example, the following code deletes the specified template definition. In this example, admin represents the EJBObject reference to the Admin EJB.
admin.deleteTemplateDefinition(definition.getId());
The template definition ID is obtained using the methods associated with the com.bea.wlpi.common.TemplateDefinitionInfo object, definition. The definition object can be obtained using the methods described in Getting Definitions for a Template.
For more information about the deleteTemplateDefinition() method, see the com.bea.wlpi.server.admin.Admin javadoc.
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|