MicroView FM Automated Work Processor
Version 3.5 build 182
Copyright 2009 – 2023 Robert Stephen Consulting LLC.
www.RSC2LC.com
Overview
The MicroView FM Automated Work Processor (AWP) is data processing engine that works in conjunction with the MicroView FM software. It imports and exports data for MicroView Tablet and MicroView Classic users and performs tasks within the MicroView interface in Web Central.
Some of the processing task types include:
– Automated import and export of work requests to and from MicroView Tablet or Classic.
– Automated import and processing of Inspection and Survey data
– On demand data import and export tasks in Web Central
– Lookup list generation via a scheduler.
– Automated PDA tasks via a scheduler.
The reasoning behind AWP is to permit ultimate flexibility in data processing. Essentially all tasks are data driven and defined in user modifiable functions within the MicroView interface in Web Central. The MicroView data collection forms can be customized including adding new fields or modifying rules for data processing. A data processing function can then be triggered manually or added to an automated task.
All functions called wither manually or by an automated process are logged to the Request Queue table. This can be reviewed within Web Central. The number of records processed the MicroView user making the request are also referenced.
The AWP Engine is two Windows based services that talk to the Archibus database via an ODBC connection.
MV_AWP.exe – Automated Work Processor executable
MV_AWP_WATCH.exe – Watch Engine that monitors the AWP engine and allows debug of processing issues with Web Central.
Multiple AWP and Watch Engines can be run on the same server (one per Archibus project). This supports having a production and development MicroView FM environment.
The AWP engine writes all errors to a log file (MV_AWP_LOG.TXT) and a log table RSC_SQL_ERROR AWP also supports automatic email of errors to a support person.
The basic engine functions are configured in the MVFM.INI file. This file resides in the same folder as the AWP engine executable files. The configurable parameters are documented later in this document
AWP Engine Installation
The AWP Installation must be performed after the Archibus database update to Add the MicroView Tables and Data. See \AddMView\Add_MView_Read_Me.txt.
1) Create a 32 bit System ODBC entry named MicroView FM. The ODBC name can be different but it must match the “DSN=” value in the MVFM.INI file.
2) Using Notepad edit the MVFM.INI file. Update the “ODBC=”, “UID=” and “PWD=” values if different than default.
3) Copy \AWP\system32\*.ocx and AWP\system32\*.dll to the c:\windows\syswow64 folder.
4) Open a command prompt as Administrator and run Register_Dlls.bat.
5) Right mouse click on the mv_awp.exe file and choose “Run As Administrator” The Engine should create the services and then terminate.
6) Open Windows Services and start the services named “MicroView_AWP_Service_Manager [MV_AWP]” then “MicroView_AWP_Service_Manager_Watch [MV_AWP]”
7) Check the \AWP\MV_AWP_LOG.txt file for any errors.
AWP Configuration File (MVFM.INI)
The Automated Work Processor uses an INI file to set default parameters. This includes setting the name of the ODBC connection to the database with credentials, email configuration and enabling features. Below is a a list of the parameters and their function. Parameters not documented should NOT be altered.
[AWP]
Name of the AWP executable files. Default is MV_AWP.exe and MV_AWP_WATCH.exe.
If the executable is renamed then the executable names should be like MV_AWP_Prod.exe and MV_AWP_WATCH_Prod.exe and the [AWP] section should be named [MV_AWP_PROD]
DEBUG=0
If set to 1 then it writes all SQL statements and other debug to the MicroView AWP log file (MV_AWP_LOG.txt)
Enabling Debug or can also be enabled from Web Central using the AWP Engine Status view.
DSN=MicroView FM
The name of the 32 bit ODBC datasource name pointing the the Archibus database
UID=afm
Username to connect to the database with
PWD=afm
Password to connect to the database with
PWD_ENCRYPT=afm
If PWD has a value and PWD_ENCRYPT has a value then on service restart the password is encrypted in the MV_INI file. From that point the PWD value will be blank.
SMTP_HOST=hostname.client,com
Pointer to the SMTP email server. This is used for outgoing status emails. Remove the semi colon if you want to enable emails
SMTP_PORT=25
SMTP Server communications port.
AUTHENTICATION=1
Set to 0 if not SMTP server authentication (login) required.
POP_USERNAME=notices@client.com
Username to authenticate to the SMTP server
POP_PASSWORD=smtp_password
Password for authentication account
SENDER_EMAIL=notices@client.com
Name used for email sender
ERROR_EMAIL=gatekeeper@client.com
ERROR_EMAIL2=
ERROR_EMAIL3=
Up to 3 different email addresses to send error messages and other notification
ERROR_EMAIL_SUBJECT=MicroView FM Automated Work Processor Error on ServerName:
Subject text for the email.
INSTALL_SERVICE=1
Set to 0 if you do not want the AWP Engine to automatically create Windows Service on first start of the executable.
SERVICE_NAME=
Name of the Windows Service for the AWP Processing Engine. This is automatically set of first start of the executable.
TIMERINTERVAL=1
Number of minutes between running automated import and export processes.
CYCLE_CHECK=30
Number of minutes between Heartbeat checks for the Watch Engine.
WEBCENTRAL_ENABLE=1
Enables processing of Web Central (queued) function. This is required for the MicroView FM Web Central module. It check the queue every few seconds for tasks to perform. It returns results to the user in Web Central when complete.
SCHEDULER_ENABLE=1
Enables the scheduling function for PDA tasks, and lookup lists. These scheduled tasks can be reviewed or modified in Web Central in the Schedule PDA Tasks and Schedule Lookup Tasks view.
SURVEYS_ENABLE=1
Enables automated processing of Inspection and Survey records generated within MicroView Tablet or MicroVIew Classic. The survey definition must have Auto-Import Records set to Yes to be processed
SLA_ENABLE=1
Enables Integration with the Archibus SLA Engine for Work Requests generated by surveys. If the survey question generates a Service Request then it is submitted to the Web Central SLA Engine This requires the the submitRequestCustomClient Workflow in Web Central. The survey question must include a value for the Problem Type.
WORKORDER_ENABLE=1
Automated processing of work requests / work orders to and from MicroView Table or Classic. TIMERINTERVAL sets the frequency for checking for work to process. MicroView Users must also be assigned to a Trade or Craftsperson from the MicroView FM Users view in Web Central.
Business Rules Governing Exporting Work Orders to PDA(s) (WORKORDER_ENABLE=1)
Trades and/or craftspersons are attached to PDAs via the “MicroView FM Users” view in the MicroView FM module. Multiple Trades and Craftspersons can be assigned to a Single PDA. Craftspersons are processed before trades.
A work request / work order is sent to a PDA if the following conditions are met:
– The work request must be attached to a work order.
– The status of the work request must be in the list as described by the variable WR_STATUS_INVALID in the MV_INI table.
– The work request must have an attached trades or craftsperson record where the trades or craftsperson belongs to a PDA.
– The value of the field On PDA for the work request must be No.
– The trades or craftsperson record must have a blank value (NULL) for the field Date Finished.
– Additional WR table restrictions will be applied if defined by the variable WR_EXPORT_REST in the MV_INI table.
– Additional WRCF table restrictions will be applied if defined by the variable WRCF_EXPORT_REST in the MV_INI table.
– Additional WRTR table restrictions will be applied if defined by the variable WRTR_EXPORT_REST in the MV_INI table.
The work request / work order remains on the PDA until the user checks the Upload field then Syncs the PDA. On returning from The PDA the Date Completed and Time Completed fields for the work request will be set if the status of the work request is set to Complete. If all the work requests are complete then the Date Completed and Time Completed fields for the work order will be set.
NOTE: AWP does not close (archive) work orders when they are complete. You must use standard ARCHIBUS functions to calculate the final costs and close the work orders.
Log Files
A log file (MV_AWP_LOG.TXT) is automatically created in the same folder that the MV_AWP.EXE resides. This file logs the start and stop events and any errors. If the ERROR_EMAIL parameter is configured in the MVFM00.INI (along with other required email settings) then errors will also be emailed. If the DEBUG=1 parameter is configured in the MVFM00.INI then all SQL statements will be echoed. Please use the verbose debug only when required to ascertain the cause of processing errors.
NOTE: IN may be necessary to remove or archive the MV_AWP_LOG.TXT file when it becomes too large.
Outgoing emails are logged to the SENDMAIL.LOG file in the \Program Files\MViewFM_3\SENDMAIL folder.
Other General Setup Parameters (MV_INI table) Utilized by AWP
There are many configuration options and language strings that can be accessed from the General Setup Parameters (MV_INI table) Please do not alter these parameters unless directed to by your MicroView dealer.
PDA Functions and Fields
All of the MicroView data collection forms are data driven and can be modified by altering the form structure and the data function definition. The FORM, QUESTION, and QUESTIONFORMAT tables hold the structure of the data collection form as it appears in MicroView Tablet and MicroView Classic. Modifications to these forms are beyond the scope of this document but can be reviewed using a supplied Archibus Client Server view called Modify_Fields.avw.
MicroView Surveys and Inspections generate form records with a Form ID starting with 400,000. The template for surveys is a form with the Form ID of 400,000,000.
The form structure and the fields within are linked to the PDA Functions. The fields being processed within the form must exist in the form definition. Processing form data between the data collection device (FORMx) table, transfer (PEN_x) and the asset table are defined by four separate functions. There is also a separate function for finding duplicate records.
The function type ‘Execute_SQL’ can be used to create custom data updates. These can then be called from the scheduler in the Schedule PDA Tasks view.
Scheduled Lookup Tasks
Reference data used in data collection forms such a buildings, employees and equipment standards are calculated and stored in a lookup table on the server. These are called Lookup Lists. Lookup lists are also user definable by modifying parameters in the Lookup definition tables. Lookup lists are then added to a schedule to keep them up to date.
Lookup Lists are defined and scheduled to update in the Schedule Lookup Tasks view. By default PICKLISTS_ALL (all standard lookups) are scheduled to update each day at 01:00. Below is a list of the Lookup List function types and their parameters:
Parameter |
ENUM_LOOKUP |
CUSTOM_LIST_INI |
WRITE_LIST |
WRITE_CASCADE |
WRITE_3CASCADE |
WRITE_CASCADEEM |
UPDATE_LOOKUPFORMS |
1 |
lookup_name |
lookup_name |
lookup_name |
lookup_name |
lookup_name2 |
lookup_name |
form_restrict |
2 |
table_name |
export |
field_name1 |
parent_lookup_name |
parent_lookup_name |
field_name1 |
|
3 |
field_name |
use_value |
field_name2 |
table_name |
lookup_name3 |
field_name2 |
|
4 |
Add_None |
sorted |
Desc_Name |
field_name1 |
Table_Name1 |
field_name3 |
|
5 |
ini_fields |
table_name |
field_name2 |
Table_Name2 |
table_name |
||
6 |
Check_Divider |
field_name3 |
Table_Name3 |
lookup_do_var |
|||
7 |
Add_None |
descrip_name |
field_name1 |
max_lookup_char |
|||
8 |
lookup_do_var_ |
lookup_do_var |
field_name2 |
look_restrict |
|||
9 |
max_lookup_char |
max_lookup_char |
field_name3 |
||||
10 |
look_restrict |
look_restrict |
descrip_name2 |
||||
11 |
descrip_name3 |
||||||
12 |
lookup_do_var |
||||||
13 |
max_lookup_char |
ENUM_LOOKUP
Lookup pulled from the Archibus defined enumeration list for that field.
CUST_LIST_INI
Custom lookup with values pulled from the MV_INI table. Parameter 5 holds the list of record values.
WRITE_LIST
Single table lookup but supports 2 fields with a divider e.g. LOCATION is bl_id | fl_id
WRITE_CASCADE
Mutli-level lookup lists. These are displayed in multiple fields in the data collection form for drilling down to particular values e.g. Equipment Standard by Equipment Category
WRITE_3CASCADE
Similar to WRITE_CASCADE but the data is pulled from three hierarchical tables.
WRITECASCADEEM
Multi-level lookups specifcally tailored for employee list.
UPDATE_LOOKUPFORMS
Assigns lookups to specific data collection forms.
Lookup_Name
Name of the lookup as referenced in the data collection form definition
Table_Name
Table that the lookup pulls values from
Field_Namex
Field(s) name that the lookup pulls values from
Add_None
Add item in the lookup to set the value to null (blank)
Desc_Name
Field to pull the description from. This is when you want to display the description but save the code value. Set to ‘None’ if not required.
Check_Divider
If set to ‘Y’ then use divider character for multi-field lookup.
Lookup_Do_Var
Variable to check in the MV_INI table that indicates if the lookup should be created.
Max_Lookup_Char
Maximum number of lookups in a list. MicroView Classic is limited to 999 records per lookup. MicroView Table has no limitation, Set to a higher value if you get an error in the Lookup List Generation. For WRITECASCADEEM (employee Lookup) the default value is 100. This means that each list is limited to 100 but the number of lists for each employee prefix is automatically calculated. E.g. AA, AB.
Look_Restrict
A restriction applied to a lookup when collected to source records. For example in the employee lookup (WRITECASCADEEM) the employee list can be limited to a single building by adding a restriction bl_id=’HQ’.
Scheduled PDA Tasks
Scheduled PDA tasks are timed events that insert record(s) into the Request Queue for processing.
These tasks can automate the processing of data collected in any form type, call built in (special) function within AWP or run a custom SQL statement. Scheduled Tasks can be reviewed or modified from the Schedule PDA Tasks view.
Tasks can be scheduled to run in an interval as short as every two minutes.
NOTE: Inspections and Survey record processing (automated) is a separate process and is not part of the Schedule PDA Tasks.
Scheduled PDA Tasks can be used to call PDA functions to automate processing of data collected. FLOOR_WALK_DIRECT is an example of this kind of automation.
Parameter1 in the Scheduled Tasks must point to one of the described tasks below:
IMPORT_ALL_PDAS
Pulls data from the data collection table(s) (FORMX) to the transfer or asset tables.
Parameter 2 must point to a PDA Function of Function Type ‘PDA_To_Transfer’ or ‘Transfer To Asset’
UPDATE_ASSET_TABLE
Updates or adds records to asset tables from the data collection table(s) (FORMX) or the transfer tables.
Parameter 2 must point to a PDA Function of Function Type ‘Transfer_To_Asset’
Parameter 3 requires a SELECT statement that requests the primary key field from the source table. values
e.q. SELECT auto_id FROM pen_eq WHERE time_stamp IS NOT NULL and valid_error IS NULL
Parameter 4 = append to Function Name (in queue_function eg “_N”
REQUEST QUEUE
Process a built in (Special) function within AWP or run a custom SQL statement
Parameter 2 must point to a PDA Function of Function Type ‘Special_Function’ or ‘Execute_SQL’
The default MicroView installation comes with some sample scheduled functions and two are enabled by default.
DAILY_FUNCTIONS
These functions are scheduled to run every day in the early morning.
CALC_NEXT_EQ_SURVEY_DATES must be enable if you are using scheduled MicroView Room Surveys. This functions calculates the next survey date based on the scheduled interval
UPDATE_PARTS_LOCATIONS must be enabled if you are using the MicroView Parts Inventory form. This syncs the MicroView parts locations to the Archibus warehouse locations.
FLOOR_WALK_DIRECT
This function automatically processes data collected using MicroView FloorWalk. It updates the asset tables directly without user intervention.
FLOOR_WALK_TRANSFER
This function automatically processes data collected using MicroView FloorWalk. It updates the transfer table. A user must then review and process records from the Transfer table to the asset table. If this function is enabled then FLOOR_WALK_DIRECT should be disabled.
IMPORT_FROM_PDAS
If enabled, this function automatically imports equipment and furniture records to the Transfer table. A user must then review and process records from the Transfer table to the asset table.
UPDATE_ASSETS
If enabled, this function automatically processes equipment and furniture records from the Transfer table to the asset table. If IMPORT_FROM_PDAS is also enabled then no user intervention is required to process newly updated equipment and furniture assets. Records than fail validation remain in the Transfer table.
MicroView Survey Questions – Custom SQL Statements
MicroView Surveys support custom SQL statement that allow the collected data to update asset records (e.g. equipment or rooms or any table)
or to automatically create service requests based on the answer for any kind of question.
Each survey question can have up to 3 custom SQL statements.
The SQL statements have a special syntax to return data from the survey:
<ANSWER> is the value of the answer field from the mv_survey_questions table
<NOTES> is the value of notes field from the mv_survey_questions table
<name> is the name of the field to be retrieved from the mv_survey table record
{} indicates that a string variable should be quoted eg. WHERE eq_id = {<eq_id>}
e.g. UPDATE eq SET date_last_surveyed = {<survey_date>} WHERE eq_id = {<eq_id>}
Use the following syntax to represent operators
> – <.GT.>
< – <.LT.>
>= – <.GE.>
<= – <.LE.>
<> – <.NE.>
The First custom SQL statement field supports a restriction definition the is encased in square backets [ ]
This restriction allows Answer Types other than Yes/No to created Service Requests.
The Problem Type Code must also be defined for the question.
e.g. A Numeric Question – Pressure Reading
Custom SQL Statement 1 = [<ANSWER> <.GT.> 200 OR <ANSWER> <.LT.> 100]
– This will create a service request is the pressure is outside of the range of 100 to 200.
The second SQL Statement could then update the equipment record:
IF <ANSWER> <.GT.> 200 OR <ANSWER> <.LT.> 100
BEGIN
UPDATE EQ SET status = ‘Out of Service’
WHERE eq_id = {<eq_id>}
END
Was this helpful?
0 / 0