Version Control

Introduction

There are 2 types of version controls available in Joget App management. 
  • Application Version
  • Process Version

These versions play essential roles in managing updates and maintaining consistency within applications.

These are the instances where versioning is involved:

  • Process design update.
  • App version update.
  • App export/import.

Application version

In Joget, an application's version encompasses all its components and configurations at a specific time. This holistic snapshot includes the process designs, forms, data lists, user views, and application properties. Each application version ensures that all these elements are managed and maintained consistently.

Coverage of application version

In Joget, an application's version encompasses all its components and configurations at a specific point in time.

Component Application Version Process Version
Process Yes Yes
Form Yes  
Datalist Yes  
Userview Yes  
App Properties Yes  

 

Important
Each app version may hold more than one process version, but one can only start a process instance of the current latest process version the app version is holding.

Updating application version

Updating the application version will not affect any instances of the running process. When you create a new version of the existing app, the current version is cloned to a new version number with all its components and configurations. Note that only one version can be published at any time, and end users will only interact with the published version.

These are the instances when the process version will change. 

  • Create a new version of the existing app version.

    The current app version selected will be cloned (process, form, datalist, userview and properties, including default plugin properties, message bundles, and environment variables ) to the following available version number.

  • Import of App.

Important

  • There can only be one published version at any point in time.
  • End users will only be able to access the published version and consume what is available (accessing process, form, datalist, userview, etc) in that version except for process instance's form access. (Read more under the process version below).
  • When switching published versions, assess the differences between the current and soon-to-be-published versions to consider possible impacts on end users. For example, if you use an environment variable as an incremental counter, you may want to ensure that the new counter starts where the old one left off.

Process version

Process versions are specific to each app version, and changes are managed to process designs.

Inside an app version, it contains process design, but process design has its version called process version.

Each process version belongs to only one app version.

Determine the current process version

Click the Show Additional Info link under each process in the processes tab to reveal the Process Definition ID. The process version is between the 2 hashes.

Coverage of application version

The application version in Joget covers all essential components required for the app's functionality. Each component is versioned under the application version to ensure consistency and manageability.

Component Application Version Process Version
Process Yes Yes
Form Yes  
Datalist Yes  
Userview Yes  
App Properties Yes  

Updating process version

These are the instances when the process version will change.

  • Process design update via deployment from Process Builder or uploading a .xpdl definition file.
  • Import of App.

When one of the above occurs, Joget Workflow will find the next available process version and assign it to it.

App Version Process Version Action Taken
1 1  
1 1 -> 2 Process design update

For example, in the table above, upon process design update via process builder, the process version will now turn to 2 from 1.

In some cases, one may perform a process design update on an older app version even though there's a newer app version in place, as illustrated in the table below.

App Version Process Version Action Taken
1 1  
1 1 -> 3 Process design update
2 2  

In this case, app version 1 will now hold process version 3, not 2.

Finding the app version of the process version

In the Monitor Apps section, one can navigate to the process instance view and click the Process Name link to lead to the designer console of the app version. From the screenshot below, this particular instance is of process version 3 and belongs to app version 2.

Important

  • One will always start a new process instance using the latest process version of the current published version.
  • All existing running process instances in the same app version will automatically be updated to the new process flow in the background by updating the process design in the same app version.
    Do not perform this unless it is necessary in a production server.
  • Process migration will take place once the process design is changed. Repetitive process change deployment will disrupt existing process instances migration in the background.
    You will be seeing the following sample log messages when migration takes place.
    INFO  28 Apr 2017 10:41:52 org.joget.apps.app.service.AppServiceImpl$1  - Updating running processes for hr_expense from 4 to 5
    INFO  28 Apr 2017 10:41:54 org.joget.apps.app.service.AppServiceImpl$1  - Completed updating running processes for hr_expense from 4 to 5

After you update the process design, check all the activity/plugin mappings to ensure they are current and in sync with your process design. 

Process Migration

The following will take place during the migration of process instances:-
1. Abort pending process instances.
2. New process instances will be created. (A new process instance ID will be created in which you can find the linkage in the database table wf_process_link)
3. Resume by matching previous pending activities IDs with the new Process version’s design.

Access of Forms

Forms associated with process instances are tied to the app version where the process started, regardless of published versions. To manage form access correctly:

  • Published Version: This does not affect access to forms used by process instances. Do not remove an app version in a production server if process instances run out.
  • Form Cloning: Clone forms from previous app versions to maintain access and visibility within the current app version.
  • Resolution: To ensure the correct form is displayed:
    • Clone forms from earlier versions.
    • Use hidden fields to indicate the originating app/process version.
    • Create CRUD userview menus with version filters for clarity.

For example, in the table and screenshot below, 123_expenseclaim_process1 will show forms mapped according to their activity mappings under app version 1, regardless of whether app version 1 or 2 is published.

On the other hand, 124_expenseclaim_process1 will show forms from app version 2.

App Version Process Version Action Taken
1 1 Started a process instance 123_expenseclaim_process1
2 2 Started a process instance 124_expenseclaim_process1

 

By accessing the form record created by a process instance of a different app version, you may not see the exact form used during the process instance flow process. As such, you can clone the form from the originating app version into the current app version you are working on to gain access to the very form used during the process flow.

For example, the screenshot below shows a form with 3 fields in a process instance assignment. Remember that the form used for this process instance originates from the app version the process instance started in.

For the same record row, when viewed in a CRUD userview menu, there's an extra field given that a field has been added to the form in the current published version.

To resolve the possible confusion and display the correct form intended for the record row, the following actions can be taken:-

  1. Copy the form from the earlier app version into the published one.
  2. Identify the app/process version from which each record originates by adding a hidden field in the form using the appropriate hash variable (e.g., #assignment.processVersion#).
  3. Create a CRUD userview menu for each specific app/process version with a version filter in place for each app/process version.

How to obtain current app version?

The following code can be used in Bean Shell:

  • Process Tool
  • Form Post Submission Processing Tool
import org.joget.apps.app.model.AppDefinition;
String appVersion = appDef.getVersion().toString();
Created by Julieth Last modified by Aadrian on Dec 13, 2024