Best Practices for WLI Application Life Cycle

     Previous  Next    Open TOC in new window  Open Index in new window  View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

IDE Recommendations

There are a few, significant differences in developing applications between the Workshop-based Oracle WebLogic Integration (WLI) 8.x IDE and the Eclipse-based WLI IDE. This document provides tips and tricks to users familiar with the WLI 8.x environment, which help them transition to developing applications in the current WLI IDE.

This document includes the following sections:

 


Differences between WLI 8.x IDE and Eclipse-based WLI IDE

The Integrated Development Environment (IDE) for WLI is based on Oracle Workshop for WebLogic, which uses Eclipse 3.2.2. It is different from the WLI 8.x IDE as described in the following sections:

Project Structure

WLI 8.x applications included artifacts and other sub-projects such as schema, web, and EJB projects and they were hierarchical in nature. Now, WLI applications have a flat organization and consist of an EAR project, one or many Web projects and one or many Utility projects.

Each project maintains references to other related projects. When a WLI application is created through the Process Application Wizard, these references are already established. If projects are imported in WLI, then such references should be manually updated (see Managing Project Dependencies).

In a WLI application, an EAR project is the central point of the application. It is used to create EAR (Enterprise Archive) files and includes:

Note: Libraries that need to be available to any project in the application should be stored in <EAR project>/EarContent/APP-INF/lib.

In a WLI application, a Web project includes processes, controls, XQ files, message broker, and transformation files. A Utility project includes schemas, XML, and WSDLs.

When a project is created, you are required to do some or all of the following:

The above options are specified by choosing facets during project creation. Basically each project type has its own facets, which assigns the corresponding builders, validators. Facets can also be added and deleted from a project after its initial creation. To edit a project's facets, select Project > Properties > Project Facets.

Note: A process can be created only in a WEB project which has Oracle WebLogic Integration Process facet (process-enabled) added to it. Similarly a Worklist task plan can be created in an EAR project which has Worklist Integration Worklist Application Module facet (worklist-enabled) added to it.

Table 4-1 lists various artifacts and their locations.

Eclipse-based Projects

WLI applications and their projects depend on Eclipse. Unlike WLI 8.x Applications, you cannot move projects from one system to another by merely copying projects. Now, the projects have to be imported into the workspace using the Import wizard and selecting the Existing Projects into Workspace option.

File Extensions

In WLI 8.x, the various types of WLI artifacts had their own file extensions like .jpd, .dtf, .jcx. Now, unique file extensions for specialized java files like .jpd, .dtf, .jcx no longer exist. All file extensions end with .java (for example, process.java). Therefore, while creating WLI artifacts it is a good practice to name Process files, controls, and data transformations in such a way that each can be identified easily.

Note: XQuery files have .xq extensions.
No Wizard for Some Controls

Some of the Workshop controls (for example, JDBC or Timer) no longer have wizards. You must use the Source view or Annotation view to configure them.

Using Enterprise JavaBeans (EJB) Controls

To create a new EJB control, you need to import the ejb jar file and the source code of the application.

DTF Design View not Available

There is no DTF design view. Only a Source view is available.

To configure a Transformation method, right-click Source view, then select Transform, and then select one of the options (see Figure 8-1).

Figure 8-1 Configure Transformation Method

Configure Transformation Method

To reconfigure a Transformation method, open the transformation file and in Source view, select the transformation method and then right-click, select Transform > Reconfigure XQuery Transformation Method.

XQuery

WLI 8.x supports XQuery 2002. Current release of WLI supports XQuery 2004, and XQuery 2002 support is extended for backward compatibility. Upgrade of an Xquery file from 8.x to the latest release may not be successful due to the incompatibility between the XQuery specifications. In such cases, you are expected to manually correct the upgraded xquery file.

Note: An XQuery file which has not been configured in WLI 8.x can be upgraded successfully into the current release of WLI, but will lead to a compilation failure, as WLI now enforces strict configuration for XQuery method.
Iterative Development

If the interface of a Process file is modified, then you need to recreate all the other dependant artifacts (such as process controls that are generated out of this Process file, WSDLs generated from this Process file). In addition, iterative development does not automatically redeploy the application as in WLI 8.x.

In the case of Task Controls, it is very necessary to regenerate the task control each time you make a change to the Task Plan and reuse it in the process.

Standards

WLI 8.x uses the Javadoc-comment style annotations. Now, Java 5 annotations are used; therefore, when upgrading a WLI 8.x application, the annotations in the application are converted to Java 5 annotations. Some of the 8.x annotations are deprecated, because of which the conversion to Java 5 annotations may cause error. You have to manually correct them (see Upgrading Annotations).

Upgrading Sample Application System Schemas

The WLI 8.x Schema Builder allows you to a build sample application even though the namespace is not specified. The current WLI Schema Builder does not support empty namespaces. If you import the envelope.xsd from WLI 8.x, it will lead to some errors.

To fix these errors do one of the following:

Mapper Test View

The XQuery Mapper test view in WLI 8.x is not a standalone tester and always requires a running WLI server. Where as, the XQuery Mapper test view in the current release of WLI is a standalone tester and does not runs inside a process file container. (It does not matter if there is a WLI server running, the XQuery Mapper tester does not use it). This is by design, because the XQuery Mapper is used in other Oracle products outside of WLI.

 


Performance Setting for a Complex Application

If you are developing a complex application with high consumption of memory, change your JVM setting by changing the memory parameters in the file workshop.ini available at your BEA_HOME directory (for example, <BEA_HOME>\workshop_10.3\workshop.ini) as follows:

Note: The above settings are only a recommendation; you can calculate settings best suited for your machine.

 


Guidelines

Guidelines While Creating WLI Application
  1. In case you have to work on a large process, it is a good practice to divide it into a number of subprocesses (Each subprocess is also a process in itself). Individual developers can work on each sub-process. Later, all sub-processes can be called through a central process.
  2. It is good practice to, Select Add WebLogic Integration System and Control Schemas in Utility Project check box this adds the system schemas to the Utility Project/schemas folder.
  3. WLI provides a project wizard which helps you to create projects required for process and Worklist applications. In many applications, your business process may interact with a task plan. In such scenarios, it is a good practice to create a project and then add a Worklist facet to your project as follows:
    • Right-click on your Ear Project, go to Properties > Project Facets > Add and Remove Project Facets, and select WebLogic Integration Worklist Application Module and then click Finish.
    • Right-click on your Web Project, go to Properties > Project Facets > Add and Remove Project Facets, and select WebLogic Integration Worklist Application Module and Beehive NetUI 1.0 and then click Finish.
    • Create a folder under your Ear Project > EarContent, and create the task plans inside the EarContent folder.
    • Once you add a worklist facet to a process project, you can create a Process file and a task plan in the same application.

  4. Whenever you move to a specific artifact (Process file, XQ, or Worklist), ensure that you are in the appropriate perspective (Process, XQuery Transformation, and Task Plan respectively). For example, navigating to an XQuery file from a Process file does not automatically change the perspective to the XQuery Transformation perspective.
  5. If you are working with CVS, ensure the following:
  6. Do not check in the following directories to source control. (Not all of these directories and files will exist in every project.)

    • .metadata (workspace-level)
    • build (project-level folder; In every web and util project, the build folder should be excluded)
    • templib (project-level; in every web and util project, the temp lib folder, if present, should be excluded)
    • .apt_src (project-level; in every web and util project, the .apt_src folder should be excluded)
    • .xbean_src and .xbean_bin (project-level; only for projects with XMLBeans Builder enabled)
    • The following directories and files should be included in source control. (Not all of these directories and files will exist in every project.):

    • .settings/* (project-level)
    • .classpath (project-level)
    • .factorypath (project-level)
    • .project (project-level)
    • .datasync-project (project-level)
    • When you try to use this project from another machine, perform the following steps,

    • Open an empty workspace.
    • Import the Application by right clicking and selecting Import > Existing projects into workspace.
    • Select the workspace (which is the top folder), all project folders would be listed in the dialog-box.
    • Select the required folders and click OK, all folders will be imported, and then start building.
    • Note: Occasionally you might see some errors such as the library module reference: beehive-controls-1.0 is on the classpath of a dependent project, but it is not included in this EAR project. In this case, clean and build the project again. If it does not work, switch to the same workspace and build to resolve the errors.
  7. During the development process, it is quite possible that you may have to transfer resources from one developer’s system to another developer’s system. For such transfers, you make a portable ZIP file. If you are making a Portable Workspace ZIP file (contains workspace and project) manually or through an Ant task, make sure to exclude these directories:
    • .metadata (workspace-level)
    • build (project-level folder; in every web and util project, the build folder should be excluded)
    • templib (project-level; in every web and util project, the temp lib folder, if present, should be excluded)
    • .apt_src (project-level: in every web and util project, the .apt_src folder should be excluded)
    • .xbean_src and .xbean_bin (project-level; only for projects with XMLBeans Builder enabled)
    • If you are making a portable ZIP file with Oracle Workshop for WebLogic, select File > Export > Archive file > Next. In the left-hand pane, select the projects you want to include, but unselect the following directories within each project:

    • build
    • templib
    • .apt_src
    • .xbean_src and .xbean_bin (only for projects with XMLBeans Builder enabled)
    • To retain the original directory structure when your workspace has multiple projects, make sure to place a checkmark next to Create directory structure for files.

      To uncompress the ZIP file and use the workspace, select File > Import > Existing Projects into Workspace, then select Archive file option and provide the ZIP file.

Guidelines During Application Development Stage
  1. Occasionally, the XML Validator and WSDL validator associated with WTP might show errors on the XMLs/WSDLs available in the projects. Clear the XML Validator and WSDL validator check boxes on WLI-enabled utility project and Web project to disable them.
  2. Clicking on the Transformation > Create Transformation option in node editors generates a transformation file with a default name (for example, RequestQuoteTransformation.java) and a method with a default name (for example, availProcessorGetAvail). Such transformation files are difficult to share as they have system generated names. If you, want to edit the system generated names, ensure that all references to them are modified accordingly.
  3. In a node editor, each time you edit the transformation, by modifying its inputs or outputs, a new Transformation method with a new signature and a new XQ file is generated. If you intend to reuse these transformations across processes, it is good practice to develop a separate transformation file containing all node editor-related transformations, then, you can reuse the transformation methods through the Advanced Options dialog in the node editor.

  4. File control is based on DynamicProperties.xsd schema (It is a part of the system schemas), when you use file control and APIs, these schema will exist in the Work Space. In some scenarios, while creating your business process application, you have not selected the Select Add Oracle WebLogic Integration System and Control Schemas in Utility Project check box, the DynamicProperties.xsd schema will not be added to your application, and when you create a transformation in the File Control Node, using File Control and accessing FileControl Properties APIs. it leads to the IDE. To fix the problem, copy the DynamicProperties.xsd schema from <Oracle WebLogic Integration installation directory>\wli_10.3\eclipse\plugins\com.bea.wli.ide.jpd_10.3.0\templates\wli_newprocess\default_schemas_project\system location and place it to the Utility Project/schemas folder.
  5. If some annotation of a particular node is not visible in the Annotation View even after selecting that node in the Design View, try selecting the source code of that node in the source view. This should reveal the expected annotation in the annotation table.
  6. To generate Dynamic Selector XQuery on the Service Broker control, right click on the Process file in the Package Explorer pane, select Generate > Service Broker Control, then click the Query Builder Button. If you try to create a Service Broker Control in other ways such as generating it from a WSDL, configuring dynamic selector will not work.
  7. Try not to open more than one instance of Oracle Workshop for WebLogic.
  8. Try using XQuery transformations instead of relying on the XMLBeans API for simple transformations. For example if you want to retrieve EmpID from an EMP XmlBean, instead of using getEmpID() get method on that XML Bean object, create a simple XQuery transformation, using the node editor, for extracting EmpID from EMP.
  9. If your application is transformation centric, processing large (ie. ~1 MB) schemas files, the XMLBeans Builder can result in unacceptably long build times due to the performance of both the XMLBeans compiler and the Eclipse Java builder. XMLBeans compiler performance can be improved by disabling assertions for the XMLBeans code. Assertions can be disabled by adding the line "-da:org.apache.xmlbeans" to the file <BEA_HOME>\workshop_10.3\workshop.ini.
  10. There is a known issue when you drag and drop custom methods from the Task Control into the Process Canvas. The suggestion is to go to Source view and change eventSet = tmp.TaskC.Callback.class to eventSet = tmp.TaskC.CustomCallback.class in the EventHandler annotation.
Guidelines While Building an Application
  1. In the WLI IDE, the Build process has two modes – Auto and Manual. In Auto Build mode, resources (Projects, folders, files) are built as they are changed and saved. The default option is Build automatically. To improve performance you can switch off this option. To disable Build automatically, select Project tab on your menu bar, and from the drop-down list clear Build automatically.
  2. It is a good practice to perform a clean build operation once you have completed your development work or if you have build-related problems.
  3. Be sure to save your project before you build an application, changes are not saved by default.
  4. Closing projects which are not of immediate relevance may improve build performance.

 


Recommended Reading

For more information, refer to the following documents:

See edocs, for more WLI related information.


  Back to Top       Previous  Next