Jump to content

QESTNET Internal:Developer QESTNET Creating A New Workflow

From QESTonline
Revision as of 02:06, 21 October 2015 by John.meegan (talk | contribs)

This page outlines the steps required to create a new workflow in QESTNET (QN) and QESTField (QF).

Introduction

Workflows are similar to QESTLab Test Screens, except they can be made up of more than one Document. Workflows encapsulate data entry for a Work Order, an optional Sample, and any number of Documents. A typical Workflow still consists of one parent Sample with one Document on it. When designing a Workflow you must consider how this structure should be set up. A lot of them have the sample details and test details on one big page. Sometimes it makes more sense to break it up into multiple pages. Sometimes these decisions are customer-driven.

Each Workflow is created and edited via buttons in QF. These buttons typically appear on the Work Order Workflow.

[screenshot]

In QN every database table is mapped to an "Entity", which is a Microsoft term used by their Entity Framework technology. As a result; Work Orders, Samples, Documents, etc are really just types of Entities. So Workflows actually just encapsulate data entry for any number of Entities.

If you review the QESTNET Projects Quick Reference Guide you will see there are 2 types of entities, the QESTLab.Data project and the QESTLab.Entities project. When coding Workflows you only concern yourself with the latter type, which is mapped back to the data level automatically.


Work Order Workflows can be created on QF's search screen. After creating a new Work Order or opening an existing instance, other Workflows can be created or edited based on the following criteria:

  • It has been licensed via a script for the customer, at the laboratory for the Work Order you are viewing. (Details on how to set this up will be covered when creating the WorkflowFactory later.)
  • Each Workflow has a loading plan that lists the required Entities for it to be valid. These Entities must be present under the Work Order somewhere.

Note that this last point means creating a new Workflow with a number of Entities may make multiple other Workflows appear for editing, if they use the same Entities. This allows us to provide multiple ways of editing the same set of data, tailored to specific customer workflows.

The remainder of this guide will cover how to create the required functionality for a Workflow at each level of QN/QF.


Initial Configuration

Make the usual QESTLab items:

  • Review the specification or standards to understand what needs implementing
  • Create all required qestlab.qes objects (tests, lists, etc.)
  • Make initial database tables, even if they just have the standard fields

Use the qestnet.upgrade tool:

  • Make sure you have the appropriate qestnet.upgrade branch checked out for making changes on
  • Generate the table and qestObject scripts
  • Selectively commit the lines that are relevant to your changes and no others, for both tables and qestObjects
  • Most tables will be automatically activated for use in QN/QF. Edit the qestnet.upgrade scripts to make any required manual changes either way. Usually there isn't much.
  • Upgrade your development database of choice with these changes

Prepare the QESTNET Schema Generator Tool:

  • This can be found under "QESTNET/QESTNET.Sessions.Lab/QESTLab.SchemaGenerator/QESTLab.SchemaGenerator.sln"
  • Your development database must have some scripts installed for this tool to work, they are found in the "scripts" folder which is next to the solution file above. Run these scripts on your database once, if they haven't already been ran.
  • Add any new test tables to the tool:
    • Open the solution
    • Open the "schema > ConfigHelper.cs" file.
    • Add your test to the GetDocumentNames() function.
    • You only need list tables in here if you intend to use them with Entities, which we do not 99% of the time, so I do not advise adding list tables.
  • Save and compile the Schema Generator Tool.