Parsware
All articles

Start here

Publishers and solutions in Parsware

How Parsware names your work, packages it and moves it between environments. Create a publisher and its prefix, build a solution in development, export it, import it into test as a managed solution, and uninstall it cleanly.

A managed solution called Facilities open in the Test environment, showing its Meeting Room table, next to the title "Publishers and solutions"

Everything you build in Parsware lives in a solution, and every solution belongs to a publisher. Together they answer two questions every team runs into sooner or later: how do we stop our names clashing with someone else's, and how does the work we built in development get to test and production without anyone rebuilding it by hand?

In this walkthrough we create a publisher, build a small solution in the Development environment, move it to Test as a single file, and then remove it again. Every picture below is the real product, captured while the walkthrough was being run.

Publishers and prefixes

A publisher is whoever owns the work: your company, a department, or a vendor who builds solutions for you. Its most important setting is its prefix, a few letters that go in front of the logical name of everything its solutions create.

Under Admin, open Publishers, then choose New.

The New publisher drawer: display name Northwind Traders, prefix nw, option value base 270180000
  • Display name: Northwind Traders.
  • Prefix: nw. Keep it short, because it's in every logical name. It can't sensibly be changed later, for the same reason.
  • Option value base: suggested for you. The values in this publisher's choice lists are numbered from it, so they never collide with another publisher's. Leave it as it is.

Choose Add. The publisher appears in the list with its prefix:

The Publishers list: Contoso con_, Default Publisher new_, Northwind Traders nw_ and Parsware Samples par_

Why prefixes matter. Two teams can each make a table called Room. Without prefixes, the second one to install would find the name already taken, or worse, would change a table it doesn't own. With prefixes they are nw_room and con_room, and both can live in the same environment. Only the platform's own standard tables, like Account and Contact, have no prefix. Anything you add, even a field on a standard table, gets yours.

Create a solution

Open Solutions and choose New. Name it Facilities and choose Northwind Traders as its publisher.

The New solution drawer: display name Facilities, publisher Northwind Traders (nw_)

Choose Save, and the solution opens on its overview:

The Facilities solution overview: Version 1.0.0, Unmanaged, with no components yet

It starts at version 1.0.0 and it is unmanaged. Unmanaged means editable: this is the copy you build in, normally in a development environment.

Build something in it

Anything you create from inside the solution belongs to it. Choose Tables, then New, and type Meeting Room.

The New table drawer: display name Meeting Room, logical name nw_meetingroom with the nw_ prefix shown in front, plural Meeting Rooms

The logical name fills itself in as nw_meetingroom. The prefix comes from the solution's publisher, so you never type it and can't forget it. Save the table, then add a field called Capacity with the data type Integer:

The Meeting Room table's fields: Name as nw_name and Capacity as nw_capacity

Both fields carry the prefix too: nw_name and nw_capacity. For a real solution you would go on to add forms, views, an app and perhaps a process. The walkthrough Build your first table and view covers that part.

Export: the whole solution as one file

Go back to Solutions, select Facilities, and choose Export. The solution downloads as a single file named after it and its version: Facilities-1.0.0.json.

That file holds everything in the solution, with the same names it had in development: the table, its fields, and in a larger solution the forms, views, apps, reports and processes. It's plain JSON, so it can be kept in source control next to the rest of your work.

Export carries only the solution's own components. If something in it depends on a component that isn't in the solution, say a lookup to Contact, the import checks that the target environment already has it, and stops before changing anything if it doesn't.

Import into Test

Switch to the Test environment with the Environment picker at the top of the screen. Each environment has its own database schema, so nothing you built in development is here yet.

Open Solutions, choose Import, and pick the file.

The Solutions list in the Test environment after the import: Facilities from Northwind Traders, version 1.0.0, Managed

Facilities arrives as a managed solution, from Northwind Traders, at version 1.0.0. Open it and the Meeting Room table is there, with the same logical names. Nobody retyped anything.

The managed Facilities solution open in Test: Version 1.0.0 · Managed, the Meeting Room table nw_meetingroom, and Uninstall on the command bar

Managed and unmanaged, side by side:

Unmanaged Managed
Where Where you build it, usually Development Where it's deployed: Test, Production
How it gets there Created with New Imported from an exported file
How it changes You edit its components A new export is imported over it
How it leaves Delete: the solution goes, its components stay in the environment Uninstall: what it brought is removed

Two rules keep this safe. Importing an older version of a solution over a newer one is refused, so a stale file can never drag an environment backwards. And a managed solution can't be deleted: where Delete was on the command bar, there's Uninstall.

Uninstall

Select Facilities in the list and choose Uninstall.

The Uninstall confirmation: this removes the solution's layer from every component it touched; components with an earlier layer revert to it, components left with no layers are removed from the environment

Every component a managed solution touches gets a layer from it. Uninstalling takes that layer away. A component the solution brought with it, like the Meeting Room table, has nothing left underneath and is removed. A component that existed before, like a standard table the solution added a field to, goes back to how it was. Tables you created yourself in the environment are left alone.

After the uninstall, Test is back where it started: only its default solution, Main.

What a solution can hold

Facilities holds one table, but a solution can carry every kind of thing a maker builds. The table below lists the common ones, and where each has its own article.

Component What it is Read more
Tables, fields and relationships The data, and how records link Every field type, Relationships
Option sets Reusable choice lists, numbered from the publisher's base Option sets
Forms and views How one record is edited, and how a list of them is shown Forms that fit the job, Views
Apps The model-driven and Studio apps people open Your first app
Processes Approvals and other work that passes between people A process travels in a solution
Business rules and plugin steps Logic on the form and on the server Which one to use
Saved queries and reports Questions about the data, and pages that print Save a query, A report
Security roles Who may do what in each table Security in Parsware
Rows Reference data the solution needs, or demonstration data below

A component is created in the environment, and the solution is the list of components that belong to it, plus the publisher that names them. That is why you create a table from inside a solution: the solution adds it to its list and gives it the prefix. A component created in the default solution, Main, belongs to no solution you can export.

What the file looks like

The exported file is ordinary JSON. Its first lines say who published it, under which prefix, and at which version. The platform's own sample solutions are written in the same terms; this is the manifest of the Capital planning sample:

{
  "publisherName": "Parsware Samples",
  "publisherPrefix": "par",
  "solutionName": "Capital planning, end to end",
  "version": "2.1.0",
  "description": "One capital programme, the budgets under it, the requests raised against those budgets, ..."
}

After the manifest come the components, each one a document with its own schema. A table is a list of fields with their data types; a form is a list of tabs, sections and fields; a process is its lanes and steps. Because it is text, the file can be compared line by line with the previous version before anyone imports it, and kept in source control beside the rest of your work.

What an import checks before it changes anything

An import is not a copy. It runs a fixed series of steps, and the early ones can stop it before a single table is touched.

  1. Every document is validated against its schema. A file edited by hand with a typo in a data type is refused, with the component and the field named.
  2. Every dependency is resolved. Each component the package refers to must be in the package or already in the environment. A lookup to Contact is fine in an environment that has Contact; a lookup to a table that is in neither stops the import.
  3. Solutions it is built on are checked. A package can say it requires another solution, at a lowest version. Imported in the wrong order, it is refused with a message telling you which to import first.
  4. An approval, where the environment asks for one. An environment can require that somebody approves an import before it runs, which is how Production is usually set up.
  5. The tables are changed, in that environment's schema only, and the forms, views, apps, rules and processes are registered.
  6. Rows are written last, through the same path as a record saved on a form, so validation and server rules run on them too.

The import runs in the background, and the solution's row in the list shows how it is going. Only one import runs in an environment at a time, so two people can't import over each other.

If a first install fails part-way, the platform takes it back by uninstalling what it had written, and the import says nothing was kept. If an upgrade fails, the version it was upgrading is still there and still working.

Versions and upgrades

A solution's version has three numbers, such as 1.0.0. Before exporting a change for Test and Production, raise it with Set version on the unmanaged solution's overview, for example to 1.1.0. The new file is named after the new version, so Facilities-1.0.0.json and Facilities-1.1.0.json sit side by side and nobody has to guess which is newer.

Importing 1.1.0 into Test, where 1.0.0 is installed, is an upgrade:

  • Everything 1.1.0 still carries is updated in place. Records in its tables stay where they are.
  • When the upgrade has finished, 1.0.0 is retired. Anything 1.0.0 had that 1.1.0 dropped is removed, so Test ends up exactly as a fresh install of 1.1.0 would leave it.
  • Importing 1.0.0 again afterwards is refused, because it is older than what is installed.

Every component also keeps its own version, raised by the platform each time it changes. You never type it. It is there so that the platform, and you when you are looking into something, can tell which definition of a form or a table is which.

Layers: two solutions, one table

Sometimes two solutions touch the same component. A vendor's solution adds a table, and your own solution adds a field to it. Parsware keeps each solution's contribution as a separate layer on the component and combines them when the component is read. Edits made directly in the environment sit on top of every layer.

That is what makes an uninstall clean, as the last step showed. Remove your solution, and its layer comes off: the field you added goes, and the vendor's table is exactly as the vendor shipped it. Remove the vendor's solution while yours still uses its table, and the uninstall is refused, because something still depends on what it would remove.

One more case matters for the standard tables. When a solution first adds a field to Account, the platform keeps a snapshot of Account as it was, as a base layer underneath. Uninstalling the solution brings Account back to that snapshot. It never drops a table the environment had before.

Rows that travel with the solution

A solution is mostly design, but some applications don't work without a few rows of data: the approval bands of an expense policy, the list of sites, the tax rates. A table can carry rows in its solution, and each table says which kind they are.

  • Configuration rows are what the solution needs to work. They are always imported, into Production too.
  • Demonstration rows show the solution off. The import asks whether to include them, and never imports them into a Production environment.

Each row keeps its id across environments, so importing a newer version updates the same rows rather than adding copies. An import never deletes a row. The overview of the platform shows Capital planning arriving with three configuration rows and 198 demonstration rows.

A few habits worth starting with

  • One publisher per organisation, or per vendor. Departments don't usually need their own; a separate solution per application does the job.
  • One solution per application, so each can be upgraded and removed on its own. If one needs another, say so with a requirement rather than copying components between them.
  • Build only in Development. An unmanaged edit in Test is the one change that can't be exported from anywhere, and the next import won't know about it.
  • Raise the version for every export that leaves Development, and keep the files.

What we did

  • Created a publisher with a prefix, which names everything its solutions create.
  • Built an unmanaged solution in development, with a table and a field that took the prefix by themselves.
  • Exported it as one versioned file.
  • Imported it into Test, where it arrived managed, with the same names.
  • Uninstalled it, and the environment went back to how it was before.

Going to production is the same import again, into the Production environment. To ship a change, make it in development, export again, and import the new file over the old one.

Next: Build your first table and view, inside a solution of your own. When you are ready to ship a real change, Moving work from Dev to Test to Prod goes through an upgrade step by step.