Deploying Service Objects to Different Environments
Project life cycles require that the application be hosted between a staging and a production environment. The staging environment is used for development and testing; once complete, the production environment hosts the application for it's remaining life cycle. Since K2 connect relies on number of resources external to K2, publishing service objects to the production environment can pose a number of resource issues that need to be considered before the project can go live. This topic will look at some of those considerations.
When developing a service object, the staging environment needs to be aware of a SAP instance or destination to which BAPI calls can be made. The K2 connect service object designer requires that a default destination be identified. The default destination is user configured, i.e. the user selects which destination to be used as the default and is dependent on which BAPIs accessible at that destination.
Shown in the image is an example environment that has two (or multiple) destinations. The destinations mirror each other and this example is intended to typify a staging to Production method of development. The staging environment must mirror the production environment to avoid runtime resource availability errors.
Service Objects can be deployed into different environments so long as the following requirements are met:
- The BAPIs availability must be identical.
- They have access to a destination that is similar to the original.
Why a default Destination ?
The default Destination determines which environment the service object runs against. If, as shown in the image, two similar environments exist side by side Staging and Production then publishing service objects to a different environment requires that the Default environment selected be changed. Once the new default environment is selected, the service object can be published to the new environment.
An important factor is that when you publish your Service Object to another server than the one in your current environment (staging), you will have to refresh the service instance on the production environment manually as the designer will only refresh the current environment service instance. Also, the default destination on your current environment (dev) should be configured to your Staging SAP instance, and the default destination on your production environment should be configured to your prod SAP instance.
The default destination is set by the user, and can be reconfigured at any time. The default destination can be altered from the Destination Explorer or from within K2 Designer for Visual Studio. To change the default from the destination explorer, follow the steps below:
- Open the K2 Destination explorer.
- Select an existing destination but one whose name is NOT IN RED. Red identifies the destination as the default destination. Right click on the destination and select Set as Default Destination.
- Refresh your service instance for the K2 connect server. This must be done from the following location: K2 connect Administration > K2 Settings. When done from the administration tools, this automatically stops and starts your K2 connect server before refreshing the service instance. This is required because a security label is required for the destination instance.
If the destination required does not exist, then it must be added as a destination before these steps can be followed.
The method described above only applies to standard BAPI’s i.e. the BAPI must be accessible from the initial destination as well as the reconfigured.