Creating a new Package Type and Defining Package States

Before deploying a new Application, a new Package Type and Package States must be defined in the Custom Types section.

This page includes the following:

Watch the video:

Note: See Working with Packages for more information about Packages and Stateflows.

Package Overview

Graphic depicting Package Stateflow Model

Stateflow Transitions

You can manually transition the Package depending on the approach you want to take:

  • If you want to free up/tear down a set of targets immediately after each successful deployment, you can further move the Package to the "Stable" state right after the Package reaches the "Live" state.
  • If you want to keep the old set of targets, do not transition it to “stable” until the next release is ready.
  • If you do not want to promote the new Package to “live” or if you switched the Package back to a previous state you can transition this Package to the “reject” state to free up targets for the next release.

To Create a New Package Type

  1. Navigate to Settings > Custom Types.
  2. Hover over the Package tab and click the add button displayed. The Create Custom Type dialog is shown.
  3. Select the Create from Existing radio button (the new type will be based on the Deployment Package Type)
  4. Name the new Custom Type Canary.
  5. Enter the version number: 1.0
  6. Select the Package Type.
  7. Select the Deployment Custom Type.
  8. Select the version you want to base the new Custom Type on.

    Image displaying Create Custom Type dialog

  9. Click Create.

To Create the Package States

  1. Open the Canary Package.
  2. Expand the Workflow section.
  3. Right-click the States section and go to Add child > State
  4. Add the following States:

    Image displaying package states

    State description

    • Active: initial Package state upon creation.
    • Deploy: transitional state. Used to trigger the "Trigger_Deployment" & "Deploy" Workflows.
    • Deployed: Package deployed into Target. Traffic has not been routed yet.
    • Switch: transitional state. Used to trigger the "Switch" Workflow.
    • Live_*pc: traffic is being routed to the new Target.
    • Up_Load_*pc: traffic is being routed. We begin to deploy to another subset.
    • Switch_Back: transitional state. Routes the traffic to a previous installation. Used to trigger the "Switch_Back" Workflow.
    • Mark_Stable: transitional state. Used to trigger the "Mark_stable" Workflow.
    • Stable: this is the new stable version of the Application deployed. Traffic is currently being routed to the green Targets. A new version of the Application must be installed on the blue Targets.
    • Retire*: transitional state. Used to retire the current application version and free up the green Targets for a new application version. This state triggers the "Trigger_Undeploy" > "Undeploy_Environment" Workflows.
    • Retired*: Package retired from production. The Target is free for a new installation.
    • Reject*: transitional state. The Package is deemed unfit for production. Used to trigger the "Trigger_Undeploy" > "Undeploy_Environment" Workflows.
    • Rejected*: final state for rejected Package versions. The Target is free for new installations.
  5. Now define the ClosingState condition and transitions for each State:

    State isClosingState Transition Transition name toState
    Active true Deploy Deploy Deploy
    Deploy false Deployed Deployed Deployed
    Deployed false Switch Switch Switch
    Reject Reject Reject
    Switch false Live_25pc Live_25pc Live_25pc
    Live_25pc false Up_Load_50pc Up_Load_50pc Up_Load_50pc
    Switch_Back Switch_Back Switch_Back
    Up_Load_50pc false Live_50pc Live_50pc Live_50pc
    Live_50pc false Up_Load_100pc Up_Load_100pc Up_Load_100pc
    Switch_Back Switch_Back Switch_Back
    Up_Load_100pc false Live_100pc Live_100pc Live_100pc
    Live_100pc false Mark_Stable Mark_Stable Mark_Stable
    Switch_Back Switch_Back Switch_Back
    Switch_Back false Deployed Deployed Deployed
    Mark_Stable false Stable Stable Stable
    Stable false Retire Retire Retire
    Retire false Retired Retired Retired
    Retired true - - -
    Reject false Rejected Rejected Rejected
    Rejected true - - -
  6. Finally, define the following dynamic property:

    1. Right-click the Properties section and select Add after > Dynamic Properties.
    2. Right-click the newly created Dynamic Properties section and select Add child > Property.
    3. Hover over the /NewProperty default value (first value displayed on the right column) and click to edit it. Enter the following values:
      • Name: /general/deployment/Environment
      • Protected: false
      • Highlighted: false
      • Type: SingleLineText
      • allowCustomValues: false

Next steps:

  1. Creating the Application and Related Components
  2. Defining the "Green" Profile
  3. Fine-Tuning the Environment
  4. Fine-Tuning the Components
  5. Creating and Fine-Tuning the Workflows
  6. Assigning Workflows to Package States