The management of the inspection related objects during an inspection are all prefixed with inspectionAction_
in the occInspectionCoordinator:
Step 1: Pull out the OccSpaceTypeChecklistified which has in it a List<OccSpaceElement> and send these to the method
public OccInspectedSpace inspectionAction_commenceInspectionOfSpaceTypeChecklistified (OccInspection inspection,
User user,
OccSpaceTypeChecklistified tpe,
OccInspectionStatusEnum initialStatus,
OccLocationDescriptor locDesc)
throws IntegrationException {
which takes these in and will return OccInspectedSpace object which has inside of it now a List<OccInspectedSpaceElement> which are ready to be marked with one of these these combinations of timestamps
Step 2: Now are are ready to record inspection of one or more of the OccSpaceElements in the OccSpaceTypeChecklistified by calling
This method expects the code calling it to have set the desired enum value in the OccInspectedSpaceElement which you pass in when you call. The logic in here will use the enum to decide on one of these conditions. You'll need to call this method once for each element that is inspected. This method will write all that's needed to the database.
0) Before any inspecting has happened, there are nulls in complianceGrantedTS and lastInspectedTS (and their User ID fields)
1)If the element passed, then timestamp both lastInspectedTS and complianceGrantedTS (and the user IDS)
2) If the element failed then only write a timestamp to lastInspectedTS
UI Notes
The JSF version of this process manages the UI by looking at the inspection status enum on each element to figure out what to show the user:
public enum OccInspectionStatusEnum {
NOTINSPECTED("Not inspected", 0, "inspectionStatusIcon_notinspected"),
PASS("Passed", 1, "inspectionStatusIcon_pass"),
VIOLATION("Violated", 2, "inspectionStatusIcon_fail");
private final String label;
private final int phaseOrder;
private final String iconPropertyLookup;
And by setting this enum correctly based on the user actions, then you just have to pass the InspectedSpaceElement to the Coordinator methods and the Database will be written to reflect that status.
The management of the inspection related objects during an inspection are all prefixed with inspectionAction_ in the occInspectionCoordinator:
Step 1: Pull out the
OccSpaceTypeChecklistified
which has in it aList<OccSpaceElement>
and send these to the methodwhich takes these in and will return
OccInspectedSpace
object which has inside of it now aList<OccInspectedSpaceElement>
which are ready to be marked with one of these these combinations of timestampsStep 2: Now are are ready to record inspection of one or more of the
OccSpaceElement
s in theOccSpaceTypeChecklistified
by callingThis method expects the code calling it to have set the desired enum value in the
OccInspectedSpaceElement
which you pass in when you call. The logic in here will use the enum to decide on one of these conditions. You'll need to call this method once for each element that is inspected. This method will write all that's needed to the database. 0) Before any inspecting has happened, there are nulls incomplianceGrantedTS
andlastInspectedTS
(and their User ID fields) 1)If the element passed, then timestamp bothlastInspectedTS
andcomplianceGrantedTS
(and the user IDS) 2) If the element failed then only write a timestamp tolastInspectedTS
UI Notes
The JSF version of this process manages the UI by looking at the inspection status enum on each element to figure out what to show the user:
And by setting this enum correctly based on the user actions, then you just have to pass the InspectedSpaceElement to the Coordinator methods and the Database will be written to reflect that status.