Adding Business Logic

At run time, you can add your own logic for each activity.

Prerequisites

Ensure that you have generated a palette and activities of the plug-in, as described in Defining a Palette and Adding and Configuring Activities.

Procedure

  1. In the parent TIBCO Business Studio with the running platform selected, click Run > Run Configurations.
  2. In the "Create, manage, and run configurations" dialog, double-click Eclipse Application in the left panel to create a new Eclipse application.
    You can also use an existing Eclipse application.
  3. Click Debug to launch a child TIBCO Business Studio configured with the bw-runtime platform.
  4. In the child TIBCO Business Studio, click File > Import to import the model and runtime bundles and features:
    1. In the Select dialog, expand the General folder and select Existing Projects into Workspace. Click Next.
    2. In the Import Projects dialog, click Browse to locate the project folder that contains the plug-in project.
    3. Click Deselect All, and then select the runtime and model bundles and features. Click Finish.
    The runtime and model bundles are loaded in the child TIBCO Business Studio.

  5. Click the runtime bundle, and then click the src folder to add the business logic.

    Plain Ordinary Java Object (POJO) class is supported for implementation of source code. You can assign values to POJO classes, and output is automatically generated.

    See Runtime Class Specification and Runtime Bundle for more details.

  6. If you have specified multiple faults when configuring activities at design time, BusinessWorks Plug-in Development Kit only generates the first fault schema at run time. You have to add other faults manually at run time:
    1. Expand the runtime bundle and find the src folder.
    2. Expand the com.company_name.bw.palette.palette_name.runtime.fault package.
    3. In the com.company_name.bw.palette.palette_name.runtime.fault package, make a copy of the fault_nameFault.java file.
    4. Open the copied file and build the other faults by using the private <N, A> N constructErrData () method and the public QName getFaultElementQName() method.