Excel Integration - Requirements and Use Cases
Contents
- Excel Integration - Requirements and Use Cases
- Main Menu
- Use Cases
- Revision Code and Revision Number Handling
- GUI Details
Main Menu
List of menu groups and items:
- Server
- Login
- Logout
- Data
- Search
- Edit
- Get Next Sequence Number for Selected Rows
- Refresh Selected Rows
- Refresh All Rows
- Duplicate Selected Rows
- Check for Duplicates
- Refresh Attribute Lists
- Save
- Save Selected
- Save All
Test (only displayed for development/debug, e.g. when the testMode global variable set)
- Test Cases
- Clone header? (and possible other utilities)
Use Cases
Use Case: Login/Logout
Login - user supplies user ID & password, client sets (or clears on failure) global login flag
Logout - global login flag is cleared
All action routines check the global login flag and display a not logged in message and exit if the flag is not set.
If the login is successful, then the attribute lists are refreshed (see below).
Nice to have: Filter the list of available contracts to those where the user has the drawing update role (roleId=2).
Note that the session may be timed-out by the server and the client must be able to react to not being logged in, even if the global login flag is set.
All server REST transactions return HTTP_RESPONSE_NOT_AUTHORIZED (401) if the user is not (or no longer) logged in. Each action routine on the client must be able to detect and report this.
Use Case: Refresh Attribute List
Refresh Attribute List - The hidden worksheets containing DrawMGT reference data (attributes) are reloaded.
Issue: Will menus for existing data in worksheets need to be re-created? Yes
See: modMain getAllMetadata
Use Case: Search
Search - User enters search criterion.
Two cases are allowed (selected via a radio button in the search form):
- Data is added to an existing list
- Data is added to a new list
When searching into an existing list, the data is added (to the end of the list) depending on whether it already exists in the list.
- Exists in list: A refresh operation is performed (see below)
- Does not exist in list: The data is added to the bottom of the list
The following search criterion are provided:
Title - Soearch form field name: txtTitel (not implemented)
Document code - txtDrawingCode (not implemented)
- Classification fields:
Bereich - cmbBereich
Group - cmbGruppe -- Warning Requires filtering by contractId (not implemented)
Zugriff - cmbZugriff (not implemented)
Fachbereich - cmbFachBereich
Kontakt - cmbKontakt
Object - cmbObjekt
Lage - cmbLage
Dokumenttyp - cmdDokumentTyp
Projektphase - cmdProjektPhase
Archiv - cmbArchiv
Document sequence number from/to - txtDrawingNoMin, txtDrawingNoMax
Extern reference number - txtEtxRef (not implemented)
Revision date from/to - txtRevisionDateMin, txtRevisionDateMax (not implemented)
The following additional fields are in the search form:
Radio buttons for selecting load in new or existing list. Default is new
Menu to select the spreadsheet type, e.g. Bau, Ausrüstung, etc. Only enabled when the radio button is set to new.
Use Case: Highlighting Changes Rows
WAIT This is difficult to do
When the user changes a cell in a row the row is highlighted (suggest highlighting the drawing code cell). When the row is successfully saved the highlighting is removed.
Use Case: Get Next Sequence Number
- For each selected row the drawing code (or partial drawing code, less the sequence number part) is sent to the server , which returns the next available sequence number, which is then placed in the sequence number column (which doe to the drawing code Excel formula, is added to the drawing code).
- Validation errors may occur:
- The user does not have the access rights for the given contract
Use Case: Check for Duplicates
Operates on all rows in the list.
This is also called prior to operations such as save and refresh.
Duplicate rows are detected by scanning all rows in a worksheet, and checking for duplicate values of the following columns:
- Drawing id (a hidden column in the keyset area)
- Drawing code
As soon as any duplicate is found, then a pop-up window appears indicating where the duplicate (the cell coordinates) is, and the operation is stopped. If called by another operation, then that operation is cancelled.
See: modFunctions identifyDuplicateRows
Use Case: Refresh
Refresh Selected - All selected rows in the worksheet are refreshed
Refresh All - All rows in the worksheet are refreshed
The refresh algorithm for a single row:
- Prior to the refresh, a check for duplicate rows will be performed (see above), and the refresh operation is cancelled if duplicate rows are detected
- The record contents (for Doc, RevA, RevB and RevC records) are requested from the server, and the displayed values (in the list worksheet) are checked for differences.
- If a difference is detected then a cell comment is created containing the old value from the row value in the worksheet, and the cell value is replaced with the new value from the server.
- The records' record serial numbers (updateCountDoc for Doc, and updateCountRev for RevA, RevB and RevC) are updated with the values from the server.
- Rows that have never been saved (e.g. for which the keyset is empty) are highlighted. E.g. the drawing code cell is highlighted.
Use Case: Save
Save Selected - All selected rows in the worksheet are saved.
Save All - All rows in the worksheet are saved
The save algorithm:
- Prior to the save, a check for duplicate rows will be performed (see above), and the save operation is cancelled if duplicate rows are detected
If the record ids in the (hidden) keyset area are not set, then the save operation is an insert rather than an update, and the key set columns area are filled with the appropriate values from the server
Update
- The client prepares Doc, RevA (if required), RevB and RevC XML documents and posts them to the server
- Server checks the update count supplied by the client against that in the system database
- If the record update count matches, the server saves the record, and returns the new record count.
- For each posting, a server side validation check is also performed. It it fails, then HTTP_RESPONSE_BAD_REQUEST is returned along with an error message
If the update count doesn't match: The server does not save the record and returns the record contents. The client creates a cell comment on the drawing code, indicating an update conflict occurred, the user must refresh the row.
Insert
- The client prepares a Doc and RevB XML document and posts it to the server, followed by posting RevA (if required) and RevC.
- For each posting, a server side validation check is also performed. It it fails, then HTTP_RESPONSE_BAD_REQUEST is returned along with an error message
TODO Automatically set the revision codes (?)
See: modUpdateServer postUpdate and getDocumentToSave
Error conditions:
- Validation errors:
- Invalid classification id values
- Invalid users (e.g. user's not having the rquired user roles) were selected for workflow steps
- Date sequence violations (complete and plan dates sequences must occur in order)
- Complete dates set/missing vs. selection of users
- Status vs. complete date and user
- When a validation error occurs the validation error message is displayed in a cell comment attached to the drawing code or revision code, or actual cell that caused the error(?).
Use Case: Row Manipulation
Blank rows can be inserted into a spread sheet. Blank rows are ignored by the client software.
If the user manages to copy or fill-down fields in the keyset area then those rows will be marked as duplicates.
The following ways of create new rows is supported:
Using the Duplicate Selected Rows menu item
- Fill-down cells into blank rows (e.g. not copying the hidden keyset area)
- Copy-paste of cells into blank rows (e.g. not copying the hidden keyset area)
Copying and pasting entire rows, including hidden fields, will cause duplicate records to be created.
Duplicate Selected Rows
- User selects rows to duplicate. Any cell or an entire row can be selected
User selects menu item Duplicate Selected Rows
- The selected rows are duplicated at the end of the worksheet, the rows have an empty keyset area and the drawing code cells are highlighted (marking them as unsaved)
Fill Down
- User selects all visible cells and fills down into empty lines
- Newly filled rows have an empty keyset area and will be considered by the client as new records
Copy/Cut and Past Rows
If rows are pasted multiple times, or the duplicate existing rows in a worksheet then the row will be marked as a duplicate the next time a refresh or save operation is preformed.
Deleting Rows
Rows can be deleted from a list worksheet. This has no affect on the data in the server.
Use Case: Exit
When the user attempts to exit Excel, the client catches the event and asks the user to confirm/cancel if there are any unseved rows.
TODO: How to detect unsaved rows?
Revision Code and Revision Number Handling
Revision Handling Use Cases
- New row
- Duplicate row
Documents with a Vorabzug revision
Documents without a Vorabzug revision
- Restart revision sequence
- Reject revision (RevC only?)
- Detecting invalid/incomplete revision sequences (which must be corrected via web GUI)
- Sub-Revision
Events Affecting Revision Codes
Event
Start revisionNo
Vorabzug Flag
RevC Type Menu
Read record
set from server data
set from server data
set from server data
Change Vorabzug flag
n/a
set from menu
n/a
Change RevC type
n/a
n/a
set from menu
Save record
n/a
lock menu (make it ready-only)
n/a
New row
set to nothing
set to default value
set to default value
Duplicate row
set to nothing
set from source row, unlock menu
set from source row
Restart revision sequence
set to Rev revisionNo
set from source row, unlock menu
set from source row
For each of these events the revisionNo and revisionCode fields for each revision must be determined according the the algorithm described in the next sections.
Revision Coding
Ausführungs Documents
Pre-condition: RevC Type = 15 (gut zur Ausführung)
Revision Type
VorabzugFlag = 0
VorabzugFlag = 1
revisionCode
revisionNo
revisionCode
revisionNo
Series 1
VA - Vorabzug
V01
1
n/a
n/a
ZF - zur freigabe
V02
2
V01
1
GA - gut zur Ausführung
V__
100
V__
100
Series 2
VA - Vorabzug
V_A01
101
n/a
n/a
ZF - zur freigabe
V_A02
102
V_A01
101
GA
V_A
103
V_A
103
Series 3
VA - Vorabzug
V_B01
104
n/a
n/a
ZF - zur freigabe
V_B02
105
V_B01
104
GA - gut zur Ausführung
V_B
106
V_B
106
Grundlagen Documents
Pre-condition: RevC Type = 13 (freigegeben)
Revision Type
VorabzugFlag = 0
VorabzugFlag = 1
revisionCode
revisionNo
revisionCode
revisionNo
Series 1
VA - Vorabzug
V01
1
n/a
n/a
ZF - zur freigabe
V02
2
V01
1
GA - freigegeben
V03
3
V02
2
Series 2
VA - Vorabzug
V04
4
n/a
n/a
ZF - zur freigabe
V05
5
V03
3
GA - freigegeben
V06
6
V04
4
Series 3
VA - Vorabzug
V07
7
n/a
n/a
ZF - zur freigabe
V08
8
V05
5
GA - freigegeben
V09
9
V06
6
Migration and New Records for Revision Numbers and Codes
The revision codes table needs to be migrated to make room for additional revisions.
New revision codes affect inly records in revisionNoMapId = 4
New Revision Code Records
Create new revision codes as follows:
revisionCode
revisionNo
v_A01
101
v_A02
102
v_B01
104
v_B02
105
...
...
v_Y01
173
v_Y02
174
v_Z01
176
v_Z02
177
Revision Code Migration
Migrate existing revision numbers as follows:
Existing Values
New Values
revisionNo
revisionCode
revisionNo
revisionCode
1
01
1
01
2
02
2
02
...
...
...
...
99
99
99
99
100
V__
100
v__
101
v_A
103
v_A
102
v_B
106
v_B
103
v_C
109
v_C
...
...
...
...
126
v_Z
178
v_Z
Notes:
- Revision codes are not changed
- The revision numbers less than and equal to 101 are not changed
Revision numbers greater than 101 are set to ( revisionNo - 'A' ) * 3 + 100
GUI Details
Menus
- User menus (for design, check approve menus)
Display lastName firstName - company in menus
GA/Fregegeben Menu
The GA/Fregegeben menu controls the revisionTypeId associated with the Ausführung (RevC) revision.
- Requirements
The menu is located in the 5. Ausfuehrung Typ (CA) column
- The menu should contain two entries
gut zur Aurführung - corresponding to revisionTypeId = 15
Freigegeben - corresponding to revisionTypeId = 13
- Behavior
The menu only controls the setting of the RevC revisionTypeId field, and causes no changes to the behavior of any other spreadsheet columns or internal fields
The menu value can be changed at any time. E.g. saved records can have their revisionTypeId changed at a later date
- Notes
The implementation might make use of a hidden column containing the revisionTypeId value corresponding to the menu setting
Vorabzug Flag
The Vorabzug flag controls whether a Vorabzug revision is created:
- Requirements
Control of the flag is implemented as a menu in the Vorabzug ja/nein column (col AN) with two choices: Ja and Nein
The choices indicate whether a Vorabzug (RevA) revision can be edited/saved
The flag value is stored as a user defined field named revBVorabzugFlag attached to RevB
The user defined field revBVorabzugFlag has a value of one or zero when read from or written to the server
One a record is saved, the Vorabzug ja/nein menu is frozen and cannot be changed by the user. E.g. the cell with the menu must be set to read-only
- When the flag is read from the database the one/zero value is used to set the menu value, and the cell with the menu must be set
- Behavior
When the flag is set to one then, a Vorabzug (RevA) revision is created and saved, and all the columns associated with the 3. Version Vorabzug should be activited (as currently occurs).
When the flag is set to zero then, a Vorabzug (RevA) revision is not created and saved, and all the columns associated with the 3. Version Vorabzug should all be cleared, assigned a light gray background and set to read-only, including the Vorabzug ja/nein menu column
- Notes
The implementation might make use of a hidden column containing the one/zero value corresponding to the ja/nein menu setting
Client Side Validation
All dates columns should be in DD.MM.YY format
Ist-dates: Ist date for workflow step must be >= previous Ist-date
Soll-dates: automatically calculated, validation required (Soll date columns should be read-only)
No checking between Ist and Soll dates is required
Wer vs. status:
Offen status: Wer can be empty
non-Offen status: Wer must be set
Workflow status vs. Ist-date:
Offen status: Ist-date must be empty
non-Offen status: Ist-date must be set to a date <= today
- Workflow steps must be completed in order
If a reject occurs in a workflow step, then no further steps can be completed. E.g. the Ist-dates for subsequent workflow steps cannot be set, nor can their status be set to a non-offen value.
Note that all the status menus default to the appropriate offen status value.
Data types: t0 and t0wv must be dates
- Data types: Resource fields:
Resourcenplannung Planer & PL - can be integers or floating point values. The values represent the number of hours/days of effort planned
von/bis - must be dates
Verteiler - must be integers. The values represent the number of copies to send
- Date format enforcement via data formats in layout sheet?
- Read-only fields:
Doku.-Nr - drawing code
Soll dates
Ver. - revision code (Design needed)
Nice to Have
Nice to have, but not essential for the first release.
- Change cursor to an hourglass during long operations (e.g. attribute refresh, refresh, search, save)
- Catch cell change events and mark rows as changed
- Catch the Excel exit event and warn the user if there are unsaved rows
Questions and Issues:
- There is no columns for a serial number in the layout, and this is not in the specification