Scenarios for K2 Package and Deployment

  • 16 February 2021
  • 0 replies
  • 244 views

Badge +5
 

K2 Package and Deployment Scenarios

KB003588

PRODUCT
K2 Cloud
K2 Five

 

You can use the K2 Package and Deployment tool to create a package of a K2 application or application artifacts from a source environment, and then deploy the package to a target environment. Typically, you would use this tool to 'promote' a K2 application or K2 artifacts from a development (source) environment to a production (target) environment. This article describes common package and deployment scenarios.

The example packages presented here are simplified to show the concept of packaging and deployment; your applications will likely be more complex. The articles assumes that you are familiar with the Package and Deployment tool; please refer to the K2 Package and Deployment topics in your K2 product user guide (K2 Cloud, or K2 Five) to learn about the tool.

 

 

 

Contents

Deploying artifacts from a source environment to a clean target environment, full application package

In this scenario, you deploy an application from one environment (Dev) to a different K2 environment (Prod) where the application artifacts do not exist in the target environment. In other words, think of this as a first-time deployment where you want to move all application artifacts to a 'clean' environment. To do so, create a package containing all the artifacts of the application (SmartObjects, forms, views, and workflows) as a full application package, using the Included Items option to tell the tool to include artifacts that the application requires. 

The source package contains the application's SmartObject, view, form, and workflow. When creating the package, use the option to Automatically Include dependent items as Included Items option. This option tells the tool to add dependent items to the package to create a 'full' package of all the artifacts needed for the application so that when you deploy the package to the target environment, the tool can create the dependent items in the 'clean' environment.

When you deploy the package, all application artifacts are created as new artifacts in the target environment.

By default, data for SmartBox-based SmartObjects is excluded, but you can choose to include SmartBox data in the package. For example, you may have a lookup table of Regions and you want to include all the regions stored in this table to the new environment. For more information on including SmartBox data, see Creating a Package: SmartObject Data.

Deploying artifacts from a source environment to a target environment using package by reference, partial application package

In this scenario, you deploy an application package that contains only one artifact of the application while other items are included as Referenced Items. This scenario is typically used to update existing applications, or to deploy applications that use common artifacts that are shared with other applications. For example, you may have previously deployed an application to the Prod environment. You made changes to the workflow component in the application and you want to deploy only the updated workflow to the Prod environment, but not deploy any of the SmartObjects or Views/Forms for the application because those have not changed. Use the option to Automatically Include dependent items as Referenced Items option. This option tells the tool to only 'point' to dependent artifacts but not to include them in the deployment package, because those dependent items already exist in the target environment and do not need to be updated. 

By using the include dependent items as Referenced items option, the source package contains only the workflow artifact, and then references ('points to') to the SmartObject and form.

When deployed, the workflow on the target environment is updated to match the workflow from the source environment. The SmartObject and form on the target environment remain as they are.

K2 for SharePoint Package and Deployment scenarios

This section describes common scenarios when deploying K2 for SharePoint applications or K2 applications that integrate with SharePoint. 

When deploying packages for K2 for SharePoint applications, you should see the Map Service Instances screen as shown below. When deploying K2 for SharePoint artifacts, you need to tell the deployment package which K2 for SharePoint Service Instance and which lists/libraries to associate the artifacts with. Behind the scenes, the deployment tool will update the artifacts to point to the service instance in the target environment. If the service instance and list or library names are the same in both environments, the tool automatically configures these. You can deploy the package to update an existing K2 for SharePoint application, or to create a new one

Before deploying any K2 for SharePoint artifacts to a different environment, ensure that the targeted SharePoint environment has the K2 for SharePoint app, and that any required lists and libraries exist in the target SharePoint environment and those lists and libraries exactly match the lists and libraries in the source environment. The K2 deployment tool will not include the underlying SharePoint sites/lists/libraries since the K2 deployment tool only packages and deploys K2 artifacts. 

.

The deployed SmartObjects, views, forms, and workflows are refactored, applying new GUIDs to the SmartObjects, and updating the views and forms with the name of the list or library. This means that you can create a K2 package and deploy that solution to another list/library (with the same data structure) on the same SharePoint environment, or deploy the package on a different K2 for SharePoint environment.

Deploying SharePoint artifacts from a source environment to a clean target environment, full application package

In this scenario, you deploy an application package that contains all the artifacts of the SharePoint application (SmartObjects, forms, views, and workflows), packaged from a source development environment, and deployed to a target production environment that has no artifacts of this application.  In other words, think of this as a first-time deployment where you want to move all application artifacts to a 'clean' environment. As with all K2 for SharePoint packages, the matching SharePoint lists or libraries must already exist on the target environment before you deploy the package.

The source package contains the SmartObject, views, forms, and workflow for the K2 for SharePoint application.

When deploying a K2 for SharePoint package, you must use the Map Service Instance screen to select the target SharePoint service instance and the target list or library.

When the deployment completes, the SmartObject, views, form, and workflow are created as new artifacts on the target, automatically reconfigured to point to the targeted Service Instance and lists you selected in the Map Service Instance screen.

Deploying SharePoint artifacts from a source environment to a target environment using package by reference, partial SharePoint application package.

In this scenario you deploy an application package that contains only some artifacts of the application, packaged from a source development environment and deployed to a target production environment. This scenario is typically used to update existing applications, or to deploy applications that use common artifacts that are shared with other applications. For example, you may have previously deployed an application to the Prod environment. You made changes to the workflow component in the application and you want to deploy only the updated workflow to the Prod environment, but not deploy any of the SmartObjects or Views/Forms for the application because those have not changed. Use the option to Automatically Include dependent items as Referenced Items option. This option tells the tool to 'point' to dependent artifacts. Since you are creating a K2 for SharePoint package you must include the application SmartObjects as referenced items so that the deploy tool refactors the artifacts in the target environment.

The source package contains the SmartObjects and workflow process, and references to the forms.

When deployed, the workflow definition in the target environment is updated. The K2 for SharePoint application SmartObjects are updated to match the updated workflow, and the forms remain as they are.

Deploying SharePoint artifacts to the same environment to create a copy of the application applied to a new list or library, full application package

In this scenario, you deploy an application package that contains all the artifacts of the SharePoint application (SmartObjects, forms, views, and workflow process), and deploy the application to a new list on the same K2 for SharePoint environment. In other words, you would use this approach if you wanted to copy/duplicate a K2 for SharePoint application in the same K2 and SharePoint environment, but the copied application will be associated with a different list/library.

When using this approach to 'copy' a K2 for SharePoint application, the target list must have the exact same data structure as the source list. 

The source package is the same as if you were deploying the application to a different K2 for SharePoint environment. Remember to select the option to Automatically include dependent items as Included Items, which will tell the deployment package to create new instances of the associated artifacts when deploying the package. 

When you deploy the package to the same K2 environment, you will use the Configure Service Instance screen. Because the target list is a different list in the same environment, you must manually select the target list before you deploy the artifacts, as shown below.

The SmartObjects, views, forms, and workflow are created as new artifacts on the target. The deployment tool will refactor the SmartObjects, views and forms to use the target list name.

 

Deploying non-K2 for SharePoint artifacts used in a SharePoint application from a source environment to a target environment, partial SharePoint application package

If your K2 for SharePoint application uses other K2 resources (artifacts not part of the K2 for SharePoint app such as a K2 Smartbox SmartObject, or a view or form created in K2 Designer), you must package the K2 for SharePoint application’s SmartObject as references to maintain the connection between the K2 for SharePoint application and the non- K2 for SharePoint artifacts. For example, you may have created a view in K2 Designer, and then used this view in a form in your K2 for SharePoint application. You make changes to the K2 Designer view, and now you want to publish the updated view to a target environment. To maintain the connection between your K2 for SharePoint application and the updated view, you need to include a K2 for SharePoint SmartObject as a referenced item in the deployment package. 

When creating the deployment package, add the updated view, and also add the SharePoint list’s SmartObject as a referenced item as shown below. 

When you deploy the package, select the target K2 for SharePoint service and target SharePoint list, and then deploy the updated view. An updated version of the view is deployed, and the SharePoint references are maintained by the new version of the SharePoint SmartObject.

Considerations

  • Before creating or deploying packages, please review the Package and Deployment Considerations topic in your K2 product user guide (K2 Cloud, K2 Five) for important considerations about using the tool.
  • See the article KB003567: Common Package and Deployment Errors for information on and resolving common errors you may encounter when using Package and Deployment.

 


0 replies

Be the first to reply!

Reply