Follow these steps to add a snippet to assign the OutputVariable
variable to the PortfolioEvaluatorProcess process:
- Switch to the PortfolioEvaluatorProcess editor.
- Click the Invoke icon
on the palette.
- Click the Snippet icon
on the palette.
- Click the WhileLoop figure
. The Snippet figure
was added.
- Switch to the Properties view.
- In the details section, click the Description tab.
- In the Display Name field, type Assign
OutputVariable .The Name field is set to AssignOutputVariable.
- In the details section, click the Details tab.
- Add the existing getQuoteOutput variable
to the canvas.
- Add the existing stockInfo variable to the
canvas and drill into stockInfo.pricePerShare.
- Connect the getQuoteOutput figure to the stockInfo.pricePerShare figure.
.
- Add the existing stockInfo variable to the
canvas and drill into stockinfo.pricePerShare.
- Add the existing stockInfo variable to the
canvas and drill into stockinfo.quantity.

- Click the Standard... icon
on the palette. The Add a Standard
Visual Snippet window opens.
- In the navigation tree, click math > multiply.
- Click OK.
- Click the canvas to add the activity.
- Connect the stockInfo.pricePerShare figure
to the multiply figure.
- Connect the stockInfo.quantity figure to
the multiply figure.

- Add the existing OutputVariable to the canvas
and drill into OutputVariable.outputStockPortfolio.value.

- Click the Standard... icon
on the palette. The Add a Standard
Visual Snippet window opens.
- In the navigation tree, click math > add.
- Click OK.
- Click the canvas to add the activity.

- Add the existing OutputVariable to the canvas
and drill into OutputVariable.outputStockPortfolio.value.
- Connect the multiply figure to the add figure.
- Connect the first OutputVariable.outputStockPortfolio.value figure
to the add figure.
- Connect the add figure to the second OutputVariable.outputStockPortfolio.value figure.

- Add the existing stockInfo variable to the
canvas.

- Click the Standard... icon
on the palette. The Add a Standard Visual Snippet window
opens.
- In the navigation tree, click SCA services > copy BO.
- Click OK.
- Click the canvas to add the activity.

- Click the Expression icon
on the palette.
- Add the expression to the canvas and type stockInfoCopy as
the label.
- Right-click the stockInfoCopy figure
.
- From the pop-up menu, select Set Type > Business Object .
The Data Type Selection window opens.
- In the Filter by type, namespace, or file (? = any character,
* = any String) field, type StockInfoBO.
- Click StockInfoBO.
- Click OK.
- Click the stockInfo figure to the copyBO figure.
- Connect the copy BO figure to the stockInfoCopy figure
.

- Add the existing OutputVariable to the canvas
and drill into OutputVariable.outputStockPortfolio.stockInfoList.
- Add the existing stockInfoCopy variable
to the canvas.

- 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 add(Object).
- Click OK.
- Click the canvas to add the activity.
- Connect the OutputVariable.outputStockPortfolio.stockInfoList figure
to the add figure.
- Connect the stockInfoCopy figure to the add figure.

- Add the existing counter variable to the
canvas.

- Click the Expression icon
on the palette.
- Add the expression to the canvas and type 1 as
the label.
- Click the Standard... icon
on the palette. The Add a Standard Visual Snippet window
opens.
- In the navigation tree, click math > add.
- Click OK.
- Click the canvas to add the activity.

- Add the existing counter variable to the
canvas.
- Connect the first counter figure to the add figure.
- Connect the 1 figure to the add figure.
- Connect the add figure to the counter figure.
- From the menu, select File > Save (or press Ctrl+S).

The User Operation is Waiting window
opens. The The user operation is waiting for "Building workspace"
to complete. page opens.
- From the menu, select File > Close (or press Ctrl+F4).
The editor closes for PortfolioEvaluatorProcess.
- From the menu, select File > Save (or press Ctrl+S).