Migration notes 2.0
This page explains the changes required to migrate to the stated version of the SIMM Accelerator.
Migrate to 2.0
Upgrading from version 1.4 See SIMM 2.0.0 Release Notes.
The Accelerator is using ActivePivot 5.10.5 and ActiveUI 5.0.4.
For new features and fixes included in these releases, please see the ActiveUI documentation and ActiveUI Migration Notes, and the release notes for ActivePivot.
For clients licensed to use ActiveMonitor, a skeleton module based on version 5.9.6 is included with the SIMM Accelerator 2.0.0 release.
Input file formats
No change.
Configuration files
File | Details |
---|---|
calibrations-10d-2.4.tsv | The calibration information for ISDA Simm v2.4’s 10-day calculation mode |
calibarations-1d-2.4.tsv | The calibration information for ISDA Simm v2.4’s 1-day calculation mode |
Files Modified
simm.properties
New properties:
Property Name | Comment | Value |
---|---|---|
unsegregated.regulation | Sets the value for the unsegregated regulation (currently only the SEC allows you to have unsegregated margin) | SEC-unseg |
Datastores
No change.
Cube schema
No change.
Context values
No change.
Migrating to Accelerator-sdk v.5
Project Structure Changes
Accelerators based on the activeUI-sdk now have a slightly different project structure. Prior to activeUI 5, the accelerator project was based on a React component called the DesktopApp, which was exported from the accelerator-sdk. ActiveUI 5 projects will now be based on the activeUI5 app, which can be downloaded from the ActiveUI documentation page. Navigate to Docs –> Getting Started to get the latest version of the activeUI starter application.
ActiveUI and the Accelerator-sdk have also been updated to ant design 4. Keep this in mind, as you will need to migrate all of your custom code to use ant design 4 before migrating over to the new accelerator-sdk.
Installing Dependencies
note
We recommend that you use the latest LTS version of Node 16.x.x for the accelerator projects, even though ActiveUI 5 only requires that you use Node 14.x.x. During development we’ve experienced pains + minor issues using Node Node 14.x.x.
After downloading the activeuI5 app, run these commands in the following order to test that the app works as expected:
1) yarn install
2) yarn build
3) yarn start
The yarn start command opens the project in your browser, displaying a blank ActiveUI5 project.
After confirming that the project starts correctly, add the accelerator-sdk and accelerator-specific packages to your project. You can do this by going to the package.json file of your project, and adding the following dependencies:
"@activeviam/simm-sdk": "5.0.0",
"@activeviam/accelerator-sdk": "5.0.0",
After adding these dependencies to your package.json, rerun the yarn install command.
Applying accelerator code to your project
Once the dependencies have been installed, add the code from the accelerator-sdk and the accelerator-specific sdk to your application.
The simm-sdk currently exports the trade-novation widget / pivot table context menu action from the package.
import { defaultPlugins } from "@activeviam/accelerator-sdk";
import { tradeNovationWidgetPlugin, tradeNovationContextMenuActionPlugin } from "@activeviam/simm-sdk";
After importing the simm-sdk code, you need to register them in the activeUI5 plugin registry. You can do this by adding them to the widget property on the defaultPlugins object exported from the accelerator-sdk. This is an example of one of the ways to update the widget property:
import _ from "lodash";
import { defaultPlugins } from "@activeviam/accelerator-sdk";
import { tradeNovationWidgetPlugin, tradeNovationContextMenuActionPlugin } from "@activeviam/simm-sdk";
const allPlugins = _.set(
defaultPlugins,
`widget.${tradeNovationWidgetPlugin.key}`,
tradeNovationWidgetPlugin,
);
_.set(
allPlugins,
`menu-item.${tradeNovationContextMenuActionPlugin.key}`,
tradeNovationContextMenuActionPlugin,
);
After this code, the allPlugins object will contain the tradeNovation widget and context menu action. Now, simply pass this into the activeUI plugins extension point:
configuration.pluginRegistry = allPlugins;
Accelerator Settings
For any of the widgets to work in the new activeUI 5 app, certain settings must be set, and registered using the activeUI 5 configuration.higherOrderComponents extension point. The following is an object that represents the settings required for the accelerator to work:
const simmSettings = {
asOfDateDimensionName: "Time",
asOfDateHierarchyName: "AsOfDate",
tradeDimensionName: "Trade/Position",
tradeHierarchyName: "Trades",
"accelerator_parameter-sets-widget-container.server.whitelist": ["SIMM"],
"accelerator_file-upload.server.whitelist": ["SIMM"],
"accelerator_whatif-manager.server.whitelist": ["SIMM"],
"simm_additional-margin-parameter-widget-container.server.whitelist": [
"SIMM",
],
"accelerator_parameter-sets-widget-container.server.params": {
SIMM: {
store: "Calibrations",
parameterSet: "10d",
parameterStores: {
Calibrations: ["Parameter"],
},
},
},
"accelerator_file-upload.server.params": {
SIMM: {
groupSelectorEnabled: true,
getFilePathsRestEndpoint:
"/services/rest/whatif/fileUpload/retrieveStagedFile",
sendFilePathsRestEndpoint: "/services/rest/whatif/fileUpload/upload/",
successMessage: "What-if successfully triggered",
initialPrompt:
"Please select the topic you wish to contribute to your What-if",
fileSelectorPlaceholder: "Select a File",
uploadNamePlaceholder: "What-if Branch Name",
stagingDirectoryName: "stage",
filePathSpliterator: "\\",
selectableDirectories: true,
},
},
"accelerator_documentation-widget-container.server.whitelist": ["SIMM"],
"accelerator_documentation-widget-container.server.params": {
SIMM: {
documentationBaseURL: `${window.env.activePivotServers.SIMM.url}/documentation/`,
documentationLandingPage: "index.html",
},
},
};
After creating this object, add the following import to your index.js file:
import { withClientSettings } from "@activeviam/accelerator-sdk";
Add the following line to your code:
const accSdkHoc = withClientSettings(simmSettings);
Once you’ve created the accelerator-sdk higher order component, you need to pass the accSdkHoc object to the configuration.higherOrderComponents extension point in order for the settings to be accessible throughout the activeUI application:
configuration.higherOrderComponents = [withSandboxClients, accSdkHoc];
Accelerator Settings
To register your own settings, simply add them to the simmSettings object that you just created. You can add any settings you need for your custom code, as long as the setting name does not clash with any of the accelerator settings. A good rule of thumb is to prefix the setting with your project name, in order to avoid clashing.
To use any custom settings that you may have added, you can use a custom hook designed by the accelerator team. The first step is to import this hook from the accelerator-sdk as such:
import { useAccSdkSettings } from "@activeviam/accelerator-sdk";
This hook follows the standard rules of hooks, and should be used only at the top level of any react component.
const customWidget = () => {
const settingsFromHook = useAccSdkSettings();
return <div>Name: {settingsFromHook.widgetName}</div>
}
Migrating Bookmarks
Activeui 5 relies on a new content server structure, which means that the bookmarks need to be migrated to be compatible with this version. ActiveUI 4 bookmarks are not compatible with ActiveUI 5.
There is a simple tool that you can download to migrate your bookmarks though. You can install it by running yarn global add activeui-migration
or npm install -g activeui-migration
, and run it by using the migrate
command that gets installed. The instructions on how to use the tool, as well as the tool itself, can be found on the github repository for the tool. If you have difficulties installing the tool from the public repo, we recommend you install and build the tool from this repo.
In order to use the tool, you will need the server file for your input, we have included that file here
note
ActiveUI 5 does not have any context value widgets, as such, you must remove them from your bookmarks before migrating them. The migration will not fail with them in your bookmarks, but you will get an error when you open a bookmark with a context value widget in it.