Adding Business Logic
After configuring the plug-in palette and activity, you can add business logic for the SayHello activity.
Prerequisites
Ensure that you have generated a HelloWorld palette and a SayHello activity, as described in Defining a HelloWorld Palette.
Procedure
-
In TIBCO Business Studio, from the menu, click
Run > Run Configurations to launch a child TIBCO Business Studio:
- In the "Create, manage, and run configurations" dialog, double-click Eclipse Application in the left panel, and then click New_configuration.
-
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
- Click Run to launch a child TIBCO Business Studio configured with the bw-runtime platform.
-
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:
- In the Select dialog, expand the General folder and select Existing Projects into Workspace. Click Next.
- In the Import Projects dialog, click Browse to locate the project folder that contains the HelloWorld plug-in project.
- Click Deselect All, and then select the runtime and model bundles, and features. Click Finish.
- 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.
- In the SayHelloAsychronousActivity.java file, find the evalOutput() method.
-
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("Hello World"); N output = PaletteUtil.parseObjtoN(SayHelloOutput.class, sayHelloOutput, processingContext, activityContext.getActivityOutputType().getTargetNamespace(), "SayHelloOutput"); // begin-custom-code // add your own business code here // end-custom-code return output; }
- Save the SayHelloAsychronousActivity.java file.
Copyright © Cloud Software Group, Inc. All Rights Reserved.