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, Manager, 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 the (x)= Arguments tab, and then enter the following parameters in the VM arguments field. Click Apply.
    • Microsoft Windows: -Dorg.osgi.framework.bootdelegation=javax.xml.* -XX:MaxPermSize=256m -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -XX:+UseParNewGC -Xms512m -Xmx768m
    • Linux: -Dorg.osgi.framework.bootdelegation=javax.xml.* -XX:MaxPermSize=256m -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -XX:+UseParNewGC -Xms512m -Xmx768m
    • Mac OS: -XstartOnFirstThread -Dorg.osgi.framework.bootdelegation=javax.xml.* -XX:MaxPermSize=512m -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -XX:+UseParNewGC -Xms512m -Xmx768m
  4. Click Run to launch a child TIBCO Business Studio configured with the bw-runtime platform.
  5. In the child TIBCO Business Studio, click File > Import to import the model and runtime bundles and features:
    1. In the Import 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.

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

    See Runtime Class Specification and Runtime Bundle for more details.

  7. 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.activity_name.runtime.fault package.
    3. In the com.company_name.bw.palette.activity_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.