Initializing help system before first use

Using the DMP Solution Bucket

When using a DMP component such as Xpress Insight, Xpress Workbench or Xpress Executor, in a DMP 2.0+ environment, the Mosel instance will automatically be configured to access an S3 bucket that is shared by all components in the solution. To use this, simply call s3init with the string "solutionData", or the constant S3_DMP_SOLUTIONDATA which evaluates to "solutionData":

model DmpInitExample
  uses "s3"
  declarations
    mybucket: s3bucket
  end-declarations

  ! Initialize mybucket using the '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-model

By default you will access the solutionData folder matching your component's current DMP lifecycle stage (design, staging or production). In Xpress Insight only, you can also initialize your s3bucket with the folder of a different lifecycle stage by passing one of the constants S3_DMP_DESIGN, S3_DMP_STAGING and S3_DMP_PRODUCTION, as follows:

model DmpInitExample
  uses "s3"
  declarations
    mybucket: s3bucket
  end-declarations

  ! Initialize mybucket using the 'solutionData' credentials for the 'staging' lifecycle
  s3init(mybucket, S3_DMP_SOLUTIONDATA, S3_DMP_STAGING)
  if s3status(mybucket)<>S3_OK then
    writeln("Bucket initialization error: ", s3getlasterror(mybucket))
    exit(1)
  end-if
  ! mybucket now initialized and can be used
end-model

Please note that in current versions of Xpress Executor and Xpress Workbench, the S3 credentials will only be usable within the first 45 minutes of the model's execution. This will be resolved by future updates.