Version 9.6
 —  Importing Objects Using the API  —

Invoking an Importer from a Java Program

The classes used by the importers are contained in the file CentraSiteUtils.jar. The CLASSPATH variable must refer to the JAR files that are used by CentraSite. It is convenient to include all JAR files contained in the redist folder of the CentraSite installation.

After using an instance of the JAXRAccessor class to establish a valid connection (with user and password) to CentraSite, one or more imports are possible. Finally, close the session by calling the close() method of JAXRAccessor.

The following topics are discussed below:

Importing a Web Service Updating a Registered Web Service Attaching a WSDL to a Registered Web Service Removing a Registered Web Service Finding a Registered Web Service
Importing a Schema     Removing a Schema  
Importing an XML Service     Removing an XML Service  
Importing a BPEL Process File     Removing a Registered BPEL Object  
Importing an XPDL File        

Importing a Web Service

The basic input when importing a web service is a WSDL file describing one or more services. There are also some setter methods for additional parameters. The organization (per object or per name) must be set; other parameters are optional.

The following example demonstrates how to register a web service to CentraSite:

import com.centrasite.jaxr.JAXRAccessor;
import com.centrasite.jaxr.webservice.WebServiceRegistrator;

String dbURL = "http://localhost:53307/CentraSite/CentraSite";
String organizationName = "MyOrganization";
String wsdlFile = "c:/temp/MyService.wsdl";
String user = ...;
String password = ...;

JAXRAccessor jaxr = new JAXRAccessor(dbURL, user, password);
     
try
{
   WebServiceRegistrator wsr = new WebServiceRegistrator(wsdlFile, jaxr);
   wsr.setOrganization(organizationName);
   wsr.register();
}
catch (Exception e)
{
   // handle error
}
finally
{
   jaxr.close();
}

The WebServiceRegistrator class provides the setter methods listed below. The setter methods must be called before calling the register() method.

Top of page

setDescription

Sets a description text that will appear with the imported Service object.

Syntax

public void setDescription(String description)

Parameters

String description

The description text.

Usage Notes

Optional.


Top of page

setOrganization

Sets the name of the organization under which the service should be registered.

Syntax

public void setOrganization(String organizationName)

Parameters

String organizationName

The name of the organization.


Top of page

setOrganization

Sets the organization object under which the service should be registered.

Syntax

public void setOrganization(Organization organizationObject)

Parameters

Organization organizationObject

The organization object under which the service should be registered.


Top of page

setPackageName

Sets the name of the registry package of which the service should be a member.

Syntax

public void setPackageName(String packageName)

Parameters

String packageName

The name of the registry package of which the service should be a member.

Usage Notes

Optional.


Top of page

setPackageObject

Sets the registry package object of which the service should be a member.

Syntax

public void setPackageObject(RegistryPackage packageObject)

Parameters

RegistryPackage packageObject

The registry package object of which the service should be a member.

Usage Notes

Optional.


Top of page

setUsedObject

Sets a registry object that will point to the imported service with a "Uses" association; in other words, the imported service will be used by the specified object.

Syntax

public void setUsedObject(RegistryObject usedObject)

Parameters

RegistryObject usedObject

The registry object that will point to the imported service.

Usage Notes

Optional.


Top of page

setUsesObject

Sets a registry object that will be pointed to by the imported service with a "Uses" association; in other words, the imported service will use the specified object.

Syntax

public void setUsesObject(RegistryObject usesObject)

Parameters

RegistryObject usesObject

The registry object that will be pointed to by the imported service.

Usage Notes

Optional.


Top of page

setWebDAVFolder

Changes the path of the folder where the WSDL file is stored in the CentraSite repository.

Syntax

public void setWebDAVFolder(String folderPath)

Parameters

String folderPath

The path of the folder where the WSDL file should be stored.

Default: /projects/WSDL.

Usage Notes

Optional.


Top of page

Updating a Registered Web Service

To update a registered web service (for example, when the WSDL file has been modified or if you want to change the registry package that contains the web service), call the register() method with the modified WSDL file – see the example above for details.

Note:
The key associated with a registered service comprises its organization, its name and the WSDL file's targetNamespace. If you modify one or more of these, the service is not updated; rather, a new registry entry is created.

Top of page

Attaching a WSDL to a Registered Web Service

It is possible to attach a WSDL file to an existing web service. The code for attaching a WSDL file is similar to the code for importing a WSDL file. An example code snippet follows:

WebServiceRegistrator wr = new WebServiceRegistrator("attach.wsdl", jaxr);
wr.setAttachServiceID("uddi...");
wr.register();

where "uddi..." denotes the UDDI key of the service to which the WSDL file should be attached.

Note the following:

The WebServiceRegistrator class provides the setter method listed below (in addition to the setter methods described under Importing a Web Service). The setter method must be called before calling the register() method.

Top of page

setAttachServiceID

Sets a Service ID (getKey().getId()) for a WSDL-service attachment.

Syntax

public final void setAttachServiceID(java.lang.String attachServiceID)

Parameters

java.lang.String attachServiceID)

The ID of the service, in the form "uddi:...".


Top of page

Removing a Registered Web Service

Use the functions described below to remove a registered web service and all its resources, including all associated registry objects and the WSDL file in the CentraSite repository.

You must use an instance of the JAXRAccessor class to establish a CentraSite connection before calling the removeService or removeServiceByID function. Finally, close the session by calling the close() method of JAXRAccessor.

Also before calling the removeService or removeServiceByID function, you may call setter functions, which are also described below.

The following example demonstrates how to remove a web service from CentraSiteCentraSite:

import com.centrasite.jaxr.JAXRAccessor;
import com.centrasite.jaxr.webservice.WebServiceAdministrator;

String dbURL = "http://localhost:53307/CentraSite/CentraSite";
String wsdlFile = "c:/temp/MyService.wsdl";
String user = ...;
String password = ...;

JAXRAccessor jaxr = new JAXRAccessor(dbURL, user, password);
     
try
{
   WebServiceAdministrator wsa = new WebServiceAdministrator(jaxr);
   int removeCount = wsa.removeServices(wsdlFile);
}
catch (Exception e)
{
   // handle error
}
finally
{
   jaxr.close();
}

The WebServiceAdministrator class provides the methods shown below:

Top of page

removeService

Removes the service specified by the unique name and namespace.

Syntax

public boolean removeService(String serviceName, String namespace)

Parameters

String serviceName

The name of the service to be removed.

String namespace

The namespace of the service to be removed.

Return Codes

Value Meaning
true The specified service was successfully found and removed;
false otherwise.

Top of page

removeServices

Removes from CentraSite all services that are indicated by the specified WSDL file.

Syntax

public int removeServices(String wsdlFilename)

Parameters

String wsdlFilename

The name of the WSDL file that indicates the services to be removed.

Return Codes

Value Meaning
int The number of services that were removed.

Top of page

removeServiceByID

Removes the service with the specified ID.

Syntax

public boolean removeServiceByID(String serviceID)

Parameters

String serviceID

The ID of the service to be removed. The ID is the getKey().getID() value of the associated service object.

Return Codes

Value Meaning
true The specified service was successfully found and removed;
false otherwise.

Top of page

setDeleteTargetAssocs

Specifies whether or not to delete associations to the service object where the service object is the target of the association. If the parameter is "false" and the service object is the target of one or more associations, the removal of the service object is inhibited.

Syntax

public void setDeleteTargetAssocs(boolean deleteTargetAssocs)

Parameters

boolean deleteTargetAssocs

true: Delete associations to the service object where the service object is the target of the association.

Default: true.


Top of page

setRemoveReferencedImports

Specifies whether or not to remove from the repository referenced imported WSDL and schema files, together with their controlling ExternalLinks.

Syntax

public void setRemoveReferencedImports(boolean removeReferencedImports)

Parameters

boolean removeReferencedImports

true: Remove the referenced imported WSDL and schema files.


Top of page

setRemoveWsdl

Specifies whether or not the WSDL file together with its controlling ExternalLink should also be removed from the repository.

Syntax

public void setRemoveWsdl(boolean removeWsdl)

Parameters

boolean removeWsdl

true: Remove the WSDL file together with its controlling ExternalLink from the repository.

Default: true.


Top of page

Finding a Registered Web Service

The Web Service API provides functions with which you can find a registered web service. The following example demonstrates this:

import com.centrasite.jaxr.JAXRAccessor;
import com.centrasite.jaxr.webservice.WebServiceAdministrator;

String dbURL = "http://localhost:53307/CentraSite/CentraSite";
String wsdlFile = "c:/temp/MyService.wsdl";
String user = ...;
String password = ...;

JAXRAccessor jaxr = new JAXRAccessor(dbURL, user, password);   
        
try
{
   WebServiceAdministrator wsa = new WebServiceAdministrator(jaxr);
   Collection services = wsa.findWebServices(wsdlFile);  // Service object coll.
   . . .
}
catch (Exception e)
{
   // handle error
}
finally
{
   jaxr.close();
}

The WebServiceAdministrator class provides the methods shown below:

Top of page

findWebServiceByNamespace

Finds the registered web service on the basis of its name and namespace.

Syntax

public Service findWebServiceByNamespace(String serviceName, String namespace)

Parameters

String serviceName

The name of the registered web service.

String namespace

The namespace of the registered web service.


Top of page

findWebServices

Finds a collection of web service objects that are registered with the specified organization in the specified WSDL file.

Syntax

public Collection findWebServices(String organizationName, String wsdlFile)

Parameters

String organizationName

The name of the organization.

String wsdlFile

The filepath to the WSDL file.


Top of page

Importing a Schema

The schema importer works closely together with the web service importer. Since a WSDL file of a web service may import or include schema files, CentraSite enables you to design and store a schema before referencing WSDL files. Similarly, if a schema file is imported by more than one WSDL file, it could be beneficial to register the schema first, before registering the WSDL files. When a schema is imported, the file is copied into the CentraSite repository and an ExternalLink that controls the resource is created. If a schema imports (includes) further schemas, then the referenced schemas are also imported. The referenced relations are established by means of a "Uses" association in the registry. The following picture illustrates the relationship:

graphics/2499b.png

The following example demonstrates how to import a schema file into CentraSite:

import com.centrasite.jaxr.JAXRAccessor;
import com.centrasite.jaxr.schema.SchemaImporter;

String dbURL = "http://localhost:53307/CentraSite/CentraSite";
String xsdFile = "c:/temp/MySchema.xsd";
String user = ...;
String password = ...;

JAXRAccessor jaxr = new JAXRAccessor(dbURL, user, password);
    
try
{
   SchemaImporter si = new SchemaImporter(xsdFile, jaxr);
   si.add();
}
catch (Exception e)
{
   // handle error
}
finally
{
   jaxr.close();
}

Top of page

Removing a Schema

You can remove a schema from CentraSite. This function deletes the XML Schema object, the ExternalLink and the resource in the repository.

Note:
If a schema is referenced by another object, for example if it is referenced by the ExternalLink of a WSDL object, then it cannot be deleted.

The following example demonstrates how to remove a schema from CentraSite:

import com.centrasite.jaxr.JAXRAccessor;
import com.centrasite.jaxr.schema.SchemaAdministrator;
import javax.xml.registry.infomodel.ExternalLink;

String dbURL = "http://localhost:53307/CentraSite/CentraSite";
String user = ...;
String password = ...;
ExternalLink schemaExtLink = ...;

JAXRAccessor jaxr = new JAXRAccessor(dbURL, user, password);
    
try
{
   SchemaAdministrator sa = new SchemaAdministrator(jaxr);
   sa.remove(schemaExtLink);
}
catch (Exception e)
{
   // handle error
}
finally
{
   jaxr.close();
}

The SchemaAdministrator class provides the following methods for removing a schema:

Top of page

remove

Removes the schema at the specified location in the CentraSite repository, which may be relative or absolute.

Syntax

public boolean remove(String schemaLocation)

Parameters

String schemaLocation

The repository location, which may be relative or absolute.

Return Codes

Value Meaning
true The specified schema was found and removed.

Top of page

remove

Removes the schema specified by its XML schema object.

Syntax

public boolean remove(RegistryObject schemaObject)

Parameters

RegistryObject schemaObject

The XML schema object or the external link of the schema.

Return Codes

Value Meaning
true The specified schema was found and removed.

Top of page

removeCascading

Removes the specified schema and also all schemas that are related to it by import and/or include. The initial schema is specified by its location in the CentraSite repository, which may be relative or absolute.

Syntax

public boolean removeCascading(String schemaLocation)

Parameters

String schemaLocation

The repository location, which may be relative or absolute.

Return Codes

Value Meaning
true The specified schema and all related schemas were found and removed.

Top of page

removeCascading

Removes the specified schema and also all schemas that are related to it by import and/or include. The initial schema is specified by its XML schema object or by its external link.

Syntax

public boolean removeCascading(RegistryObject schemaObject)

Parameters

RegistryObject schemaObject

The XML schema object or the external link of the schema.

Return Codes

Value Meaning
true The specified schema and all related schemas were found and removed.

Top of page

Importing an XML Service

The XML service importer utilizes an XML Schema Documentation (XSD) as the basic input. The importer internally works with the schema importer for importing the schema file.

The following example demonstrates how to import an XML Service to CentraSite:

import javax.xml.registry.Connection;
import javax.xml.registry.JAXRException;
import javax.xml.registry.infomodel.Organization;
import com.centrasite.jaxr.xmlservice.HttpMethods;
import com.centrasite.jaxr.xmlservice.XMLService;
import com.centrasite.jaxr.xmlservice.XMLServiceInfo;
import com.centrasite.jaxr.xmlservice.XMLServiceManager; 

String dbUrl = "http://localhost:53307/CentraSite/CentraSite";
String user = "...";
String password = "...";
String xsdFile = "C:/temp/myschema.xsd"; 

// create the required objects
Connection connection = createCentrasiteConnection(dbUrl, user, password);
Organization submittingOrganization = getSubmittingOrganization();
Organization providingOrganization = getProvidingOrganization(); 

// http methods to be supported
Collection<HttpMethods> httpMethods = new HashSet<HttpMethods>();
httpMethods.add(HttpMethods.GET);
httpMethods.add(HttpMethods.POST); 

// configuration
XMLServiceInfo xmlServiceInfo = new XMLServiceInfo();
xmlServiceInfo.setName("service name");
xmlServiceInfo.setDescription("service description");
xmlServiceInfo.setVersion("1.1");
xmlServiceInfo.setSubmittingOrganization(submittingOrganization);
xmlServiceInfo.setProvidingOrganization(providingOrganization);
xmlServiceInfo.setSchemaUrl(xsdFile);
xmlServiceInfo.setEndpoint("http://endpointurl");
xmlServiceInfo.setHttpMethods(httpMethods); 

// create XMLService
XMLServiceManager xmlServiceManager = new XMLServiceManager(connection);
XMLService xmlService = xmlServiceManager.createXMLService(xmlServiceInfo);

There are also some setter methods for additional parameters. The name, organization, native service URL, HTTP method must be set; other parameters are optional.

The XMLServiceManager class provides the setter methods listed below.

Top of page

setName

Sets a name text that will appear with the imported Service object.

Syntax

xmlServiceInfo.setName(String serviceName)

Parameters

String serviceName

Name for the service.


Top of page

setDescription

Sets a description text that will appear with the imported Service object.

Syntax

xmlServiceInfo.setDescription(String serviceDescription)

Parameters

String serviceDescription

The description text.

Usage Notes

Optional.


Top of page

setVersion

Sets a version number that will appear with the imported Service object.

Syntax

xmlServiceInfo.setVersion(String version)

Parameters

String version

An initial version identifier of the service.

Usage Notes

Optional.


Top of page

setSubmittingOrganization

Sets the name of the organization under which the service should be registered for the purposes of governance within CentraSite.

Syntax

xmlServiceInfo.setSubmittingOrganization(Organization submittingOrganization)

Parameters

Organization submittingOrganization

The name of the submitting organization.


Top of page

setProvidingOrganization

Sets the name of the organization under which the service should be registered from a business perspective.

Syntax

xmlServiceInfo.setProvidingOrganization(Organization providingOrganization)

Parameters

Organization providingOrganization

The name of the providing organization.


Top of page

setSchemaURL

Sets the URL of a native XML service to route the requests.

Syntax

xmlServiceInfo.setSchemaUrl(String xsdFileUrl)

Parameters

String xsdFileUrl

URL to the schema file of the native XML service.


Top of page

setEndpoint

Sets the schema endpoint of the native XML service to which the requests should be routed.

Syntax

xmlServiceInfo.setEndpoint(String endpoint)

Parameters

String endpoint

The native XML service's endpoint.


Top of page

setHttpMethods

Sets a protocol over which the native service should accept requests.

Syntax

xmlServiceInfo.setHttpMethods(Collection<HttpMethods> httpmethods)

Parameters

Collection<HttpMethods> httpmethods

The protocol to route the requests


Top of page

Removing an XML Service

You can remove an XML service from CentraSite. This function deletes the XML service and the associated schemas in the repository

Note:
If an XML service is referenced by another object, then it cannot be deleted.

The following example demonstrates how to remove an XML service from CentraSite:

String xmlServiceKey = "uddi:...";
XMLServiceManager xmlServiceManager = new XMLServiceManager(connection);
xmlServiceManager.deleteXMLService(xmlServiceKey);

The XMLServiceManager class provides the following methods for removing an XML service:

Top of page

String xmlServiceKey

Sets a UDDI key for the native XML service.

Syntax

XMLServiceManager.deleteXMLService(String xmlServiceKey)

Parameters

String xmlServiceKey

UDDI key of the native XML service.


Top of page

Importing a REST Service

The REST service importer utilizes an XML Schema Documentation (XSD) as the basic input. The importer internally works with the schema importer for importing the schema file.

The following example demonstrates how to import an XML Service to CentraSite:

import javax.xml.registry.Connection;
import javax.xml.registry.JAXRException;
import javax.xml.registry.infomodel.Organization;
import com.centrasite.jaxr.xmlservice.HttpMethods;
import com.centrasite.jaxr.xmlservice.XMLService;
import com.centrasite.jaxr.xmlservice.XMLServiceInfo;
import com.centrasite.jaxr.xmlservice.XMLServiceManager; 

String dbUrl = "http://localhost:53307/CentraSite/CentraSite";
String user = "...";
String password = "...";
String xsdFile = "C:/temp/myschema.xsd"; 

// create the required objects
Connection connection = createCentrasiteConnection(dbUrl, user, password);
Organization submittingOrganization = getSubmittingOrganization();
Organization providingOrganization = getProvidingOrganization(); 

// http methods to be supported
Collection<HttpMethods> httpMethods = new HashSet<HttpMethods>();
httpMethods.add(HttpMethods.GET);
httpMethods.add(HttpMethods.POST); 

// configuration
XMLServiceInfo xmlServiceInfo = new XMLServiceInfo();
xmlServiceInfo.setName("service name");
xmlServiceInfo.setDescription("service description");
xmlServiceInfo.setVersion("1.1");
xmlServiceInfo.setSubmittingOrganization(submittingOrganization);
xmlServiceInfo.setProvidingOrganization(providingOrganization);
xmlServiceInfo.setSchemaUrl(xsdFile);
xmlServiceInfo.setEndpoint("http://endpointurl");
xmlServiceInfo.setHttpMethods(httpMethods); 

// create XMLService
XMLServiceManager xmlServiceManager = new XMLServiceManager(connection);
XMLService xmlService = xmlServiceManager.createXMLService(xmlServiceInfo);

There are also some setter methods for additional parameters. The name, organization, native service URL, HTTP method must be set; other parameters are optional.

The XMLServiceManager class provides the setter methods listed below.

Top of page

setName

Sets a name text that will appear with the imported Service object.

Syntax

xmlServiceInfo.setName(String serviceName)

Parameters

String serviceName

Name for the service.


Top of page

setDescription

Sets a description text that will appear with the imported Service object.

Syntax

xmlServiceInfo.setDescription(String serviceDescription)

Parameters

String serviceDescription

The description text.

Usage Notes

Optional.


Top of page

setVersion

Sets a version number that will appear with the imported Service object.

Syntax

xmlServiceInfo.setVersion(String version)

Parameters

String version

An initial version identifier of the service.

Usage Notes

Optional.


Top of page

setSubmittingOrganization

Sets the name of the organization under which the service should be registered for the purposes of governance within CentraSite.

Syntax

xmlServiceInfo.setSubmittingOrganization(Organization submittingOrganization)

Parameters

Organization submittingOrganization

The name of the submitting organization.


Top of page

setProvidingOrganization

Sets the name of the organization under which the service should be registered from a business perspective.

Syntax

xmlServiceInfo.setProvidingOrganization(Organization providingOrganization)

Parameters

Organization providingOrganization

The name of the providing organization.


Top of page

setSchemaURL

Sets the URL of a native REST service to route the requests.

Syntax

xmlServiceInfo.setSchemaUrl(String xsdFileUrl)

Parameters

String xsdFileUrl

URL to the schema file of the native REST service.


Top of page

setEndpoint

Sets the schema endpoint of the native REST service to which the requests should be routed.

Syntax

xmlServiceInfo.setEndpoint(String endpoint)

Parameters

String endpoint

The native REST service's endpoint.


Top of page

setHttpMethods

Sets a protocol over which the native REST service should accept requests.

Syntax

xmlServiceInfo.setHttpMethods(Collection<HttpMethods> httpmethods)

Parameters

Collection<HttpMethods> httpmethods

The protocol to route the requests


Top of page

Removing a REST Service

You can remove a REST service from CentraSite. This function deletes the REST service and the associated schemas in the repository

Note:
If the REST service is referenced by another object, then it cannot be deleted.

The following example demonstrates how to remove a REST service from CentraSite:

String xmlServiceKey = "uddi:...";
XMLServiceManager xmlServiceManager = new XMLServiceManager(connection);
xmlServiceManager.deleteXMLService(xmlServiceKey);

The XMLServiceManager class provides the following methods for removing an REST service:

Top of page

String xmlServiceKey

Sets a UDDI key for the native REST service.

Syntax

XMLServiceManager.deleteXMLService(String xmlServiceKey)

Parameters

String xmlServiceKey

UDDI key of the native REST service.


Top of page

Importing a BPEL Process File

The BPEL importer imports objects of a Business Process Execution Language file. In CentraSite there are various specific predefined BPEL-ObjectTypes. A BPEL process flow usually references certain web services. Note that those web services should be registered prior to the BPEL registration; otherwise the references to the services cannot be established. The top-level controlling object is a BPELProcess object.

The following example demonstrates how to import a BPEL file:

import com.centrasite.jaxr.JAXRAccessor;
import com.centrasite.jaxr.bpel.BPELRegistrator;

String dbURL = "http://localhost:53307/CentraSite/CentraSite";
String bpelFile = "c:/temp/MyBPEL.bpel";
String user = ...;
String password = ...;

JAXRAccessor jaxr = new JAXRAccessor(dbURL, user, password);
    
try
{
   BPELRegistrator br = new BPELRegistrator(bpelFile, jaxr);
   br.register();
   int warnings = br.getWarningCount();    // are there unreferenced services?
}
catch (Exception e)
{
   // handle error
}
finally
{
   jaxr.close();
}

The BPELRegistrator class provides the following optional setter methods. If you want to use them, they must be called before calling the register() method.

Top of page

setProjectName

Specifies a project name, i.e. an internal RegistryPackage. The named project will receive the created top-level object (a BPELProcess) as a member.

Syntax

public void setProjectName(String projectName)

Parameters

String projectName

The desired name of the project.


Top of page

setWarningIfPLTNotFound

Specifies how CentraSite should react if a service that has not yet been registered in CentraSite is encountered.

Syntax

public void setWarningIfPLTNotFound(boolean warningIfPLTNotFound)

Parameters

boolean warningIfPLTNotFound
true

Each time a service that has not yet been registered in CentraSite is encountered, a counter is incremented. Use the getWarningCount() method to get the current value of the counter.

false

If a service that has not yet been registered in CentraSite is encountered, an exception is thrown.

Usage Notes

The default value of the parameter is "true".


Top of page

Removing a Registered BPEL Object

You can remove a registered BPEL process object. The BPEL file is removed from the repository, and all associated registry objects are also removed. Like the import class, you must first establish a CentraSite connection with an instance of the JAXRAccessor class before calling the remove or removeProcess method. The BPELAdministrator class provides the following methods:

Top of page

remove

Removes the BPEL objects of the process flow indicated in the specified BPEL file.

Syntax

public boolean remove (String bpelFile)

Parameters

String bpelFile

Specifies the BPEL file whose objects are to be removed. This could be the file in the CentraSite repository.

Return Codes

Value Meaning
true The BPEL objects were successfully removed.
false The BPEL objects could not be removed.

Top of page

removeProcess

Removes the BPEL objects of the process flow indicated by the BPELProcess name and its namespace.

Syntax

public boolean removeProcess(String bpelProcessName, String bpelNamespace

Parameters

String bpelProcessName

The process name of the BPEL objects to be removed.

String bpelNamespace

The namespace of the BPEL objects to be removed.

Return Codes

Value Meaning
true The BPEL objects were successfully removed.
false The BPEL objects could not be removed.

Top of page

Importing an XPDL File

The XPDL importer imports a process definition from an XPDL file. From the XPDL file, the importer produces a Process object and related components (e.g., Process Steps, Process Pools and Process Swimlanes). If the XPDL process references a Web service, the importer will add the Web service to the registry if it is not already present and associate it with the Process object.

The following example demonstrates how to import an XPDL file into CentraSite using the CentraSite Java API:

import com.centrasite.jaxr.JAXRAccessor;
import com.centrasite.jaxr.xpdl.ImportXPDL; 

// Set URL for CentraSite Registry/Repository
String dbURL = "http://localhost:53307/CentraSite/CentraSite"; 

// Specify the location of the XPDL file. 
String xpdlFile = "c:/temp/MyXPDL.xpdl";  

// Specify the user account and password that the importer will use to log on to CentraSite                      
String user = "ctambrose";                                       
String password = "jm6A1999";  

// Build the connection to CentraSite
JAXRAccessor jaxr = new JAXRAccessor(dbURL, user, password);    
    
try
{
// Instantiate XPDL importer object with specified XPDL file and connection info 
// and then execute the import method.

   ImportXPDL xpdl = new ImportXPDL(xpdlFile, jaxr); 
   xpdl.doImport(); 
}
catch (Exception e)
{
// Handle error
   ... 
}
finally
{
 // Close connection to CentraSite Registry/Repository

   jaxr.close();                                               
}

The ImportXPDL class provides the following optional setter methods that you can use to specify certain properties in the Process object. If you want to use these setter methods, you must call them before you call the doImport() method.

Top of page

setOrganization

Specifies the organization to which the Process object is to be added.

Syntax

public void setOrganization (Organization org)

Parameters

Organization org

The organization to which the importer will add the Process object. Note that this method takes an Organization object as input. You can obtain the Organization object for a specified organization using the BusinessQueryManager.getRegistryObject() method.

Usage Notes

Optional. If you do not set the organization parameter, the importer will add the Process object to the organization that the user specified in the JAXRAccessor belongs.


Top of page

setOriginalFilename

Specifies the filename to be assigned to the XPDL file in CentraSite's repository.

Syntax

public void setOriginalFilename (String originalFilename)

Parameters

String originalFilename

The filename that is to be given to the XPDL file in the CentraSite repository.

Note:
A valid filename can consist of letters, numbers, and the underscore character. It must not contain spaces or other special characters.

Usage Notes

Optional.


Top of page

setProductConcept

Specifies the category from the Product taxonomy by which the Process object is to be classified.

Syntax

public void setProductConcept(Concept product)

Parameters

Concept product

The Product category (concept) that is to be assigned to the Process object. This classification is generally used to identify the product from which the Process was published.

The following are some of the predefined categories in the Product taxonomy in CentraSite. (For other categories, examine the Product taxonomy on the instance of CentraSite to which you are importing the XPDL file.)

Usage Notes

Optional.


Top of page

setVersion

Specifies the version identifier that is to be assigned to the Process object that the importer adds to the registry. (This methods specifies the user-defined version identifier. The Process object will also have a version number, which is automatically assigned and maintained by CentraSite.)

Syntax

public void setVersion(String version)

Parameters

String version

The version identifier to be assigned to the Process object.

Usage Notes

Optional.


Top of page