Skip to main content

system.kanoa.quality.event.getChkShtEvents(paramsDict)

Returns scheduled check sheet events, newest scheduled first. Every paramsDict key is optional, and a key passed as None is ignored.

When a date range (startDate and endDate), states (chkShtStateIds or chkShtStateNames) and activeState are all given, it returns the events in the range and states, plus every event in that activeState.


Parameters​

paramsDict Dictionary

- activeStateBooleanTrue for the checks in an active state (Coming Due, Due, In Progress, Overdue), False for the others: the finished ones, and those In Delay.
- assetGroupNameStringThe asset's group.
- assetIdInteger
- assetPathStringThe asset path, matched with LIKE (add % yourself).
- autoBooleanTrue for Auto check sheets only, False for the others.
- chkItemIdIntegerWith chkItemValue: the events whose value for this check item contains chkItemValue.
- chkItemValueStringSee chkItemId.
- chkShtEventIdInteger
- chkShtIdInteger
- chkShtStateIdsList of Integers
- chkShtStateNamesList of StringsUsed when chkShtStateIds isn't given.
- chkShtTypeIdInteger
- endDateDateTimeThe end of the date range; see searchDate.
- includeManualAutoBooleanWith auto False, also returns the Auto check sheets' events someone added by hand (with a Manual trigger, as Add Check does). Ignored otherwise.
- itemClassPathStringMatched with LIKE.
- itemIdInteger
- pathStringThe check sheet's path, matched with LIKE.
- searchDateStringThe date column startDate and endDate apply to: takenDate, scheduledDate (the default), submittedDate or approvedDate.
- shiftNameIdInteger
- startDateDateTimeThe start of the date range; see searchDate.
- toolingAssetIdIntegerThe events taken with this tool.

Returns​

chkShtEventData pyDataset
One row per check event, with its check sheet (chkShtId, chkShtName, path, auto, ...), asset (assetId, assetPath, assetGroupName), shift, item, trigger (chkShtTriggerId, triggerTypeName, delayMins, comingDueMins, overDueMins, graceMins, ...) and state (chkShtStateId, chkShtStateName, chkShtStateColor, activeState). It also has:

  • minutesRemaining: how long until the check should be taken. Until its scheduledDate while it's In Delay or Coming Due, then until the end of its overDueMins (negative once it's Overdue). None for a finished check.
  • failedChecks: how many of its checks failed, once it's submitted.
  • takenDate, scheduledDate, submittedDate, approvedDate, and the users who scheduled, submitted and approved it.
  • toolingAssetId, toolingName: the tool it was taken with.

Example​

# The checks scheduled in the last 5 days for check sheet 18
paramsDict = {
'startDate': system.date.addDays(system.date.now(), -5),
'endDate': system.date.now(),
'chkShtId': 18
}
chkShtEventData = system.kanoa.quality.event.getChkShtEvents(paramsDict)

# The manual checks still to be done, plus the Auto checks someone added by hand
paramsDict = {'activeState': True, 'auto': False, 'includeManualAuto': True}
chkShtEventData = system.kanoa.quality.event.getChkShtEvents(paramsDict)