1"use strict";(globalThis.webpackChunkkanoa_software=globalThis.webpackChunkkanoa_software||[]).push([[12610],{80648(e,r,n){n.r(r),n.d(r,{assets:()=>c,contentTitle:()=>a,default:()=>l,frontMatter:()=>i,metadata:()=>t,toc:()=>d});const t=JSON.parse('{"id":"systemFunctions/cmms/checkWorkOrderConditions","title":"system.kanoa.cmms.checkWorkOrderConditions()","description":"Evaluates all active condition-based work order triggers to determine whether any of them have been satisfied and are ready to generate a new work order event.","source":"@site/docs/systemFunctions/cmms/checkWorkOrderConditions.md","sourceDirName":"systemFunctions/cmms","slug":"/systemFunctions/cmms/checkWorkOrderConditions","permalink":"/systemFunctions/cmms/checkWorkOrderConditions","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"id":"checkWorkOrderConditions","title":"system.kanoa.cmms.checkWorkOrderConditions()","hide_table_of_contents":true},"sidebar":"tutorialSidebar","previous":{"title":"addWorkType","permalink":"/systemFunctions/cmms/addWorkType"},"next":{"title":"checkWorkOrderSchedule","permalink":"/systemFunctions/cmms/checkWorkOrderSchedule"}}');var s=n(74848),o=n(28453);const i={id:"checkWorkOrderConditions",title:"system.kanoa.cmms.checkWorkOrderConditions()",hide_table_of_contents:!0},a=void 0,c={},d=[{value:"Parameters",id:"parameters",level:3},{value:"Returns",id:"returns",level:3},{value:"Example",id:"example",level:3}];function m(e){const r={code:"code",h3:"h3",hr:"hr",p:"p",pre:"pre",strong:"strong",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(r.p,{children:["Evaluates all active condition-based work order triggers to determine whether any of them have been satisfied and are ready to generate a new work order event.\nThis function is designed to be invoked on a recurring schedule (for example from a gateway timer script) rather than called ad hoc from a screen,\nsince it sweeps the full set of configured conditions each time it runs.\nIt takes no arguments \ufffd the conditions it checks are read from the CMMS configuration (see ",(0,s.jsx)(r.code,{children:"getWorkOrderTriggers"}),") rather than being passed in."]}),"\n",(0,s.jsx)(r.hr,{}),"\n",(0,s.jsx)(r.h3,{id:"parameters",children:"Parameters"}),"\n",(0,s.jsx)(r.hr,{}),"\n",(0,s.jsx)(r.h3,{id:"returns",children:"Returns"}),"\n",(0,s.jsxs)(r.p,{children:[(0,s.jsx)(r.strong,{children:"numRecordsCreated"})," ",(0,s.jsx)(r.code,{children:"Integer"})," Number of new work order events created",(0,s.jsx)("br",{})]}),"\n",(0,s.jsx)(r.hr,{}),"\n",(0,s.jsx)(r.h3,{id:"example",children:"Example"}),"\n",(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-python",children:"# Typically wired up to a Gateway Timer Script (e.g. running every 60 seconds)\n# to sweep all condition-based triggers (meter readings, sensor thresholds, etc.)\n# and fire off new work orders whenever a monitored condition is met.\n\nsystem.kanoa.cmms.checkWorkOrderConditions()\n"})})]})}function l(e={}){const{wrapper:r}={...(0,o.R)(),...e.components};return r?(0,s.jsx)(r,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},28453(e,r,n){n.d(r,{R:()=>i,x:()=>a});var t=n(96540);const s={},o=t.createContext(s);function i(e){const r=t.useContext(o);return t.useMemo(function(){return"function"==typeof e?e(r):{...r,...e}},[r,e])}function a(e){let r;return r=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),t.createElement(o.Provider,{value:r},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.