I have a change script that fires when shift change occurs and changes a session property property of "shiftChange" to "true" that looks at if the value goes from 1 to 2, 2 to 3, or 3 to 1. Otherwise we say that shiftChange is false. Shift is determined with a SQL query. My shift value is actively changing to new numbers at shift change like its supposed to but, however, at shift change, 1 to 2, 2 to 3, or 3 to 1, my shiftChange change script doesn't seem to work.
Why?
The idea is at shift change, I want to change the assigned user, assigned model number, assigned line, and repair station ids to empty and fire a pop-up to request the user to assign themselves to the "line". At shift change when my value changes from a number to a number, my changeScript on shiftChange doesn't fire.
Background:
Upon initial loading of the webpage, there's a startup script which checks for assigned values on the session property. If no values are assigned, a pop up window appears that requires the user to assign themselves to the line from a badge scan sql query, line drop down, model drop down, and repair location drop down. When I click save, the script writes to the session properties required (Line, Model, Repair Location, Auditor). The shift value is determined by the line selection value and a named query. At shift change, I want ignition to wipe out the assigned values in the session properties and require the user to reassign themselves to the line. However, something isn't working properly.
Any help would be awesome! I'm still new to this. I got my ignition perspective gold cert last month.
Shift value change script:
if previousValue != 1 and previousValue != 2 and previousValue != 3:
self.custom.shiftChangeScript = False
else:
self.custom.shiftChangeScript = True
shiftChangeScript change script:
if value is True:
self.custom.Auditor = ' '
self.custom.Line = ' '
self.custom.Location = ' '
self.custom.BadgeNumber = ' '
id = "lineconfigpopup"
path = "Page/Quality Defect Entry POC/PopUps/LineAssignment"
system.perspective.openPopup(id,path)