Service Component Architecture (SCA) - Simple Calculator |
|
|
![]() |
|
Run | TechNotes |
This sample demonstrates a very simple SCA invocation from a JSP to a Java-object SCA component that implements a very simple addition/subtraction function. A "Math" business object is defined containing two operands and a result. A business graph object contains the math business object and a verb field that specifies the desired operation as addition or subtraction.
The file index.jsp contains the code to prepare and invoke the SCA function. The steps performed in the JSP are:
The code used for this SCA invocation can be used with minimal changes to invoke other Diamond SCA components.
The EAR file for this sample is <was_root>/samples/lib/SCASamples/SCASamples.ear. It contains:
User applications in WebSphere Process Server will have XML artifacts, such as business objects, relationship definitions, and business rules, that will need to be deployed prior to installing the application. SCASamples.ear is not an installable ear file. WebSphere Process Server provides a utility named serviceDeploy to build and deploy these artifacts. The SCASamples.ear file contains these artifacts. Utility sampleDeploy invokes serviceDeploy with specific parameters required for the samples. Running sampleDeploy will create a second EAR file named SCASamplesDeployed.ear in <was_root>/samples/lib/SCASamples. This EAR contains the WAR files that were in SCASamples.ear, plus the additional JAR and WAR files that contain the deployed artifacts. This EAR file may be installed as an Enterprise Application in WebSphere Process Server.