Skip to content

Packaging by use case

Recipe 6.2 showed how a package works. This recipe is about what goes into one. The Coding Design Guide is clear: package by use case, customer.ipam and customer.cmdb, not by delivery, customer.phase1. A phase package mixes things that change for different reasons, so updating one use case means re-importing all of them. A use-case package can be updated, tested and rolled back on its own.

You’ll build three packages for the decommissioning solution, and see what Orchestrator puts into a package without asking.

Getting ready

  • The decommissioning solution from recipes 9.1 and 9.4, and the tests from recipe 9.6 if you’ve written them.
  • Recipe 6.2 (packages: create, export, import).

How to do it

Decide the packages

  1. Split the solution’s content by who needs it and how often it changes:

    Package Holds Why on its own
    com.vcfguide.core com.vcfguide.core.vc/waitForTask and other shared content Any solution may need it; it changes rarely, and must never depend on a use case (recipe 9.3)
    com.vcfguide.vm.decommission the five workflows, the actions in com.vcfguide.vm, the element VCFG_Decommission Everything for one use case, installed and updated together
    com.vcfguide.vm.decommission.test the two [TEST] workflows from recipe 9.6 The guide’s advice: tests in their own package, in source control, never imported into production

Build the shared package first

  1. Under Assets > Packages, create com.vcfguide.core with the description Shared building blocks any VCFG solution may use. Calls nothing outside itself. On the Content tab, add the action waitForTask. Save.

Build the use-case package, then clean it up

  1. Create com.vcfguide.vm.decommission, with a description that tells an installer what to do: VM decommissioning: retire a VM on request, delete it after a grace period. Needs com.vcfguide.core. After import, run VCFG - VM - Configure Decommissioning.
  2. On the Content tab, add the five workflows: VCFG - VM - Decommission VM, VCFG - VM - Delete Retired VMs, VCFG - VM - Configure Decommissioning, VCFG - LIB - Retire VM and VCFG - LIB - Delete VM. Save.
  3. Look at what’s in the package now. Orchestrator added what the workflows use: the actions, the configuration element VCFG_Decommission, and also waitForTask, because the actions call it. That one belongs to com.vcfguide.core. Remove it from this package.
  4. Check that every action is there. Orchestrator finds an action when a workflow calls it as an Action element, or in a script as System.getModule("module").action(…) in one expression. It misses an action called any other way, for example through a variable that holds the module. getRetiredInfo (recipe 9.6) is called as vmModule.getRetiredInfo(…), so add it by hand.
  5. Check that nothing from the built-in library is in it. If one of your workflows calls a library workflow such as Remove all snapshots, the package may pull it in. Remove it: the target Orchestrator has its own, of its own version.

Export

  1. Export com.vcfguide.core and com.vcfguide.vm.decommission with Add configuration attribute values to package cleared. The element goes without values, and the installer sets them with the setup workflow (recipe 9.4). Name the files by the naming standard: com.vcfguide.vm.decommission_v1.0.0_20261201.package.
  2. Create com.vcfguide.vm.decommission.test with the two test workflows. Orchestrator adds VCFG_Decommission to it, because the integration test is bound to it. Remove it: the element belongs to the use-case package, and a test package that carried it would replace the real one’s values on import.
Figure 9.6. A use-case package after clean-up: its own workflows, actions and element, and nothing shared or built in.

Install on another Orchestrator, in order

  1. Import com.vcfguide.core, then com.vcfguide.vm.decommission, then run VCFG - VM - Configure Decommissioning, then the integration test from recipe 9.6 (from the test package, on a test system).
  2. For an update, change the content, raise the version of every workflow and action you changed, and export the use-case package again. On import, Orchestrator selects an element for replacement only when the package’s version is higher than the server’s (recipe 6.2), so a change without a new version is easy to miss on the target.
Checked on an embedded Orchestrator 9.1.1, inside VCF Automation, 1 Dec 2026. Adding the workflows also added waitForTask and VCFG_Decommission; an action called through a variable wasn’t added. An element removed from a package stays out on export.
Needs a lab check. Import the three packages into a second Orchestrator in the order of step 10, and check that Decommission VM still reads VCFG_Decommission there before the setup workflow has run (it should fail in Check inputs of Retire VM, with retireFolder missing).

How it works

Use case, not timeline. Phase 2 of a project rarely changes only phase 2 content. With customer.phase1 and customer.phase2, a fix to one workflow means re-importing a package full of unrelated work, and testing all of it again. With com.vcfguide.vm.decommission, the change, the test and the rollback are all about decommissioning.

Shared content in its own package. When two use-case packages both carry waitForTask, whichever is imported last decides its version on the target. Keep it in com.vcfguide.core, import that first, and use-case packages can’t overwrite it with an older copy.

Orchestrator packs what it can see. Adding a workflow brings what its schema references: actions in Action elements, called workflows, bound configuration elements, and actions called with System.getModule("…").name(…). It can’t see a call it would have to run the script to work out. Check the Content tab after every change, and remove anything that belongs elsewhere: shared content, built-in library content, and elements a test only reads.

Don’t copy the built-in library. The guide’s advice is to call the plug-in’s workflows and actions rather than copy their code, so that you get their fixes when the plug-in is updated, and Broadcom support recognises what you’re running. The same goes for packages: exporting a built-in workflow ships a frozen copy of it.

There's more

Editable and read-only copies. The guide suggests two exports of each package: an editable one for the team, and one for production with Edit contents cleared, so that workflows run there but can’t be changed there (recipe 6.2).

Packages and Git. If you keep content in Git (recipe 6.3), keep one folder per package, so that a pull request touches one use case. Export files themselves are build output; keep them in a release store rather than in the repository.

Back in vRO 5.5–7Packages were built in the Java client by dragging folders in, and older versions sometimes missed actions called from scripts, so the guide told you to add them by hand.
In Orchestrator 9.xThe same rules hold in the 9.x client and the REST API: Orchestrator adds what workflows reference, still misses calls it can't see, and still adds shared and built-in content you should take out.

See also