Follow these steps to add a snippet to assign the counter and numberOfSymbols
variables to the PortfolioEvaluatorProcess process:
- Switch to the PortfolioEvaluatorProcess editor.
- Click the Empty Action icon
on the palette.
- Click the Snippet icon
on the palette.
- Click the connection between Receive and Reply. The
Snippet figure
was
added.
- Switch to the Properties view.
- In the details section, click the Description tab.
- In the Display Name field, type Initialize
variables. The Name field will be set to Initializevariables.
- In the details section, click the Details tab.
- Click the Expression icon
on the palette.
- Add the expression to the canvas and type 0 as
the label.
- Add the existing counter variable to the
canvas.
- Connect the 0 figure to the counter figure
.
- Add the existing InputVariable to the canvas
and drill into InputVariable.inputStockPortfolio.stockInfoList.
- Click the Java™... icon
on the palette. The Select a Java
Visual Snippet window opens.
- In the Specify a type (? = any character, * = any String) field,
type java.util.List.
- Click List.
- Click java.util - WSInstallDir/runtimes/bi_v6_stub/java/jre/lib/core.jar.
- Click size().
- Click OK.
- Add the existing numberOfSymbols variable
to the canvas.
- Connect the InputVariable.inputStockPortfolio.stockInfoList figure
to the size figure.
- Connect the size figure to the numberOfSymbols figure.

- Click the Standard... icon
on the palette. The Add a Standard
Visual Snippet window opens.
- In the navigation tree, click SCA services > create
specific BO.
- Click OK. The Data Type Selection window
opens.
- In the Filter by type, namespace, or file (? = any character,
* = any String) field, type getStockPortfolioValueResponse.
- Click getStockPortfolioValueResponse.
- Click OK.
- Click the canvas to add the activity.
.
- Add the existing OutputVariable to the canvas.
- Connect the create getStockPortfolioResponse figure
to the OutputVariable figure.

- Click the Standard... icon
on the palette. The Add a Standard
Visual Snippet window opens.
- In the navigation tree, click SCA services > create
specific BO.
- Click OK. The Data Type Selection window
opens.
- In the Filter by type, namespace, or file (? = any character,
* = any String) field, type StockPortfolioBO.
- Click StockPortfolioBO.
- Click OK.
- Click the canvas to add the activity.

- Add the existing OutputVariable to the canvas
and drill into OutputVariable.outputStockPortfolio.
- Connect the create StockPortfolioBO figure
to the OutputVariable.outputStockPortfolio figure.

- Click the Expression icon
on the palette.
- Click the canvas to add the expression and type 0 as
the label.
- Add the existing OutputVariable variable
to the canvas and drill into OutputVariable.outputStockPortfolio.value.
- Connect the 0 figure to the OutputVariable.outputStockPortfolio.value figure.

- Click the Java... icon
on the palette. The Select a Java Visual Snippet window
opens.
- In the Specify a type (? = any character, * = any String) field,
type java.util.ArrayList.
- Click ArrayList.
- Click java.util - WSInstallDir/runtimes/bi_v6_stub/java/jre/lib/core.jar.
- Click ArrayList.
- Click OK.
- Click the canvas to add the activity.

- Add the existing OutputVariable to the canvas
and drill into OutputVariable.outputStockPortfolio.stockInfoList.
- Connect the new ArrayList figure to the OutputVariable.outputStockPortfolio.stockInfoList figure.