Versions
The Management Console in K2 Workspace is superseded by the K2 Management Site and you should use the K2 Management Site to administer your K2 environment, rather than Management Console in K2 Workspace. (In certain cases you may need to use the Management Console in K2 Workspace to perform tasks that are not exposed in the K2 Management Site.)
The Versions section is used to set manage and delete versions of a process definition, as well as to Versions in a process.
It is important to understand the way in which process versioning works in K2. When a new or updated workflow definition is published, a new version of that process will be created in the target environment and will automatically be set as the default version. Any new instances of the process that start will use the default version. Therefore, any new instances of the process that are started will, by default, use the last deployed version of the workflow.
Existing instances of the process are not automatically upgraded to the latest version. This is due in part because the process could entirely change between versions. Also, you want to avoid someone subverting the process by deploying a new version temporarily and then reverting it back later. Under normal circumstances, when a process instance is started against a version of the process , that process instance will continue running on the same version of the process definition, even if new versions of the process are deployed to the K2 server while that instance is active. K2 will not automatically “upgrade” running/active instances of the process to the latest version. (There are APIs and community tools available that allow you to migrate "in-flight" workflows from one version to another. See the Live Instance Management API in the K2 developer reference for more information.)
You can use the Versions page to promote or demote a workflow version to Default. Remember that existing workflow instances will not be changed as a result of this change, it only affects new instances of the workflow. Whenever a new version of the workflow is deployed, that version automatically becomes the default version, even if the previous default version was manually overridden by an administrator earlier.
You can also delete old versions of the workflow or the entire workflow definition from the Versions page. Deleting workflows can help to clean up an environment and recover database space.
Option | Description |
---|---|
Selected | Selects the Version, allowing the Set to Default Process button to be used. |
Delete Process | Enables the user to delete specific or all process versions and instances along with certain dependencies. |
Version | The Version deployment number (automatically determined and incremented by K2 when a workflow is deployed) |
Version Label | The Label of the Process Version, can be provided by the workflow designer in certain workflow design tools. |
Version Description | The Description of the Process Version, can be provided by the workflow designer in certain workflow design tools. |
Version Date | The date that the Version was deployed. |
Source | Download the workflow definition as a zipped file for editing in adesign tool like K2 Studio or K2 for Visual Studio. |
Export User | The name of the user who deployed the Process. |
Default | Shows which Process is set as the default Process . |
Set to Default | Sets the Version to Default. |
The process life cycle begins in one of the K2 Designers from where the process definition is deployed to the K2 Server. During the life cycle there will be instances of the process which will be completed, go into error or some that are never completed. There may be dependencies such as SmartObjects or reporting that relies on the data generated by the process. There will also be data stored in the K2 Database and log data in log files. Also, since process definitions are often updated and redeployed to suit changing organizational needs, there may be multiple versions of the original process and all the associated data and dependencies that go along with it.
This is especially true in development environments, where developers may have deployed sample or test workflows and the environment becomes cluttered over time and you want to clean up the environment. You could also use this approach to delete workflows and their associated reporting data from a K2 environment to reduce the size of the K2 database.
Although every effort has been made to ensure that the Process Deletion functionality is able to scope the relevant dependencies; due to the diverse nature of these dependencies it is simply not possible to track all dependencies. As a result, if the user sees a notification popup indicating a warning then caution should be exercised before deleting the process. It may be necessary to enlist the help of the workflow developer so that all the required artifacts are deleted when a workflow is deleted..
Deleted Process Dependencies
When the process is deleted there are default items which are deleted namely the process definition, process instances and associated data. For processes that have a higher level of association and integration, certain aspects of these dependencies would either not be traceable or the process deletion functionality may not be able to remove it.
In some instances, owing to regulatory requirements the user may not want certain data elements to be deleted. However, if they are the onus would be on the user to ensure that they have been backed up.
Here is a list of what will be deleted for a Process definition by version; i.e. the process dependencies namely:
- Process Version with instances.
-
IPC up to 1st level
- Child processes that have never been called may not appear.
- Reporting SmartObjects.
- SmartObjects with an association to Reporting SmartObjects (Note: This only takes place if the Reporting SmartObject is deleted as well).
- Event Bus Constructs / Notifications (Note: This dependency is queried by process name only).
Process Types
The following process types can be deleted using the Process Deletion feature along with the associated dependencies. The information serves merely as a guideline and does not attempt to cover all possible supported scenarios or dependencies.
Process Type | Standard Process | SmartObject Process | SharePoint Integration | InfoPath Integration |
---|---|---|---|---|
Process Instance | Yes | Yes | Yes | Yes |
Process Data | Yes | Yes | Yes | Yes |
SmartObjects | Yes | Yes | Yes | Yes |
Reporting SmartObjects | Yes | Yes | Yes | Yes |
IPC | Yes1 | Yes1 | Yes1 | Yes1 |
InfoPath Forms | No - Delete Manually | No - Delete Manually | No - Delete Manually | No - Delete Manually |
SharePoint Site Deployment | No - Delete Manually2 | No - Delete Manually2 | No - Delete Manually2 | No - Delete Manually2 |
- Only the first level may surface as a dependency and only if a running instance(s) are active.
- If for example an InfoPath process has been deployed to a SharePoint list and the process is deleted, the process will remain listed on the SharePoint List and when a user attempts to start a process, an error message will display.
Considerations
- When configuring the Child IPC, the user has the option of configuring the process as Synchronous or Asynchronous. Depending on the selection, the following outcomes will take effect when the process dependencies are determined.
- Synchronous: Dependencies can be determined as the outcome of the parent process is dependent on the outcome of the IPC Child - provided at least one process instance is active or was fired previously.
- Asynchronous: Since the parent process does not rely on the outcome of the child, there is no link between the two and dependencies may not be shown.
The Delete Process dialog will appear as shown below. The example below illustrates the dialog with all options available. When you select a process to delete, the dialog will determine the most likely course of action and the Delete Process dialog may change. .
The example Delete Process user page below is one example that will be used to describe the options that are available. (Since the page will change dynamically depending on the selection made, see the next subsequent topics to describe 3 most likely scenarios. Not all possible scenarios will be covered.)
Since it is not possible for this feature to predict and locate all items that will be affected by a Process Delete Action, the best resource to make decisions about deleting a process would be an individual familiar with the process and all it's dependencies.
Field | Description |
---|---|
Show Dependencies | This button is disabled by default and is used to refresh the Dependencies listing at the lower part of the user page. |
Delete | Clicking this button will execute the tasks configured on the Delete Process user page. |
Select Which Version(s) to Delete |
|
Delete all historical (log) data based on the version deleted |
All historical (log) data related to the version of the process selected will be deleted. |
Delete workflow reporting SmartObjects | This option will only be enabled when the Delete all historical (log) data based on the version deleted is enabled first. The option to Delete all historical (log) data based on the version deleted can be disabled afterwards but the option to Delete all historical (log) data based on the version deleted must be enabled in conjunction with Delete workflow reporting SmartObjects. |
Delete workflow reporting SmartObjects |
The dependencies listed are generated by default when the user page loads. If changes are made to the settings, the list does not refresh automatically. Click the Dependencies button to refresh the listing. The role of the dependencies is to identify the items that will be affected. The impact of such really depends on how interdependent the process deleted is on or by other Processes. The impact of deleting a process can only be determined by the developer who created the process and this would be dependant on the level of integration and interdependency. |
Save results to file | The results can be exported to Excel by clicking this option, and then the user can choose the file format to save the information into. If Excel is not available, the system Text editor available for example Notepad will be opened instead and the information stored in CSV format. |
The Selected Version is the version of the process selected from the Process Version page i.e. the previous page.
The version of the process selected for deletion is noted in brackets. If the wrong version number is listed in brackets, to correct this the user must close the user page, select the correct version designated for deletion and press Delete process again. There is no mechanism to alter the version number from this user page.
- From the Process Versions list, select a version of the process (but not the default version) and then select Delete Process.
-
The Delete Process options dialog will appear:
-
Optional: Enable the option: Delete all historical (log) data based on the version deleted this will enable the option Delete workflow reporting SmartObjectsat the same time.
(The option to Delete workflow reporting SmartObject is only available when the option Delete all versions has been selected.)
- If no changes are made to the above selection, then the user can proceed to select Delete.
- If changes are made to the selection, click Show Dependencies first and then the user may delete the process.
- The following warning message will display:
- Make a selection to proceed.
- Optional Step : Click save results to file to export the dependencies to Excel (If Microsoft Office is available) or Notepad to save the items affected and dependencies.
The system will prevent the user from deleting the default version unless the user is going to Delete all versions as well. If the user does select the default version, the Delete Process user page dynamically assumes that the user wants to retain the default version and delete all other versions. Since the process selected and the default version are the same, the option to Delete selected version is disabled.
- From the Process Versions list, if no process version is selected or the default version is selected the option to Delete all versions except the default version is enabled.
- On the Delete Process screen, enable the Delete all historical (log) data based on the version deleted this will enable the option Delete workflow reporting SmartObjects at the same time. Note: The option to Delete workflow reporting SmartObject is only available when the option Delete all versions has been selected.
Field Description Show Dependencies This button is disabled by default and is used to refresh the Dependencies: listing at the lower part of the user page. It only enables if a change is made to the user page configuration which requires a refresh of the original information. Delete This button, when clicked will implement the deletion and perform the tasks configured on the Delete Process user page. Select Which Version(s) to Delete - Delete selected Version (X): This deletes the version that was selected or highlighted from the Process Versions page. The version number of the selected process is noted in the brackets.
- Delete all versions except the default version(x): This option, will delete all versions except the default version. The version number of the default version is in brackets.
- Delete All Versions: This option will delete all the process definitions for this process regardless of the version selected.
Delete all historical (log) data based on the version deleted All historical (log) data related to the version of the process selected will be deleted.
Delete workflow reporting SmartObjects This option will only be enabled when the Delete all historical (log) data based on the version deleted is enabled first. The option to Delete all historical (log) data based on the version deleted can be disabled afterwards, but the option to Delete all historical (log) data based on the version deleted must be enabled in conjunction with Delete workflow reporting SmartObjects. Delete workflow reporting SmartObjects The option to Delete workflow reporting SmartObject is only available when the option Delete all versions has been selected.
Save results to file The results can be exported to Excel by clicking this option, and then the user can choose the file format to save the information into. If Excel is not available, the system Text editor available for example Notepad will be opened instead and the information stored in CSV format. - If no changes are made to the above selection, then the user can proceed to select Delete, If changes are made to the selection, click Show Dependencies first and then the user may delete the Process.
-
The following warning message will display:
-
Make a selection to proceed.
Optional Step : Click save results to file to export the dependencies to Excel (If Microsoft Office is available) or Notepad to save the items affected and dependencies.
The Delete All versions option, unlike the Delete all versions except the default version option, will delete the default version along with any other process versions that are available.
- The user does not need to select a process version, select Delete Process to proceed.
-
The Delete Process options dialog will appear and enable the option Delete all versions.
Field Description Show Dependencies This button is disabled by default and is used to refresh the Dependencies: listing at the lower part of the user page. It only enables if a change is made to the user page configuration which requires a refresh of the original information. Delete This button, when clicked will implement the deletion and perform the tasks configured on the Delete Process user page. Select Which Version(s) to Delete - Delete selected Version (X): This deletes the version that was selected or highlighted from the Process Versions page. The version number of the selected process is noted in the brackets.
Delete all versions except the default version(x): This option, will delete all versions except the default version. The version number of the default version is in brackets.
Note: If the selected version and the default version are the same, then when this user page loads the option to delete the selected Version is disabled
Delete All Versions: This option will delete all the process definitions for this process regardless of the version selected.
Delete all historical (log) data based on the version deleted All historical (log) data related to the version of the process selected will be deleted.
Delete workflow reporting SmartObjects This option will only be enabled when the Delete all historical (log) data based on the version deleted is enabled first. The option to Delete all historical (log) data based on the version deleted can be disabled afterwards but the option to Delete all historical (log) data based on the version deleted must be enabled in conjunction with Delete workflow reporting SmartObjects. Save results to file The results can be exported to Excel by clicking this option, and then the user can choose the file format to save the information into. If Excel is not available, the system Text editor available for example Notepad will be opened instead and the information stored in CSV format. -
Enable the option: Delete all historical (log) data based on the version deleted this will enable the option Delete workflow reporting SmartObjects
at the same time.
The option to Delete workflow reporting SmartObject is only available when the option Delete all versions has been selected.
-
If no changes are made to the above selection, then the user can proceed to select Delete, if changes are made to the selection, click Show Dependencies first and then the user may delete the Process.
-
The following warning message will display:
It is not possible to map all dependencies or determine how deleting them will impact on the designated K2 Installation.
-
Make a selection to proceed.
Optional Step : Click save results to file to export the dependencies to Excel (If Microsoft Office is available) or Notepad to save the items affected and dependencies.
By default, K2 server events are executed in the security context of the K2 service account. While this is acceptable for most cases, there may be instances where the K2 service account may not have the necessary permissions in a specific system to perform a particular action. Here is an example: suppose that a particular SharePoint list has been set to read-only for all users except for a specific service account. The SharePoint site owner is unwilling to give the K2 service account permissions on the list because it means a workflow designer could create a workflow that modifies the list, deploy the workflow., start an instance of the workflow and thus, because the server event is executed by the K2 server, modify the SharePoint list.
Once approach you can use to address this requirement is to use the Run As security feature to change the user credentials for the specific server event that should be allowed to change that protected list in SharePoint. To do so, select the version of the workflow you wish to modify, then select the specific event in the list of server events and use the browse button to type the new credentials (username and password) that K2 should use when that event is executed. At runtime, K2 will use the new credentials for the specific event, which means that the SharePoint list does not necessarily have to be exposed to the K2 service account
Selecting a version and a server event to specify new credentials
Considerations for setting credentials for server events:
- You cannot dynamically pass the credentials through at runtime. This means that you cannot force K2 to “impersonate” say, the originator of the workflow when it performs a server event, since it is not possible to impersonate a user dynamically from a server event
- If the specified user account’s credentials expire (for example, the password changes) the server event will fail
- The security credentials are not automatically applied to new versions of the workflow. If a new version is deployed, you will need to set the security credentials again
- The security credentials are set on Activity level, so all Events within that Activity will execute under the same credentials. If you need to execute different events under different credentials, you will need to move those events into separate activities and then set up the Run As security for each activity separately.
- Note that it is also possible for the workflow developer to assign security credentials for server events at design time. If this approach is used, the alternative credentials will automatically be applied to the events when the workflow is deployed and it is not necessary to use the workspace to set up the runtime credentials again.