Open topic with navigation

TIBCO ActiveMatrix BusinessWorks™ Plug-in Development Kit 6.3.1

# Adding Business Logic

After configuring the plug-in palette and activity, you can add business logic for the SayHello activity.

Before you begin

Ensure that you have generated a HelloWorld palette and a SayHello activity, as described in Defining a HelloWorld Palette.

Procedure
1. In TIBCO Business Studio, from the menu, click Run > Run Configurations to launch a child TIBCO Business Studio:
   1. In the "Create, manage, and run configurations" dialog box, double-click Eclipse Application in the left panel, and then click New_configuration.
   2. Click Run to launch a child TIBCO Business Studio configured with the bw-runtime platform.
2. In the child TIBCO Business Studio, click File > Import to import the features and bundles of runtime and model to the child TIBCO Business Studio:
   1. In the Select dialog box, expand the General folder and select Existing Projects into Workspace. Click Next.
   2. In the Import Projects dialog box, click Browse to locate the project folder that contains the HelloWorld plug-in project.
   3. Click Deselect All, and then select the runtime and model bundles, and features. Click Finish.
   The bundles and features of runtime and model are loaded in the child TIBCO Business Studio.

3. In the Project Explorer view, expand the com.tibco.bw.palette.helloworld.runtime folder, and then click src > com.tibco.bw.palette.helloworld.runtime > SayHelloAsynchronousActivity.java.
4. In the SayHelloAsychronousActivity.java file, add the evalOutput() method in SayHelloActivityExecutor class.
5. In the evalOutput() method, enter Hello World as the output text.
   This method is used to generate the output structure for an activity by passing the string value to the output structure.

       protected <A> N evalOutput(N inputData, ProcessingContext<N> processingContext, Object data) throws Exception {

       	SayHelloOutput sayHelloOutput = new SayHelloOutput();
       	sayHelloOutput.setOutput("String Value");
       	// begin-custom-code
       	// add your own business code here
       sayHelloOutput.setOutput("Hello World");
       	// end-custom-code
       N outputNode = PaletteUtil.parseObjtoN(SayHelloOutput.class, sayHelloOutput, processingContext, activityContext.getActivityOutputType().getTargetNamespace(), "SayHelloOutput");
       	return outputNode;
       }

6. Save the SayHelloAsychronousActivity.java file.

What to do next

Running the HelloWorld Plug-in

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO ActiveMatrix BusinessWorks™ Plug-in Development Kit

Copyright © 2014-2022. TIBCO Software Inc. All Rights Reserved.