Working with FICO Drive
As a user of the DMP (Decision Management Platform) version of Xpress Insight on the FICO Analytic Cloud, your apps can interact with files located in the cloud via FICO Drive, subject to some provisions in the underlying Mosel model.
FICO Drive is implemented as a layer above Amazon's S3 service.
To enable FICO Drive capabilities within a model, reference the
s3 library:
uses "s3"Then declare a variable of type s3bucket to represent the cloud-based bucket you wish to access:
declarations mybucket: s3bucket end-declarationsWhen invoked by Xpress Insight, a Mosel model instance is automatically configured to access a bucket available to all DMP components in the current solution. Its credentials can be initialized by a call to s3init with the string "solutionData", or the constant S3_DMP_SOLUTIONDATA which evaluates to it.
The following example shows how to initialize a bucket called
mybucket:
model DmpInitExample uses "s3" declarations mybucket: s3bucket end-declarations ! Initialize mybucket using ‘solutionData’ set of credentials s3init(mybucket, S3_DMP_SOLUTIONDATA) if s3status(mybucket)<>S3_OK then writeln("Bucket initialization error: ", s3getlasterror(mybucket)) exit(1) end-if ! mybucket now initialized and can be used end-modelFrom this point, mybucket is available to your Mosel code via an API that allows you to manipulate cloud-based files (upload, download, delete) and their metadata and tags, and access status objects that report on the success or failure of your API calls.
For further details of the FICO Drive API, refer to s3ref.pdf , located at http://www.fico.com/fico-xpress-optimization/docs/latest/mosel/S3/dhtml .
Determining if FICO Drive is Available
A new property, isS3Enabled, has been added to the insight object available via the Xpress Insight JavaScript API.
View developers can interrogate the value of insight.isS3Enabled to determine if an app is connected to FICO Drive, and make any necessary adjustments to the user interface. For example, they might wish to hide the Upload to cloud button if they know that the cloud service is not available.
Further information is available at http://www.fico.com/fico-xpress-optimization/docs/latest/insight/javascript_api.