How to automatically deploy an application when a new tenant signs up

Many applications are hosted on a server for multiple tenants. Each tenant has his own business space and the same application is deployed into each business space. When a new tenant signs up online the system needs to create a new business space for the new tenant, load the BSV file containing the configuration of the application and publish this BSV (and maybe perform some additional steps, for example send an email to the new tenant. This section explains how this can be done.

The signup web page has to be implemented outside of Aware IM – it can be any HTML page hosted on any server. This page has to collect relevant details of the new tenant and when the tenant submits the page, the page has to call the server hosting Aware IM applications using the following URL:

http(s)://ServerName:ServerPort/AwareIM/req.awcbs?Parameters

In this URL Parameters identify parameters of the request – they are separated by the “&” delimiter. Each parameter has the following format:

paramName=paramValue

Allowed parameter names are specified below:

  1. domain – this parameter specifies the name of the new business space to create. This parameter is mandatory.
  2. bsv – this parameter specifies the path on the server to the BSV file that will be deployed into the new business space. The parameter is mandatory
  3. domain_start – this parameter specifies the name of the “initial business space”. This business space should not be used to deploy an application – it should contain just one published version (of any content). A business space that is created when Aware IM is initially installed on the server can be used for these purposes. This parameter is mandatory
  4. init_process – this is an optional parameter. If specified it defines the name of the process that will be called after the BSV has been published in the new business space. The process can be useful to register user data collected by the web page (user name, company name, address etc). The process can also send an email to the user.
  5. object_name – this optional parameter can be used together with the init_process parameter. If specified the system will create an instance of the business object with the specified name and initialise it with extra parameters defined in the request (see below). This will be done just before the init_process is executed. It will then pass this instance as a process input to the process (the process should have this object declared as process input)
  6. Other parameters – if there are any other parameters in the request and the object_name parameter is specified, these parameters will be used as initialisation values for the instance of the object created. paramName should map to the name of the attribute defined in the object and paramValue will be set into this attribute when the object is created.

Here is an example of the request:

https://www.myserver.com:8080/AwareIM/req.awcbs?domain=IBM&bsv=c%3a/AppDir/app.bsv&domain_start=DefaultApp&init_process=InitApp&object_name=SignupRequest&CompanyName=IBM&EmailAddress=user%40ibm.com&Address=SomeAddress&PnoneNo=12345

This will create a new business space called IBM, load the BSV file from c:/AppDir/app.bsv, publish it, create an instance of the object SignupRequest and set its CompanyName, EmailAddress, Address and PhoneNo attributes and then call the InitApp process

  • Last modified: 2022/09/13 18:15