You are on page 1of 362

Factelligence

Middleware User Manual V2.1

Last updated on December 6, 2004

2004 CIMNET Inc

www.CimnetInc.com

Last updated on December 6, 2004......................................................................................................1 Introduction ..........................................................................................................................................12 Pre-requisites for Access to the Middleware..............................................................................13 Session and Login Handling ..........................................................................................................13 Standard Data Access Methods..........................................................................................................15 Add Method....................................................................................................................................15 Update Method...............................................................................................................................16 UpdateSpecific Method.................................................................................................................17 Delete Method................................................................................................................................18 DeleteAll Method..........................................................................................................................18 GetAll Method...............................................................................................................................19 GetByKey Method.........................................................................................................................20 GetAllbyXML Method..................................................................................................................21 GetSpecificRS Method..................................................................................................................22 ExecuteXMLCmd Method............................................................................................................23 IsValid Method..............................................................................................................................25 Core DLL Enhanced Methods............................................................................................................27 Session Class .....................................................................................................................................27 StartSession Method......................................................................................................................28 StartBGSession Method................................................................................................................30 EndSession Method.......................................................................................................................32 LogIn Method................................................................................................................................33 RefreshHeartbeat Method.............................................................................................................34 SwitchUser Method.......................................................................................................................35 LogOnEnt Method.........................................................................................................................37 LogOnEntList Method...................................................................................................................39 SaveEntList Method......................................................................................................................41 LogOff Method..............................................................................................................................42 KillStaleSessions Method.............................................................................................................43 GetSpecificRS Method..................................................................................................................44 GetModulesLicensed Method.......................................................................................................46 SwitchSession Method..................................................................................................................47 DoMinutelyTasks Method.............................................................................................................48 DoAutoShiftChanges Method.......................................................................................................49 DoHourlyTasks Method................................................................................................................50 DoDailyTasks Method...................................................................................................................51 GetServerTime Method.................................................................................................................51 SetMwDbUser Method..................................................................................................................52 GetVerInfo Method.......................................................................................................................53 ValidPw Method............................................................................................................................54 Ent Class...........................................................................................................................................54
2004 CIMNET Inc

www.CimnetInc.com

GetAll_TopLevel Method.............................................................................................................56 Add Method....................................................................................................................................56 Delete Method................................................................................................................................58 StartShift Method..........................................................................................................................59 GetStatusInfo Method...................................................................................................................60 GetStatusInfoByUser Method.......................................................................................................61 Clone Method................................................................................................................................62 RefreshShiftSched Method............................................................................................................65 DoAutoShiftChanges Method.......................................................................................................66 GetShiftSched Method..................................................................................................................67 GetAvailShiftTime Method..........................................................................................................68 GetAvailEndTime Method............................................................................................................69 GetRefreshedShiftSched Method..................................................................................................70 Ent_Link Class ................................................................................................................................71 Attr Class ..........................................................................................................................................71 Attr_Set Class..................................................................................................................................72 Ent_Attr Class .................................................................................................................................72 System_Attr Class...........................................................................................................................73 System_Attr_Grp Class ..................................................................................................................73 Language_Grp Class ......................................................................................................................74 Language Class ................................................................................................................................74 NextFreeLangID Method..............................................................................................................74 Clone Method.................................................................................................................................75 DeleteByLang Method...................................................................................................................75 Error_Log Class ..............................................................................................................................76 Audit_Trail Class ............................................................................................................................76 Grp_Name Class..............................................................................................................................77 User_Name Class.............................................................................................................................77 AddOrUpdate Method...................................................................................................................78 ChangePassword Method .............................................................................................................79 User_Grp_Link Class.....................................................................................................................80 Priv Class..........................................................................................................................................81 Grp_Priv_Link Class ......................................................................................................................81 GetPrivilegesByUser Method........................................................................................................82 GetUsersByPrivilege Method........................................................................................................82 GetPriv Method.............................................................................................................................83 Grp_Ent_Link Class .......................................................................................................................84 CanAccess Method........................................................................................................................84 GetEntAccessByUser Method.......................................................................................................85
2004 CIMNET Inc

www.CimnetInc.com

GetUserAccessByEnt Method.......................................................................................................86 GetGrpAccessByEnt Method........................................................................................................87 Shift Class.........................................................................................................................................88 Shift_Sched Class............................................................................................................................88 Shift_Exc Class................................................................................................................................88 GetExceptions Method..................................................................................................................89 Shift_To_Go Class ...........................................................................................................................90 Message Class...................................................................................................................................90 Mail_Grp Class ................................................................................................................................91 Mail_Grp_Member Class...............................................................................................................91 Emailatt Class ..................................................................................................................................92 Pred_Msg Class ...............................................................................................................................92 UI_Config Class...............................................................................................................................92 SaveSectionParams Method..........................................................................................................93 UI_Config_Default Class...............................................................................................................94 SaveSectionParams Method..........................................................................................................94 UI_Button Class..............................................................................................................................95 UI_Button_Set Class.......................................................................................................................96 Mgr_Data_Config Class .................................................................................................................96 Graphic Class...................................................................................................................................97 UpdateImage Method....................................................................................................................97 Tool Class .........................................................................................................................................98 Doc_Type Class ................................................................................................................................99 File_Type Class ................................................................................................................................99 File_Desc Class ..............................................................................................................................100 Dir Class .........................................................................................................................................100 Add Method.................................................................................................................................101 Delete Method..............................................................................................................................102 ChangeSeq Method......................................................................................................................102 ReSeq Method..............................................................................................................................103 Prod DLL Enhanced Methods ..........................................................................................................104 Item_State Class............................................................................................................................104 Item_Grade Class..........................................................................................................................104 Item_Class Class ............................................................................................................................104 Item_Class_Attr Class ..................................................................................................................105
2004 CIMNET Inc

www.CimnetInc.com

Item Class.......................................................................................................................................105 Item_Attr Class..............................................................................................................................106 Uom Class .......................................................................................................................................106 Uom_Conv Class ...........................................................................................................................107 Item_Reas_Grp Class...................................................................................................................107 Item_Reas_Grp_Class_Link Class .............................................................................................108 Item_Reas_Grp_Ent_Link Class ................................................................................................108 GetReasons Method....................................................................................................................108 Item_Reas Class .............................................................................................................................109 Job_Exec Class...............................................................................................................................110 GetQueue Method........................................................................................................................112 StartJob Method...........................................................................................................................113 EndJob Method............................................................................................................................115 PauseJob Method.........................................................................................................................117 SplitJob Method...........................................................................................................................118 CloneJob Method.........................................................................................................................120 CreateWOfromProcess Method..................................................................................................123 CloneWO Method........................................................................................................................125 SetCurLotData Method...............................................................................................................127 AddProd Method..........................................................................................................................128 AddProdPostExec Method..........................................................................................................131 AddCons Method.........................................................................................................................134 AddConsPostExec Method..........................................................................................................136 RejectProd Method......................................................................................................................139 VerifyProcess Method.................................................................................................................140 StartStep Method.........................................................................................................................141 StopStep Method.........................................................................................................................143 UpdateStepData Method.............................................................................................................144 StepLogin Method.......................................................................................................................145 StepLogout Method.....................................................................................................................147 CertStartAllowed Method...........................................................................................................148 CertSignoffAllowed Method.......................................................................................................150 CertSignoffReqd Method............................................................................................................151 CertSignoffDone Method............................................................................................................152 CertSignoff Method.....................................................................................................................153 DownloadSpecs Method..............................................................................................................155 SetActualSpecValue Method......................................................................................................156 SetUIScreenTagValues Method..................................................................................................157 SetAttr Method............................................................................................................................160 ChangeWOPriority Method........................................................................................................161 ChangeWOReqFinishTime Method............................................................................................162 ChangeWOQtys Method.............................................................................................................163
2004 CIMNET Inc

www.CimnetInc.com

StartNextJobViaFC Method........................................................................................................164 ChangeSpecValue Method .........................................................................................................165 GetSchedulableEntities Method.................................................................................................167 GetReqdCertSignoffs Method....................................................................................................168 GetStepBOMData Method..........................................................................................................169 LogJobEvent Method..................................................................................................................170 GetJobBOMStepQuantities Method...........................................................................................172 ChangeSpecValues Method .......................................................................................................173 UpdateTemplateSpecValues Method .........................................................................................175 GetRunnableEntities Method......................................................................................................176 GetSchedulableEntity Method....................................................................................................177 GetSchedulableParents Method..................................................................................................178 GetJobQueue Method..................................................................................................................178 StartDataEntryJob Method..........................................................................................................179 AddConsDirect Method...............................................................................................................181 Job_Event Class.............................................................................................................................183 Job_Sched_Exec Class..................................................................................................................184 ApplySchedule Method...............................................................................................................185 RefreshTempShiftExc Method....................................................................................................188 DropTempShiftExc Method........................................................................................................188 CreateWOAltInfo Method...........................................................................................................189 CreateWOJobs Method...............................................................................................................189 DropWOAltInfo Method.............................................................................................................189 Job_State Class..............................................................................................................................190 WO Class........................................................................................................................................190 Wo_Attr Class................................................................................................................................190 Job Class .........................................................................................................................................191 GetCanLogDataCapability Method............................................................................................192 GetDisplaySeq Method...............................................................................................................193 GetNextSeqNo Method...............................................................................................................194 Job_Attr Class...............................................................................................................................195 Job_Route Class ............................................................................................................................195 GetJobPath Method.....................................................................................................................195 GetJobRoute Method...................................................................................................................196 Item_Prod Class............................................................................................................................197 Split Method................................................................................................................................198 Process_Class Class .......................................................................................................................200 Process Class ..................................................................................................................................201 Clone Method..............................................................................................................................202 CheckIn Method ........................................................................................................................203 CheckOut Method ......................................................................................................................204
2004 CIMNET Inc

www.CimnetInc.com

GetNextVerId Method.................................................................................................................205 GetItemProdAtOper Method.......................................................................................................206 GetProducedItems Method..........................................................................................................207 Process_Attr Class........................................................................................................................207 Item_Process_Link Class.............................................................................................................208 GetNextItemPref Method............................................................................................................208 Oper Class......................................................................................................................................209 Oper_Attr Class.............................................................................................................................209 Oper_Ent_Link Class...................................................................................................................210 GetCanLogDataCapability Method............................................................................................210 Oper_Ent_Route Class.................................................................................................................212 Oper_Ent_Item_Link Class .........................................................................................................212 OEE_Exec Class ............................................................................................................................212 TPM_Stat Class .............................................................................................................................213 Lot_Attr Class ...............................................................................................................................213 EnProd DLL Enhanced Methods .....................................................................................................215 BOM_Ver Class .............................................................................................................................215 Clone Method...............................................................................................................................215 Copy Method...............................................................................................................................216 BOM_Item Class...........................................................................................................................218 BOM_Item_Oper_Link Class .....................................................................................................218 ChangeProducedItem Method.....................................................................................................219 GetBomOperInfo Method...........................................................................................................220 Job_BOM Class .............................................................................................................................221 GetJobBomData Method.............................................................................................................222 Item_Cons Class ............................................................................................................................223 Split Method................................................................................................................................223 Item_Subst Class ...........................................................................................................................226 Bom_Item_Subst Class.................................................................................................................226 Job_Bom_Subst Class...................................................................................................................227 Oper_Step_Grp Class ...................................................................................................................227 Oper_Step Class ............................................................................................................................228 Oper_Step_File Class ....................................................................................................................228 Oper_Step_Ent_Exc Class...........................................................................................................229 BOM_Item_Oper_Step_Link Class...........................................................................................229 GetBomOperStepInfo Method....................................................................................................230
2004 CIMNET Inc

www.CimnetInc.com

Job_Step_Grp Class ......................................................................................................................231 Job_Step Class...............................................................................................................................231 Job_Step_File Class.......................................................................................................................232 Job_BOM_Step Class...................................................................................................................232 Job_Step_Data Class .....................................................................................................................233 Spec Class .......................................................................................................................................233 Oper_Spec_Ver Class...................................................................................................................233 Oper_Ent_Spec Class...................................................................................................................234 GetSpecs Method.........................................................................................................................234 GetItemEntSpecs Method............................................................................................................235 BOM_Item_Oper_Spec Class ......................................................................................................236 GetSpecs Method.........................................................................................................................237 Job_Spec Class...............................................................................................................................238 GetJobSpecs Method...................................................................................................................239 Storage_Exec Class .......................................................................................................................239 AddInv Method............................................................................................................................240 ReduceInv Method.......................................................................................................................242 Transfer Method..........................................................................................................................244 Split Method................................................................................................................................245 TransferAndUpdateInv................................................................................................................247 GetShortages Method..................................................................................................................249 GetInventory Method..................................................................................................................250 Item_Inv Class...............................................................................................................................252 Item_Transfer Class .....................................................................................................................252 Item_Storage_Exec_Link Class..................................................................................................253 Transfer_List Class......................................................................................................................253 Data_Log_Grp Class ....................................................................................................................254 Clone Method...............................................................................................................................254 SaveSample Method....................................................................................................................255 GetEntGroups Method.................................................................................................................256 CheckDataLogGrpValExists Method.........................................................................................257 Data_Log_Value Class .................................................................................................................258 Data_Log_16 and Data_Log_48 Classes ...................................................................................258 Res Class .........................................................................................................................................259 Res_Exc Class ................................................................................................................................259 Res_Oper_Link Class ...................................................................................................................260 Res_Job_Link Class ......................................................................................................................260
2004 CIMNET Inc

www.CimnetInc.com

DNC DLL Enhanced Methods ..........................................................................................................261 Folder Class ....................................................................................................................................261 SetPreferredVer Method..............................................................................................................261 Clone Method..............................................................................................................................262 Folder_File Class ...........................................................................................................................264 Folder_Item_Oper_Ent_Link Class...........................................................................................265 Folder_Distr Class.........................................................................................................................265 WO_File Class ................................................................................................................................266 Item_File Class...............................................................................................................................266 DNC_Exec Class............................................................................................................................267 GetProtocols Method...................................................................................................................267 Hub Class........................................................................................................................................268 Hub_Dev Class ...............................................................................................................................268 Defcon Class...................................................................................................................................269 DNC_Log Class.............................................................................................................................269 EndLogEntry Method..................................................................................................................270 UTIL DLL Enhanced Methods .........................................................................................................270 Util_Exec Class..............................................................................................................................270 SetReason Method.......................................................................................................................271 SetRawReason Method...............................................................................................................273 SetPendingReason Method.........................................................................................................274 GetAvailableReasons Method....................................................................................................275 GetOldAvailableReasons Method..............................................................................................276 UpdateDurations Method............................................................................................................277 GetStatusInfoByUser Method.....................................................................................................278 Util_State Class..............................................................................................................................279 Util_Reas_Grp Class .....................................................................................................................279 Util_Reas Class ..............................................................................................................................279 Util_Reas_Link Class ...................................................................................................................280 Util_Raw_Reas Class ....................................................................................................................280 Util_Log Class................................................................................................................................281 GetAllByPeriod Method..............................................................................................................282 Split Method................................................................................................................................283 AdjustDuration Method...............................................................................................................285 LABOR DLL Enhanced Methods.....................................................................................................287 Labor_Exec Class..........................................................................................................................287 GetAvailableLabCodes Method.................................................................................................287
2004 CIMNET Inc

www.CimnetInc.com

AddLabor Method........................................................................................................................288 SetLabData Method.....................................................................................................................291 UpdateDuration Method..............................................................................................................292 GetStatusInfoByUser Method.....................................................................................................293 SetRawReason Method...............................................................................................................294 Labor_Cat Class............................................................................................................................295 Labor_Dept Class..........................................................................................................................295 Labor_Reas_Link Class ...............................................................................................................296 Labor_Raw_Reas Class ................................................................................................................296 Labor_Usage Class ........................................................................................................................297 CERT DLL Enhanced Methods.......................................................................................................298 Cert_Type Class ............................................................................................................................298 Cert_User_Link Class..................................................................................................................298 Cert_Item_Link Class..................................................................................................................299 Cert_Oper_Link Class.................................................................................................................299 Cert_Oper_Step_Link Class .......................................................................................................299 Cert_Attr_Link Class ...................................................................................................................300 Cert_Audit_Log Class ..................................................................................................................300 CUST DLL Enhanced Methods........................................................................................................302 Cust Class.......................................................................................................................................302 GetAllByFilter Method...............................................................................................................302 Cust_Contact Class .......................................................................................................................303 SO Class..........................................................................................................................................303 So_Line Class.................................................................................................................................304 GetNextSoLineNo Method.........................................................................................................304 GetAllByFilter Method...............................................................................................................305 So_Wo_Link Class ........................................................................................................................306 Shipment Class ..............................................................................................................................307 Shipment_Lot Class ......................................................................................................................307 GetQtyShipped Method...............................................................................................................308 GetLotNos Method......................................................................................................................309 GetMaxToShip Method...............................................................................................................310 Ship Method.................................................................................................................................311 Vendor_Item_Link Class .............................................................................................................312 PO Class ..........................................................................................................................................313 Po_Line Class .................................................................................................................................313
2004 CIMNET Inc

www.CimnetInc.com

10

Receipt Class..................................................................................................................................314 Receipt_Lot Class..........................................................................................................................314 DX DLL Enhanced Methods.............................................................................................................315 Dx_Sched Class..............................................................................................................................315 SetDataType Method...................................................................................................................315 RunQuery Method.......................................................................................................................317 Clone Method (Not Implemented yet)........................................................................................318 TestQuery Method.......................................................................................................................319 GetImportFieldMappings Method..............................................................................................320 Dx_Field Class ...............................................................................................................................321 Dx_Map_Imp Class .......................................................................................................................322 GetDistinctMappings Method....................................................................................................322 Dx_Map_Exp Class .......................................................................................................................323 GetDistinctMappings Method....................................................................................................323 Dx_Query Class .............................................................................................................................324 Dx_Query_Param Class ...............................................................................................................324 Dx_Queue Class.............................................................................................................................325 Dx_Log Class .................................................................................................................................325 FC DLL Enhanced Methods.............................................................................................................327 FC_Namesp_Node Class ..............................................................................................................327 Clone Method..............................................................................................................................327 FC_Namesp_Tag Class ................................................................................................................328 GetChangesAndReset Method....................................................................................................328 FC_Bridge Class ............................................................................................................................329 Form DLL Enhanced Methods.........................................................................................................330 Form Class ......................................................................................................................................330 Script Class....................................................................................................................................330 DeleteByName Method...............................................................................................................331 UpdateByName Method..............................................................................................................332 SaveFormScript Method..............................................................................................................333 Form_Script_Link Class..............................................................................................................335 SPC DLL Enhanced Methods...........................................................................................................335 SPC_Char Class ............................................................................................................................335 SPC_Item_Char_Link Class .......................................................................................................336 SPC_Char_Oper_Link Class ......................................................................................................336 SPC_Char_Job Class ....................................................................................................................337
2004 CIMNET Inc

www.CimnetInc.com

11

SPC_Event Class ...........................................................................................................................337 SPC_Sample Class ........................................................................................................................338 SPC_Stats Class.............................................................................................................................338 Gage_Config Class ........................................................................................................................338 The Director Class.............................................................................................................................340 Trap when dealing with XML strings .......................................................................................341 Method Delegation Hierarchy.....................................................................................................341 GenericXMLRequest Method.....................................................................................................343 ExecuteXMLCmd Method..........................................................................................................344 GetRSbyXML Method................................................................................................................345 GetRSasXML Method.................................................................................................................346 GetSpecificRS Method................................................................................................................347 GetSpecificRSasXML Method...................................................................................................348 GetRSbySQL Method..................................................................................................................348 GetRSbySQLasXML Method.....................................................................................................349 GetShapedRSbySQL Method......................................................................................................349 GetShapedRSbySQLasXML Method.........................................................................................350 GetRSFromExtDB Method.........................................................................................................350 GetRSFromExtDBasXML Method.............................................................................................351 RunQuery Method.......................................................................................................................352 RunQueryasXML Method...........................................................................................................353 GetRSbySP / GetRSbySPasXML Method (Not implemented yet stub only).......................353 GetClientNTUser Method...........................................................................................................355 SetUserConnStr Method..............................................................................................................355 DirectorTrans Class......................................................................................................................356 ExecuteXMLCmd Method..........................................................................................................356 ExecuteBatchXMLCmds Method...............................................................................................358 Other Issues........................................................................................................................................361 Data Types......................................................................................................................................361 Error Handling ..............................................................................................................................361

Introduction
This document details the middleware or Business Rules layer. The Standard Methods or Functions for each class are detailed, as well as the Custom methods that implement application specific Business Rules.
2004 CIMNET Inc

www.CimnetInc.com

12

VB Data types are specified in all cases. Thus longs are used whenever the database field is INT32 for example. Required parameters are usually of the specified type. Optional parameters are always variants to allow the VB code to check for Missing parameters.

Pre-requisites for Access to the Middleware


Before any of the middleware functionality may be accessed the database and middleware must be installed and available. The document Setting up the Database and Middleware.doc describes in detail how to do this.

Session and Login Handling


All access to the middleware is achieved by the following mechanism: 1. Starting a session of the given license type which is subject to licensing limitations on the basis of the number of concurrent connections. 2. A user logging into that session and being authenticated before being given the privileges to execute any of the middleware functionality. 3. Operator clients also need to then logon to one or more entities before they can control job execution etc on those entities. Note the following points regarding sessions and logins: Each client software module uses privileges assigned to user groups to authorize or prohibit actions. Privileges are assigned to any groups which can be used to implement role based security as each user may be a member of multiple groups. Software licensing is controlled by concurrent SESSIONS, so as to make licensing independent of which client computers are used and to allow multiple instances of an EXE from the same computer if required (these would each be unique sessions from the same computer). A SESSION is defined as an instance of a client application, and thus corresponds directly to the term session in Microsofts Active Server Pages (ASP) The session IDs are assigned by the middleware instead of being determined by the client based on hard disk ID or TCP/IP address etc. This is required to facilitate use of terminal server products and allow multiple instances per client PC if required. The same authentication and authorization mechanism applies whether clients are accessing the middleware directly or indirectly via a Web Server. Operator users are able to log on to 0 or more entities at any time within a session, and are also allowed to log on to the same or different entities on different sessions (at the same or different computers) at the same time. Operator clients must first create the session and login to the session, before logging ON to one or more entities to control them.

2004 CIMNET Inc

www.CimnetInc.com

13

Operator users are able to easily switch users in cases where multiple users are sharing the same session. The system is able to define and save the default entities AND the last used list of entities for all Operator users so that a user may be logged onto all entities in either of these lists with a single method call to the middleware. Support for multiple entity logons is only required via XML access which facilitates receiving entity lists and returning a list of all entities successfully logged onto. The system facilitates automatic labor collection after logon if so configured. This is achieved by including optional labor code parameters during the logon process. In the case where the same user is logged onto > 1 entity at the same time the parameter to specify the % of time spent on each entity should be specified. (this defaults to 100 for the first users first logon if not specified, and if automatic labor collection option is set) The system allows for Login with password only (and no user_id) if the system setting of unique passwords is set which allows each password to uniquely identify a user. In the future we may want to configure an Automatic Log Off timeout for Operator clients to automatically log them off if no keystrokes have been hit for x seconds from their session. This is NOT currently implemented. The background service installed with the product maintains current sessions on a periodic basis to automatically restore licenses if the sessions are not ended gracefully, eg. after prolonged inactivity from browser based clients or program crashes. This functionality requires that each live session refresh its heartbeat via the appropriate session method at least every 5 minutes. In the future we may optionally integrate with Windows security for the purposes of maintaining passwords in one place only (all privilege authorization is done internal to our software and so users, groups and privileges still need to be defined in our system). Each user thus has a configurable authentication method property which defaults to internal for now, but would later allow a windows entry in the case where password authentication is to be achieved using passwords defined in windows. This system would facilitate users who do or do not have windows user IDs defined (many shop floor workers do not). In future we will support client sessions subscribing to relevant events from the middleware. There are currently some optional parameters when starting a session which will cater for this functionality in the future.

2004 CIMNET Inc

www.CimnetInc.com

14

Standard Data Access Methods


These functions are similar for EVERY class that links to a database table, (ie. All classes except those included in the FIBRxx and FIWebxx DLLs). There is a class defined for every database table with the same name as the table name. These provide the generic methods to insert, update, delete and retrieve data for each table in the database. They also include some methods to handle XML data requests and updates. In most cases application specific methods are included in the class to which they most closely apply. These specific methods are detailed in the next chapter. This also includes the service based classes which also map to a database table (usually the ***_exec tables), as that table usually maintains current state data for the service.

Add Method
Purpose To add a new record to the database for the relevant class. Syntax Add (List of all field names for the table referenced by the class) Parameters Part Session_id Description Required. By Value. A long to identify the session (and thus the user) making the call. Not Allowed for Identity tables as the database assigns the primary key value. Required for non-Identity tables. By Value. A Variant mapping to the relevant table / column data type. Optional. By Value. A Variant mapping to the relevant table / column data type. If the parameter is omitted a default may be applied as defined in ?? , otherwise an exception will be generated as the field is not nullable in the database. Optional. By Value. A Variant mapping to the relevant table / column data type. If the parameter is omitted it will default to NULL as the field is nullable in the database. Optional. By Value. A Boolean specifying whether to validate the data by calling the IsValid() method before attempting to insert into the database. Default value is True.

Primary Key Fields

Non-nullable Dependent Fields

Nullable Dependent Fields

PerformValidation

Returns

2004 CIMNET Inc

www.CimnetInc.com

15

For tables with Identity columns the database assigns the Identity / primary key value as a long (32 bit integer) and this value is returned by this method. 1 if error ?? For tables without Identity columns the method returns a Boolean - True if the insert was successful, otherwise it returns False. Usually an exception is triggered if the method fails with the err.desc field explaining the reason for the failure. If the PerformValidation parameter is true then the IsValid() method is called to validate the data before processing. As only included values will be validated by the IsValid method this method will first check for Required fields and assign defaults for Missing or Empty or Null values BEFORE calling IsValid. This allows defaults to be applied where possible to avoid throwing errors unnecessarily, and throws an exception before calling IsValid() if required values are not included in the method call. Remarks All arguments are passed as Variants to allow for optional parameters to be omitted and this omission detected by the method. Stored Procedure(s) Used sp_I_xxxxxx where xxxxxx is the class name.

Update Method
Purpose To update ALL of the fields of an existing record in the database for the relevant class. Syntax Update (List of all field names for the table referenced by the class) Parameters Part Session_id Description Required. By Value. A long to identify the session (and thus the user) making the call. Required. By Value. A Variant mapping to the relevant table / column data type. Required. By Value. A Variant mapping to the relevant table / column data type. Required. By Value. A Variant mapping to the relevant table / column data type. Optional. By Value. A Boolean specifying whether to validate the data by calling the IsValid() method before attempting to update the database. Default value is True.

Primary Key Fields Non-nullable Dependent Fields Nullable Dependent Fields PerformValidation

Returns Boolean. True if the update was successful, otherwise it returns False. Usually an exception is triggered if the method fails with the err.desc field explaining the reason for the failure. Remarks
2004 CIMNET Inc

www.CimnetInc.com

16

All fields MUST be passed as parameters and will be updated in the database ie. There are NO optional fields. This allows a Stored Procedure to be used for the Update which results in increased performance. For cases where you only wish to update certain dependent fields see the UpdateSpecific() method which provides increased flexibility but lower performance by building a dynamic SQL statement instead of using a Stored Procedure. If the PerformValidation parameter is true then the IsValid() method is called to validate the data before processing. As there are no optional values in this method all fields will be validated by the IsValid method. Stored Procedure(s) Used sp_U_xxxxxx where xxxxxx is the class name.

UpdateSpecific Method
Purpose To update SPECIFIC dependent field(s) of an existing record in the database for the relevant class. When updating all dependent fields use the Update() method rather as it provides better performance by using a Stored Procedure. Syntax UpdateSpecific (Subset of all field names for the table referenced by the class) Parameters Part Session_id Description Required. By Value. A long to identify the session (and thus the user) making the call.
Required. By Value. A Variant mapping to the relevant table / column data type. Optional. By Value. A Variant mapping to the relevant table / column data type.

Primary Key Fields Dependent Fields

PerformValidation

Optional. By Value. A Boolean specifying whether to validate the data by calling the IsValid() method before attempting to update the database. Default value is True.

Returns Boolean. True if the update was successful, otherwise it returns False. Usually an exception is triggered if the method fails with the err.desc field explaining the reason for the failure. Remarks Use this method to update a subset of the dependent fields for the table. Only those fields explicitly passed as parameters will be updated in the database. This method builds up the SQL command dynamically due to the difficulty of writing a Stored Procedure to generically handle all the possible combinations. The performance of this method will thus be significantly less than the standard Update() method, so only use this method when you cannot update all dependent fields in the table.
2004 CIMNET Inc

www.CimnetInc.com

17

Tables that include a timestamp field to implement Optimistic Concurrency must have the mod_id field included as a parameter, otherwise the update will fail. Tables that do not have a mod_id field, should include last_edit_at field as a parameter, otherwise the update will fail. Optional parameters not included in the method call are excluded from the update statement. An included parameter with a null value IS included in the update but will obviously receive an error from the validation code or the database in this case if the database field does not allow null values. If the PerformValidation parameter is true then the IsValid() method is called to validate the data before processing. Only included values will be validated by the IsValid method. Stored Procedure(s) Used None. A dynamic SQL statement is built based on which fields are included for updating.

Delete Method
Purpose To delete an existing record in the database for the relevant class. Syntax Delete (List of all primary key fields only) Parameters Part Session_id Description Required. By Value. A long to identify the session (and thus the user) making the call.
Required. By Value. A Variant mapping to the relevant table / column data type.

Primary Key Fields Returns

Boolean. True if the delete was successful, otherwise it returns False. Usually an exception is triggered if the method fails with the err.desc field explaining the reason for the failure. Remarks All primary key fields must be passed as parameters to identify a single record to be deleted. For cases where you wish to delete multiple rows based on a subset of the primary key see specific methods for certain classes where a DeleteByxxxx() method may be provided. Stored Procedure(s) Used sp_D_xxxxxx where xxxxxx is the class name.

DeleteAll Method
Purpose To delete multiple existing records in the database for the relevant class. Syntax DeleteAll (Partial List of all primary key fields only) Parameters
2004 CIMNET Inc

www.CimnetInc.com

18

Part Session_id

Description Required. By Value. A long to identify the session (and thus the user) making the call. Optional. By Value. A Variant mapping to the relevant table / column data type.

Primary Key Fields Returns

Long. Number of records deleted from the table. Usually an exception is triggered if the method fails with the err.desc field explaining the reason for the failure. Remarks Any of the primary key fields may be passed as parameters to identify which records are to be deleted. Typically, this method is used for tables with composite primary keys where only a subset of the primary key fields are supplied for the delete, eg. to delete all attributes from ent_attr for a given entity. Passing no parameters to this method will delete ALL rows from the table, subject to Foreign Key constraints etc in the database. WARNING: Be careful when using this method as it is easy to make a mistake and delete many rows unintentionally. The performance of this method will also be slower than the standard Delete() where single record deletes are involved, but it should be used in place of client code looping through multiple deletes as separate transactions. Stored Procedure(s) Used None. A dynamic SQL statement is built based on which filters are defined for the delete.

GetAll Method
Purpose To retrieve a recordset containing ALL fields for this class / table from the database, optionally filtered by certain fields passed as parameters. Syntax GetAll (List of all field names for the table referenced by the class) Parameters Part Primary Key Fields Dependent Fields Description Optional. By Value. A Variant mapping to the relevant table / column data type by which to filter the returned data Optional. By Value. A Variant mapping to the relevant table / column data type by which to filter the returned data.

Returns ADODB.Recordset containing the optionally filtered resultset. The recordset will be disconnected from the database and its cursor will be set to Client side and Static. The lock will be set to
2004 CIMNET Inc

www.CimnetInc.com

19

adLockBatchOptimistic which allows the client software to modify the recordset data if required. We advise you to not use the recordset for updating purposes, but rather to update, insert and delete rows independently. The recordsets field names will default to the tables column names as defined by the database. It is possible to edit the relevant Stored Procedure using the as clause to change these default column names. Note: As these Stored Procedures may be changed in the future to include additional data or change the order of returned columns, it is best practice to refer to the recordsets fields by name instead of by index when writing client side code to access the fields. Remarks In most cases the Stored Procedures used by this method also include default joined data from related tables, eg. Description fields are almost always returned when the primary table only includes a code field that references another table for the description. This method allows filtering BY EQUALITY to any number of the available fields. If parameters for > 1 field are included the filtering ANDs together all of the filter restrictions. Only those fields explicitly passed as parameters will be used to filter the resultset that is returned. Any fields that are not included will NOT be used to restrict the resultset - effectively a wildcard is applied to that field. This operation allows for 90% of filtered retrieve queries to be handled with the increased performance of using Stored Procedures. More complicated filtering such as other relational operators (eg >=, like etc), or nested conditions are not handled by this method. (see other specific methods for some classes to provide this functionality) Any BLOB or text datatypes included as filters will NOT affect the resultset that is returned as these field types may not be included in a SQL WHERE clause. However, these fields are still passed to the GetAll() method for consistency. If last_edit_at field is included as an optional filter, then all rows with last_edit_at values AT or AFTER the filter datetime are included in the resultset, ie., last_edit_at returns all rows where last_edit_at >= parameter value. Stored Procedure(s) Used sp_SA_xxxxxx where xxxxxx is the class name.

GetByKey Method
Purpose To retrieve specified field values from a single row in the database for the relevant class / table. Syntax GetByKey (List of all field names for the table referenced by the class) Parameters Part Primary Key Fields Dependent Fields Description Required. By Value. Data type of the relevant table / column data type to identify the row for which we want to retrieve data. Optional. By Reference. A Variant mapping to the relevant table / column data type into which the method will place the value of the returned data for the selected row in the database.

2004 CIMNET Inc

www.CimnetInc.com

20

Returns Boolean. True if the row was found, otherwise it returns False. Usually an exception is triggered if the method fails with the err.desc field explaining the reason for the failure. Remarks All primary key fields must be included as parameters in order to uniquely identify the row to be accessed. Note that these parameters are passed as specific data types and not as variants in this case. This method allows retrieval of specific dependent fields directly into variables to be used by the client application. This method does NOT apply default joins to return related data like the GetAll() method does. Use the GetAll() method if such data is required. Stored Procedure(s) Used sp_S_xxxxxx where xxxxxx is the class name.

GetAllbyXML Method
Purpose To retrieve a recordset containing ALL fields for this class / table from the database, optionally filtered by certain fields passed as parameters. Identical to the GetAll() method except that the input parameters are all bundled into a single XML string in this case. Syntax GetAllByXML (XML string) Parameters The XML formatted request must be structured as follows: <object> <filter> Returns ADODB.Recordset containing the optionally filtered resultset. The recordset will be disconnected from the database and will be Client side and Static. The lock will be set to adLockBatchOptimistic. The recordsets field names will correspond to the tables column names as defined by the database. Note: As these Stored Procedures may be changed in the future to include additional data or change the order of returned columns, it is best practice to refer to the recordsets fields by name instead of by index when writing client side code to access the fields. Remarks This method reduces dependencies on COM interfaces by maintaining a simple, consistent interface even if the parameters are changed in the future. It is useful for remote requests received via HTTP, which are usually handled by the intermediate Director class which then converts the returned recordset into XML format as well. See GetAll() Remarks for other comments that apply to the recordset returned by this method. Stored Procedure(s) Used sp_SA_xxxxxx where xxxxxx is the class name.
2004 CIMNET Inc

mandatory name of class / table optional Filters for the recordset (default = no filter) optional field value(s) for filter (default = all rows)

<fieldname_x>

www.CimnetInc.com

21

Examples This request will return all item classes that have the Produced Flag checked <?xml version="1.0"?> <request> <object>item_class</object> <filter> <item_class_id></item_class_id> <item_class_desc></item_class_desc> <produced>1</produced> <consumed></consumed> </filter> </request> This request will return all item classes with no filters applied <?xml version="1.0"?> <request> <object>item_class</object> </request>

GetSpecificRS Method
Purpose To retrieve a specific recordset for this class / table from the database. The class will usually have Custom methods that return recordsets for this method to be implemented, in which case it usually delegates to those custom methods for generic access via the Director class for HTTP access etc. Syntax GetSpecificRS (cmd string, XMLRequest string) Parameters Part cmd Description Required. By Value. A string which is class dependent usually the name of the custom method to use Required. By Value. Dependent on the specific method to be invoked. Details defined in each Custom methods reference.

XMLRequest

Returns ADODB.Recordset containing the specific recordset. The recordset will be disconnected from the database and will be Client side and Static. The lock will be set to adLockBatchOptimistic. The recordsets field names will correspond to the tables column names as defined by the database. Note: As these Stored Procedures may be changed in the future to include additional data or change the order of returned columns, it is best practice to refer to the recordsets fields by name instead of by index when writing client side code to access the fields. Remarks This method reduces dependencies on COM interfaces by maintaining a simple, consistent interface
2004 CIMNET Inc

www.CimnetInc.com

22

even if the parameters are changed in the future. It is useful for remote requests received via HTTP, which are usually handled by the intermediate Director class which then converts the returned recordset into XML format as well. Stored Procedure(s) Used Usually sp_SA_xxxxxx where xxxxxx is the class name and some way of identifying the SPs function. Examples This request will return all entities and whether a given user has access to each one or not. <?xml version="1.0"?> <request> <object>grp_ent_link</object> <msgtype>getspec</msgtype> <schema></schema> <cmd>GetEntAccessByUser</cmd> <user_id>111</user_id> </request>

ExecuteXMLCmd Method
Purpose To execute a class specific command (typically Add, Update, Delete or UpdateSpecific, but also some classs custom methods) received in XML format. Calling Custom Methods has some limitations on return values and no capability for BYREF or named parameters. Syntax ExecuteXMLCmd (xmlCmd) Parameters The XML formatted command must be structured as follows: <object> <cmd> <validate> <classname> Returns String in XML format returning the status / error description in the following format <result> <identity> 0 for success, -1 for failure - always included Identity value only included if success on Identity table inserts error description - only included if unsuccessful mandatory name of class / table mandatory command (Add, Update, Delete and other class specific cmds) optional validate flag (default = 1) mandatory class / table name field names optional for some methods

<fieldname_x>

<error><desc> Remarks

This method reduces dependencies on COM interfaces by maintaining a simple, consistent interface even if the parameters are changed in the future. It is useful for remote commands received via HTTP,
2004 CIMNET Inc

www.CimnetInc.com

23

which are usually handled by the intermediate Director class. This method only allows single rows to be Added, Updated or Deleted for each call on the method. See the ImportXMLData() method for importing multiple rows of data in a single transaction. The Add command must include all the relevant tables fields, except for the Identity field in such tables. The Update command tries to update ALL dependent fields so they MUST all be included as fields in the XML string. If the field value is not included they are replaced with nulls, which may overwrite the database with incorrect data or receive a database error if the field has a non-null constraint. Replaced by Empty now ? The UpdateSpecific() method will only try to update fields included. The primary key fields must be included and at least one dependent field (and obviously the timestamp field if there is one) The Delete command only needs to include the fields that make up the primary key of the table and the timestamp field if there is one. Custom methods are accessed passing the parameters defined in the given sequence. It is not possible to use Named Parameters in this case. Note that string parameters must be included within ??? Stored Procedure(s) Used sp_I_xxxxxx, sp_U_xxxxxx, sp_D_xxxxxx or others where xxxxxx is the class name. Examples This command will insert a new item class into the database <?xml version="1.0"?> <request> <object>item_class</object> <cmd>Add</cmd> <validate>1</validate> <item_class> <session_id>1239</session_id> <item_class_id>99</item_class_id> <item_class_desc>new class desc</item_class_desc> <produced>1</produced> <consumed>0</consumed> </item_class> </request> This request will update ALL the dependent fields of an existing process record <?xml version="1.0"?> <request> <object>process</object> <cmd>Update</cmd> <validate>1 </validate> <process> <session_id>1239</session_id> <process_id>Fill</process_id> <process_desc>Filling Cans</process_desc> <process_level>3</process_level> <parent_process_id></parent_process_id> <process_status>2</process_status>
2004 CIMNET Inc

www.CimnetInc.com

24

<notes></notes> <mod_id>01 Jan 1900 00:00:00:837</mod_id> </process> </request> This request will delete an existing item from the database <?xml version="1.0"?> <request> <object>item</object> <cmd>Delete</cmd> <item> <session_id>1239</session_id> <item_id>itemxyz</item_id> </item> </request> This request will update only the ent_name field of an existing ent record <?xml version="1.0"?> <request> <object>ent</object> <cmd>UpdateSpecific</cmd> <parameters> <session_id>1239</session_id> <ent_id>2</ent_id> <ent_name>New Desc </ ent_name > </parameters> </request>

IsValid Method
Purpose To validate field values before inserting or updating a row in the database. Syntax IsValid (List of all field names for the table referenced by the class) Parameters Part Primary Key Fields Dependent Fields Description Optional. By Value. A Variant mapping to the relevant table / column data type. Optional. By Value. A Variant mapping to the relevant table / column data type.

Returns Boolean. True if all validation tests pass, otherwise returns False
2004 CIMNET Inc

www.CimnetInc.com

25

Remarks All parameters are optional and only those that are included are validated. If there are certain fields that are required for Add, Update or UpdateSpecific functionality then those checks take place in the respective methods as they may be different in each case. Fields that are NOT nullable in the database are handled as follows: Only validates if Not (Missing or Empty) and throws error if the value is either Null or invalid. Fields that ARE nullable in the database are handled as follows: Only validates if Not (Missing or Empty or Null) and throws error if the value is invalid. This allows nullable values in the database to be defaulted to null when inserting without throwing errors back to the client. It is advisable to do as much validation on the client as possible before submitting the request to the middle tiers to prevent unnecessary network traffic and improved User Interface response times for simple errors. Stored Procedure(s) Used None.

2004 CIMNET Inc

www.CimnetInc.com

26

Core DLL Enhanced Methods


Every object will have standard methods allowing rows to be retrieved, added, edited and deleted as defined in the previous chapter. This section only lists the additional methods and those that have been enhanced to implement class specific functionality.

Session Class
This class handles all session functionality, including the handling of the session, ent_logon and ent_logon_list tables Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Not Supported. Not Supported. Not Supported. Retrieval of the following specific recordsets are supported: GetSessions(). Available filters are: session_id, client_type, user_id GetEntLogons(). Available filters are: session_id, ent_id, user_id GetEntLogonList(). Available filters are: user_id, list_id, ent_id GetDBStatus() ? GetAllDBStatus() ? Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS StartSession() StartBGSession() EndSession() Login() LogonEnt() LogonEntList() SaveEntList() Logoff() GetServerTime() Not Supported. COMMENTS Starts a session for a specified client type Starts a session for a specified background executable type End a current session Log a user in to a session Log an Operator on to an entity Log an Operator on to a list of entities Save a list of entities for future login in a single method call Log a user off a session Returns the current date and time on the server Not Supported. Use StartSession() method to achieve this Not Supported. Not Supported. Not Supported. Not Supported. COMMENTS

2004 CIMNET Inc

www.CimnetInc.com

27

GetModulesLicensed() SwitchUser() SwitchSession() RefreshHeartbeat() ValidPw() GetUserByPw() DoDailyTasks() DoHourlyTasks() DoMinutelyTasks() KillStaleSessions() SetMwDbUser()

Returns the number of client executables of each type licensed, and also which functional modules are licensed Switch the active user on the current session Switch the active session for the current user To keep a current session alive Cheks to see whether the users password is valid or not Return a user given the password - Make private ? Called by Factelligence service to perform background tasks that need to be done once a day. Called by Factelligence service to perform background tasks that need to be done once an hour. Called by Factelligence service to perform background tasks that need to be done once a minute. Automatically end sessions that have not been refreshed for a period of time. Sets the db_status mw_db_user field used by audit trails based on the current DB connection. Allows audit trails to distinguish between Factelligence users and external users. To return database and version information to client applications for display and possible validation checks Stub only for future use.

GetVerInfo() UpdateClientEvents()

StartSession Method
Purpose To start a session of a specified client type. Checks that a license of this type is available and if so uses it for this session. Syntax StartSession (client_type, client_address, reqd_events, dbserver, database, dbversion, spversion, defdataversion, dbmsname, dbmsversion, provider) Parameters Part client_type Description Required. By Value. A long specifying the client type : valid values are Configurator = 35, Supervisor = 36, Operator = 37, Manager = 38, Factory Connector = 39, Background Tasks = 53, DataEditor = 54, Messenger = 55, Report Designer = 56 and Scheduler = 57. For Factory Connector or the Background service use method StartBGSession() instead. Optional. By Value. A variant (string) specifying the clients callback address for event notifications from the middleware. (for future implementation) Optional. By Value. An XML encoded variant (string) specifying for which events the client wishes to receive event notifications from
www.CimnetInc.com

client_address

reqd_events

2004 CIMNET Inc

28

the middleware. (for future implementation)

dbserver

Optional. By Reference. A variant (string) specifying the name of the server. The value following SERVER= or in lieu of that, "Data Source", in the connection string in Factelligence.ini. Optional. By Reference. A variant (string) specifying the name of the database. The value following "DATABASE=" or in lieu of that, "Initial Catalog=", in the connection string in Factelligence.ini. Optional. By Reference. A variant (string) specifying the version of the database. From DB_Status.db_version. Optional. By Reference. A variant (string) specifying the version of the stored procedures. From DB_Status.sp_version. Optional. By Reference. A variant (string) specifying the version of the default data scripts used to populate the database initially. From DB_Status.def_data_version. Optional. By Reference. A variant (string) specifying the dbms name. Optional. By Reference. A variant (string) specifying the dbms version Optional. By Reference. A variant (string) specifies the name of the connection provider

database

dbversion spversion defdataversion

dbmsname dbmsversion provider

Returns A long >= 0 specifying the system generated session_id if successful. Throws an exception with an appropriate description if unsuccessful or if no licenses are available. Remarks Checks the encrypted license file to find out how many licenses of the given type are available, and then based on how many of these client type licenses are currently used it checks out or refuses this request for a license. If successful it inserts an entry into session table and generates a unique session_id that is used to track this session in the future. The client needs to store this session ID for future calls, even if the session is created via the Web Server. An appropriate error description is returned when the exception is thrown if no further licenses of this client_type are available. The client_address and reqd_events fields are for future implementation only, and are currently saved to the database but ignored thereafter. Stored Procedure(s) Used sp_I_Session Access via Director.cls using ExecuteXMLCmd()
2004 CIMNET Inc

www.CimnetInc.com

29

Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>session</object> <msgtype>exec</msgtype> <cmd>StartSession</cmd> <client_type>37</client_type> <client_address></client_address> <reqd_events></reqd_events> </request> The XML response will be formatted as follows if the call is successful: <?xml version="1.0"?> <response> <result>0</result> <identity>1</identity> <dbserver>KRISTA2</server> <database>orwb </database> <dbversion>1.7.0</dbversion> <spversion>1.7.0</spversion> <defdataversion>1.7.0</defdataversion> <dbmsname>oracle</dbmsname> <dbmsversion>09.02.0000 Oracle9i Enterprise Edition Release 9.2.0.1.0</dbmsversion> <provider>MSDAORA.DLL</provider> </response> The XML response will be formatted as follows if the call is unsuccessful: <?xml version="1.0"?> <response> <result>-1</result> <error> <desc>No more licenses available for this client type</desc> </error> </response>

StartBGSession Method
Purpose To start a background session for the background service or the Factory Connector without requiring a user to login after creating the session. The active user for the session is instead obtained from the preconfigured system attribute for this purpose. Checks that a license of this type is available and if so uses it for this session. Syntax StartBGSession (client_type, client_address, reqd_events) Parameters Part
2004 CIMNET Inc

Description
www.CimnetInc.com

30

client_type

Required. By Value. A long specifying the client type : valid values are Factory Connector = 39, Background service = 53. For Configurator, Supervisor, Operator, Manager use method StartSession() instead. Optional. By Value. A variant (string) specifying the clients callback address for event notifications from the middleware. (for future implementation) Optional. By Value. An XML encoded variant (string) specifying for which events the client wishes to receive event notifications from the middleware. (for future implementation)

client_address

reqd_events

Returns A long >= 0 specifying the system generated session_id if successful. Throws an exception with an appropriate description if unsuccessful or if no licenses are available. Remarks If the client type is Background service then this method will first call the KillStaleSessions() method before attempting to create the new session. This will take care of the case of the computer that is running the background service being switched off instead of doing a normal shutdown, which would bypass the termination code that would have ended the session normally and so free up the license for the background service. The method then checks the encrypted license file to find out how many licenses of the given type are available, and then based on how many of these client type licenses are currently used it checks out or refuses this request for a license. If successful it inserts an entry into session table and generates a unique session_id that is used to track this session in the future. The client needs to store this session ID for future calls. An appropriate error description is returned when the exception is thrown if no further licenses of this client_type are available. The background service or Factory Connector will log entries into the eventlog to allow the user to track down these errors. The user_id field in the session table for this new row is automatically populated from the system attribute user_id for background tasks which avoids the need for a user to login to these sessions. This allows audit trails to operate as normal with transactions initiated by these background applications. The client_address and reqd_events fields are for future implementation only, and are currently saved to the database but ignored thereafter. Stored Procedure(s) Used sp_I_Session_BG (?) Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>session</object> <msgtype>exec</msgtype> <cmd>StartBGSession</cmd> <client_type>53</client_type> <client_address></client_address>
2004 CIMNET Inc

www.CimnetInc.com

31

<reqd_events></reqd_events> </request> The XML response will be formatted as follows if the call is successful: <?xml version="1.0"?> <response> <result>0</result> <identity>1</identity> </response> The XML response will be formatted as follows if the call is unsuccessful: <?xml version="1.0"?> <response> <result>-1</result> <error> <desc>No more licenses available for this client type</desc> </error> </response>

EndSession Method
Purpose To end an active session and logoff any users that may be logged onto entities within this session if they have not already logged off manually. Syntax EndSession (session_id) Parameters Part session_id Returns A long = 0 if successful. Throws an exception with an appropriate description if unsuccessful. Remarks Logs out all users from all entities using this session_id (Operator only) and then ends the session. Deletes all rows in session and ent_logon table for this session_id. An appropriate error description is returned if the call fails. Stored Procedure(s) Used sp_D_Session Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>session</object> <msgtype>exec</msgtype>
2004 CIMNET Inc

Description Required. By Value. A long to identify the active session.

www.CimnetInc.com

32

<cmd>EndSession</cmd> <session_id>1</session_id> </request> The XML response will be formatted as follows if the call is successful: <?xml version="1.0"?> <response> <result>0</result> </response> The XML response will be formatted as follows if the call is unsuccessful: <?xml version="1.0"?> <response> <result>-1</result> <error> <desc>Specified Session does not exist</desc> </error> </response>

LogIn Method
Purpose To authenticate a user and if successful log him / her into a session. Validates the user and password and if successful makes this user the active user on this session. Syntax LogIn (session_id, user_id, user_pw) Parameters Part session_id Description Required. By Value. A long identifying the session which must already have been created. Required. By Reference. A string identifying the user_id logging into the session. If empty and the unique passwords global option is set then on success this parameter is populated with the user_id corresponding to the specified password so that it can be tracked by the client application. Required. By Value. A string specifying the password for the given user that will be compared to the encrypted password stored in the database.

user_id

user_pw

Returns A long = 0 if successful. Throws an exception with an appropriate description if unsuccessful. Remarks This Login is required for ALL client applications, including Operator. Operator users have to ADDITIONALLY log on to the entities that they are controlling. The session_id parameter must identify a session that currently exists (created with the StartSession
2004 CIMNET Inc

www.CimnetInc.com

33

method). The minimum password length is set by a system parameter If this user does not have the required privilege to run this application then an error is returned. The session is not terminated in case the client application lets returns to the Login option. In the unique passwords case the user_id input parameter should be set to the empty string . The user_id corresponding to the unique password is returned as a By Ref parameter. In this case the system will prevent any 2 users from saving the same password If the Login is successful then this user becomes the active user for the session (saved as the user_id field in the session table). For Operator clients any additional users of the same session also need to login to the session using this method. An appropriate error description is returned if the authentication fails or if the specified session does not exist. Stored Procedure(s) Used sp_U_Session_SwitchUser Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>session</object> <msgtype>exec</msgtype> <cmd>Login</cmd> <session_id>1</session_id> <user_id>111</user_id> <user_pw>abc</user_pw> </request> The XML response will be formatted as follows if the call is successful: <?xml version="1.0"?> <response> <result>0</result> <user_id>111</user_id> </response> The XML response will be formatted as follows if the call is unsuccessful: <?xml version="1.0"?> <response> <result>-1</result> <error> <desc>Invalid user_id or password</desc> </error> </response>

RefreshHeartbeat Method
Purpose To refresh the heartbeat of an active session to avoid it being terminated automatically.
2004 CIMNET Inc

www.CimnetInc.com

34

Syntax RefreshHeartbeat (session_id) Parameters Part session_id Returns A long = 0 if successful. Throws an exception with an appropriate description if unsuccessful. Remarks Updates the heartbeat field in the session table to the current datetime according to the clock on the database server. An appropriate error description is returned if the call fails. Stored Procedure(s) Used sp_U_Session_Heartbeat Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>session</object> <msgtype>exec</msgtype> <cmd>RefreshHeartbeat</cmd> <session_id>1</session_id> </request> The XML response will be formatted as follows if the call is successful: <?xml version="1.0"?> <response> <result>0</result> </response> The XML response will be formatted as follows if the call is unsuccessful: <?xml version="1.0"?> <response> <result>-1</result> <error> <desc>Specified Session does not exist</desc> </error> </response> Description Required. By Value. A long to identify the active session.

SwitchUser Method
Purpose To change the active user of a session. Syntax
2004 CIMNET Inc

www.CimnetInc.com

35

SwitchUser (session_id, user_id, user_pw) Parameters Part session_id user_id Description Required. By Value. A long to identify the active session. Required. By Value. A string identifying the new active user_id of the session. This user must already have logged into the session and at least one entity. Optional. By Value. A variant (string) specifying the password for the given user that will be compared to the encrypted password stored in the database. If the system parameter Password required for SwitchUser is set then this parameter is required every time SwitchUser is invoked.

user_pw

Returns A long = 0 if successful. Throws an exception with an appropriate description if unsuccessful. Remarks Changes the active user in session table. Most commonly used with Operator clients but if the password is included it could be used for other client applications to change the current user_id on the session if the authentication is successful. For Operator clients if the user_pw parameter is included authentication will always be performed. This prevents switching user without password authentication for those sites that wish to operate this way. If the user_pw parameter is NOT included then this user must already have logged onto at least one entity at this time, otherwise he should use the LogIn() method and then log onto some entities. In the unique passwords case the client application should have saved the user_id value after the initial logon, and this user_id value should be included in all calls to SwitchUser(). This method has no effect on the labor capture module if it is licensed as all users are still logged in and labor hours are being captured against them. This method replaces the current ent.SwitchUser() method. An appropriate error description is returned if the call fails. Stored Procedure(s) Used sp_U_Session_SwitchUser Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>session</object> <msgtype>exec</msgtype> <cmd>SwitchUser</cmd> <session_id>1</session_id> <user_id>222</user_id> <user_pw>def</user_pw> </request>
2004 CIMNET Inc

www.CimnetInc.com

36

The XML response will be formatted as follows if the call is successful: <?xml version="1.0"?> <response> <result>0</result> </response> The XML response will be formatted as follows if the call is unsuccessful: <?xml version="1.0"?> <response> <result>-1</result> <error> <desc>A password is required to initially log this user into this session</desc> </error> </response>

LogOnEnt Method
Purpose To log the active user onto a specific entity within a session. Syntax LogOnEnt (session_id, user_id, ent_id, cur_lab_cd, cur_dept_id, pct_lab_to_apply, logon_time) Parameters Part session_id user_id Description Required. By Value. A long to identify the active session. Required. By Value. A string identifying the user_id to be logged on. Required. By Value. A long to specify which entity is being logged onto. Optional. By Value. A variant (string) to specify the labor code to be used for this entry. Defaults to null which means that labor data is not collected. Optional. By Value. A variant (string) to specify the dept id to be used for this entry. Defaults to null which means that labor data is not collected. Optional. By Value. A variant (double) to specify the percentage of labor hours to be applied to this entry. Defaults to 100% if the labor code is included, else null. Optional. By Value. A variant (datetime) to specify the actual time the logon took place. Defaults to Now. This is useful when importing logon data from external timekeeping systems.

ent_id

cur_lab_cd

cur_dept_id

pct_lab_to_apply

logon_time

2004 CIMNET Inc

www.CimnetInc.com

37

Returns A long = 0 if successful. Throws an exception with an appropriate description if unsuccessful. Remarks This user must be the current active user on the session, achieved by Starting the session or using SwitchUser() to become the active user on the session, otherwise an exception is thrown. On success inserts an entry into ent_logon table. This method replaces the existing ent.Login() method. If the Labor Collection module is licensed then an entry will also be made in the labor_usage table. If the current user already has any active entries in labor_usage (determined by the active flag) then those entries will be closed off (ie. their durations updated) and new entries will be created for all these entries with appropriate pct_to_apply splitting percentages. An appropriate error description is returned if the call fails. If the optional logon_time parameter is included it must be before the current time, otherwise the current time will be used instead. If a valid logon_time is included then all logon and labor tracking data will be based on this specified time. Stored Procedure(s) Used sp_I_Ent_Logon Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>session</object> <msgtype>exec</msgtype> <cmd>LogOnEnt</cmd> <session_id>1</session_id> <user_id>222</user_id> <ent_id>1</ent_id> <cur_lab_cd></cur_lab_cd> <cur_dept_id></cur_dept_id> <pct_lab_to_apply></pct_lab_to_apply> <logon_time></logon_time> </request> The XML response will be formatted as follows if the call is successful: <?xml version="1.0"?> <response> <result>0</result> </response> The XML response will be formatted as follows if the call is unsuccessful: <?xml version="1.0"?> <response> <result>-1</result> <error> <desc>This user is not the active user on this session</desc> </error> </response>
2004 CIMNET Inc

www.CimnetInc.com

38

LogOnEntList Method
Purpose To log the active user within a session onto his default or last saved entities, or onto a specified list of entities. Syntax LogOnEntList (session_id, user_id, list_id, ent_list) Parameters Part session_id user_id list_id Description Required. By Value. A long to identify the active session. Required. By Value. A string identifying the user_id to be logged on. Optional. By Value. A variant (string) to specify which predefined list to use. Valid predefined lists are Default and Last Used (case insensitive). Defaults to the Default list. A value = Custom requires the ent_list parameter as detailed below. Optional. By Value. An XML variant (string) to specify the custom entity list in XML format as detailed in the example below. Note that the ent_id (required), cur_lab_cd (optional) and pct_lab_to_apply (optional) values are included as attributes of any number of <ent> tags. If accessed via ExecuteXMLCmd() it is possible to pass the entire XML command string for this parameter which is more convenient than having to extract the relevant XML fragment only.

ent_list

Returns An XML string detailing success or failure and which entities have been successfully logged into. Remarks This user must be the current active user on the session, achieved by Starting the session or using SwitchUser() to become the active user on the session. The entity lists and the cur_lab_cd and pct_lab_to_apply values for each entity in the list are saved in the ui_config table and are retrieved from there for this purpose. If logging on from a predefined list then all current entities this user is first logged off any entities he may currently be logged onto for this session. If specifying a custom list then this method attempts to logon to the listed entities WITHOUT first logging the user off any entities he may currently be logged onto for this session. This allows the client application to incrementally logon to groups of entities for a given user if required. The method inserts appropriate entries into the ent_logon table one row per entity in the list. If the Certification option is licensed and an entity that already has a job running is logged onto, then the certification check to see that this user can run this job is performed. An error is returned if this user is not certified to run this job. If the optional logon_time attribute is included in a custom logon list then its value must be before the current time, otherwise the current time will be used instead. If a valid logon_time is included then all logon and labor tracking data will be based on this specified time. 39

2004 CIMNET Inc

www.CimnetInc.com

An appropriate error description is returned if the call fails. Stored Procedure(s) Used sp_I_Ent_Logon_FromSavedList if from a saved list sp_I_Ent_Logon for each entity if from a custom list Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: This example uses the predefined last saved list. <?xml version="1.0"?> <request> <object>session</object> <msgtype>exec</msgtype> <cmd>LogonEntList</cmd> <session_id>1</session_id> <user_id>333</user_id> <list_id>last saved</list_id> </request> This example specifies a custom list of entities. <?xml version="1.0"?> <request> <object>session</object> <msgtype>exec</msgtype> <cmd>LogonEntList</cmd> <session_id>1</session_id> <user_id>333</user_id> <list_id>custom</list_id> <ent_list> <ent ent_id="1" cur_lab_cd="123" cur_dept_id=111 pct_lab_to_apply="50"/> <ent ent_id="11" cur_lab_cd="123" cur_dept_id=222 pct_lab_to_apply="50" logon_time=6/6/2002 12:30PM/> <ent ent_id="12"/> </ent_list> </request> The XML response will be formatted as follows if the call is successful: <?xml version="1.0"?> <response> <result>0</result> <ent_list> <ent_id>1</ent_id> <ent_id>11</ent_id> <ent_id>12</ent_id> </ent_list> </response> The XML response will be formatted as follows if the call is unsuccessful: <?xml version="1.0"?>
2004 CIMNET Inc

www.CimnetInc.com

40

<response> <result>-1</result> <error> <desc>This user is not the active user on this session</desc> </error> </response>

SaveEntList Method
Purpose To save the current entities logged onto by the specified user and session as the users default or last saved entity list. Syntax SaveEntList (session_id, user_id, list_id) Parameters Part session_id user_id Description Required. By Value. A long to identify the active session. Required. By Value. A string identifying the user_id currently logged onto at least one entity. Optional. By Value. A variant (string) to specify which list ID to save to. Typical values are Default and Last Used (case insensitive). Defaults to the Default list.

list_id

Returns A long >= 0 if successful = number of entries saved in this list after the save. Throws an exception with an appropriate description if unsuccessful. Remarks This user must have already logged onto at least one entity within this session, otherwise an exception is thrown. The entity lists and the cur_lab_cd and pct_lab_to_apply values for each entity in the list are saved in the ui_config table. An appropriate error description is returned if the call fails. Stored Procedure(s) Used sp_U_Session_SaveList Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>session</object> <msgtype>exec</msgtype> <cmd>SaveEntList</cmd>
2004 CIMNET Inc

www.CimnetInc.com

41

<session_id>1</session_id> <user_id>333</user_id> <list_id>default</list_id> </request> The XML response will be formatted as follows if the call is successful: <?xml version="1.0"?> <response> <result>0</result> <numrows>5</numrows> </response> The XML response will be formatted as follows if the call is unsuccessful: <?xml version="1.0"?> <response> <result>-1</result> <error> <desc>This user is not currently logged onto any entities in this session</desc> </error> </response>

LogOff Method
Purpose To allow a user to logoff a specific entity or all entities that he is logged onto within a session. Syntax LogOff (session_id, user_id, ent_id, logoff_time) Parameters Part session_id user_id ent_id Description Required. By Value. A long to identify the active session. Required. By Value. A string identifying the user_id to be logged on. Optional. By Value. A variant (long) to specify which entity list to log off. Defaults to ALL entities this user is currently logged onto within this session. Optional. By Value. A variant (datetime) to specify the actual time the logoff took place. Defaults to Now. This is useful when importing logoff data from external timekeeping systems.

logoff_time

Returns A long = 0 if successful. Throws an exception with an appropriate description if unsuccessful. Remarks Removes relevant entries from the ent_logon table. If ent_id is excluded then log this user off all entities he may be logged onto. If ent_id is specified then only log him off the specified entity.
2004 CIMNET Inc

www.CimnetInc.com

42

Note: this user may still be the active user on this session even though he may no longer be logged onto any entities. Another user would need to SwitchUser or Login to become the active user on the session, or ending the session would obviously log the user out of the session. If the labor collection module is licensed this method also updates the durations and closes off the relevant entries in the labor_usage table. If the optional logoff_time parameter is included then its value must be before the current time, otherwise the current time will be used instead. If a valid logoff_time is included then all labor tracking data will be based on this specified time. An appropriate error description is returned if the call fails. Stored Procedure(s) Used sp_D_Ent_Logon Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>session</object> <msgtype>exec</msgtype> <cmd>LogOff</cmd> <session_id>1</session_id> <user_id>111</user_id> <ent_id></ent_id> <logoff_time></logoff_time> </request> The XML response will be formatted as follows if the call is successful: <?xml version="1.0"?> <response> <result>0</result> </response> The XML response will be formatted as follows if the call is unsuccessful: <?xml version="1.0"?> <response> <result>-1</result> <error> <desc>This user is not logged onto any entities in this session</desc> </error> </response>

KillStaleSessions Method
Purpose To terminate any sessions that have not been refreshed for a period of time, eg when a client application terminates abnormally. Syntax KillStaleSessions (min_limit)
2004 CIMNET Inc

www.CimnetInc.com

43

Parameters Part min_limit Description Optional. By Value. A variant (integer) specifying the threshold number of minutes within which all sessions should have been refreshed to prevent being killed. Defaults to 10, minimum value = 2

Returns A long >= 0 if successful = number of sessions terminated. Throws an exception with an appropriate description if unsuccessful. Remarks Deletes all sessions where the last_heartbeat value is more than the specified number of minutes old. All sessions that are deleted will also have all entity logons terminated. Stored Procedure(s) Used sp_D_Session_KillStaleSessions Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>session</object> <msgtype>exec</msgtype> <cmd>KillStaleSessions</cmd> <min_limit>10</min_limit> </request> The XML response will be formatted as follows if the call is successful: <?xml version="1.0"?> <response> <result>0</result> </response> The XML response will be formatted as follows if the call is unsuccessful: <?xml version="1.0"?> <response> <result>-1</result> <error> <desc>Error description</desc> </error> </response>

GetSpecificRS Method
Purpose To retrieve a specific recordset relating to sessions, entity logons or saved entity logon lists from the database. This method has been modified slightly from the generic GetSpecificRS() method to protect data that we
2004 CIMNET Inc

www.CimnetInc.com

44

do not wish to easily expose and to make access easy to data that we do wish to expose. Syntax GetSpecificRS (cmd string, XMLRequest string) Parameters Part cmd Description Required. By Value. A string containing the name of the custom method to use ie. GetSessions, GetEntLogons or GetEntLogonList Required. By Value. Dependent on the specific method to be invoked.

XMLRequest

Returns ADODB.Recordset containing the specific recordset. The recordset will be disconnected from the database and will be Client side and Static. The lock will be set to adLockBatchOptimistic. The recordsets field names will correspond to the tables column names as defined by the session, ent_logon or ent_logon_list tables in the database. Remarks Possible values for the cmd parameter and the available filters for each of them are given in the XML examples below: Stored Procedure(s) Used Delegates to appropriate Getxxxx() methods that each use specific Stored Procedures. Examples This request will return all sessions optionally filtered by session, active user and / or client_type. <?xml version="1.0"?> <request> <object>session</object> <msgtype>getspec</msgtype> <cmd>GetSessions</cmd> <schema></schema> <session_id></session_id> <client_type>3</client_type> <user_id></user_id> </request> This request will return all entity logons optionally filtered by session, user and / or entity. <?xml version="1.0"?> <request> <object>session</object> <msgtype>getspec</msgtype> <cmd>GetEntLogons</cmd> <schema></schema> <session_id></session_id>
2004 CIMNET Inc

www.CimnetInc.com

45

<ent_id></ent_id> <user_id></user_id> </request> This request will return all saved entity logon lists optionally filtered by user, list_id and / or entity. <?xml version="1.0"?> <request> <object>session</object> <msgtype>getspec</msgtype> <cmd>GetEntLogonList</cmd> <schema></schema> <user_id></user_id> <list_id>default</list_id> <ent_id></ent_id> </request>

GetModulesLicensed Method
Purpose
Returns an XML string detailing which modules (options) of the product have been licensed.

Syntax GetLicenseInfo () Parameters None Returns XML String in the following format indicating the maximum number of concurrent sessions allowed of each type and with a 0 or 1 indicating whether the functional option is licensed or not: <?xml version="1.0"?> <license_info> <concurrent_sessions> <configurator>1</configurator> <supervisor>2</supervisor> <operator>10</manager> <manager>20</manager> <tagengine>1</tagengine> <dataeditor>11</dataeditor> <reportdesigner>12</reportdesigner> <scheduler>13</scheduler> <utilizationentities>100</utilizationentities> <dncseats>25</dncseats> </concurrent_sessions> <functional_modules> <baseprod>1</baseprod>
2004 CIMNET Inc

www.CimnetInc.com

46

<enprod>1</enprod> <folders>1</folders> <dnc>1</dnc> <util>1</util> <labor>1</labor> <cert>1</cert> <cust>1</cust> <specs>1</specs> <steps>1</steps> <dataexchanger>1</dataexchanger> <inventory>1</inventory> <datalogging>1</datalogging> <forms>1</forms> <spc>1</spc> <audittriggers>0</audittriggers> </functional_modules> </license_info> Remarks The licensed options are stored in an encrypted Cimnet license file is created for every customer.

SwitchSession Method
Purpose To allow an authenticated user to switch to a different active session. Syntax SwitchSession (new_session_id, user_id, user_pw) Parameters Part new_session_id Description Required. By Value. A long to identify the session TO WHICH the user wants to switch. Required. By Value. A string identifying the user_id to switch. This user must already have logged into an existing session and thus be authenticated. Optional. By Value. A variant (string) specifying the password to authenticate the user. If the system parameter Password required for SwitchSession is set then this parameter is required every time SwitchSession is invoked. (Not implemented yet)

user_id

user_pw

Returns A long = 0 if successful. Throws an exception with an appropriate description if unsuccessful. Remarks

2004 CIMNET Inc

www.CimnetInc.com

47

The purpose of this method is to allow a user to easily use a different computer (and thus session) to enter data for all the entities he may already have logged onto from a different computer. This feature is only applicable from Operator clients This user must already have logged onto at least one session at this time and have logged onto at least one entity. The user remains logged onto all the entities that he / she was previously logged onto but they are now all listed under the new session. The current user on all sessions is left unchanged. If the user_pw parameter is included authentication will always be performed. This prevents switching sessions without password authentication for those sites that wish to operate this way. In the unique passwords case there is no way for the new session to know the existing user_id on the other session, so the user_pw field MUST be included each time and the user_id parameter must be the empty string. This method has no effect on the labor capture module if it is licensed as all users are still logged in and labor hours are being captured against them. An appropriate error description is returned if the call fails. Stored Procedure(s) Used sp_U_Session_SwitchSession Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>session</object> <msgtype>exec</msgtype> <cmd>SwitchSession</cmd> <session_id>2</session_id> <user_id>222</user_id> <user_pw> </user_pw> </request> The XML response will be formatted as follows if the call is successful: <?xml version="1.0"?> <response> <result>0</result> </response> The XML response will be formatted as follows if the call is unsuccessful: <?xml version="1.0"?> <response> <result>-1</result> <error> <desc>This user is not logged into any existing sessions</desc> </error> </response>

DoMinutelyTasks Method
Purpose
2004 CIMNET Inc

www.CimnetInc.com

48

To process background tasks that need to be performed every minute. Syntax DoMinutelyTasks (session_id) Parameters Part session_id Returns An integer = 0 if successful. Logs an with with an appropriate description if unsuccessful. Remarks This method is called by the background service every minute. It performs the following checks: 1. Update durations of all current events in the util_log table 2. Purge all sessions that have not had their heartbeats refreshed for 10 minutes 3. For each running job update the estimated finish time field based on quantity produced so far and the estimated production rate. (Number of batches to complete = (qty_reqd qty_prod) / batch_size rounded up to next integer. Time to Complete = Number of batches to complete * ext_prod_rate. Sched_Finish_Time = Now + Time to Complete) 4. Recalculate and update the OEE KPIs. Stored Procedure(s) Used sp_BG_Minutely_Tasks Access via Director.cls using ExecuteXMLCmd() Yes. Included for testing purposes as the service usually resides on the same computer as the middleware. <?xml version="1.0"?> <request> <object>session</object> <msgtype>exec</msgtype> <cmd>DoMinutelyTasks</cmd> </request> Description Required. By Value. A long to identify the active session.

DoAutoShiftChanges Method
Purpose Performs an automatic shift change every minute. Syntax DoAutoShiftChanges(session_id) Parameters Part session_id Returns
2004 CIMNET Inc

Description Required. By Value. A long to identify the active session.

www.CimnetInc.com

49

An integer = 0 if successful. Logs an with with an appropriate description if unsuccessful. Remarks This method is called by the background service every minute. It performs the automatic shift changes Stored Procedure(s) Used N/a Access via Director.cls using ExecuteXMLCmd() Yes. Included for testing purposes as the service usually resides on the same computer as the middleware. <?xml version="1.0"?> <request> <object>session</object> <msgtype>exec</msgtype> <cmd>DoAutoShiftChanges</cmd> <session_id>1212</session_id> </request>

DoHourlyTasks Method
Purpose To process background tasks that need to be performed every hour. Syntax DoHourlyTasks (session_id) Parameters Part session_id Returns An integer = 0 if successful. Logs an with with an appropriate description if unsuccessful. Remarks This method is called by the background service every minute. It performs the following checks: 1. Delete inventory data where the qty_left value <= 0 based on the corresponding system attribute settings concerning inventory constraints. 2. ? Stored Procedure(s) Used sp_BG_Hourly_Tasks Access via Director.cls using ExecuteXMLCmd() Yes. Included for testing purposes as the service usually resides on the same computer as the middleware. <?xml version="1.0"?> <request> <object>session</object> <msgtype>exec</msgtype> <cmd>DoHourlyTasks</cmd> </request>
2004 CIMNET Inc

Description Required. By Value. A long to identify the active session.

www.CimnetInc.com

50

DoDailyTasks Method
Purpose To process background tasks that need to be performed every day. Syntax DoDailyTasks (session_id) Parameters Part session_id Returns An integer = 0 if successful. Logs an with with an appropriate description if unsuccessful. Remarks This method is called by the background service every minute. It performs the following checks: 1. Purges all historical data older than the configured system attribute value of how long to keep old data. Stored Procedure(s) Used sp_BG_Daily_Tasks Access via Director.cls using ExecuteXMLCmd() Yes. Included for testing purposes as the service usually resides on the same computer as the middleware. <?xml version="1.0"?> <request> <object>session</object> <msgtype>exec</msgtype> <cmd>DoDailyTasks</cmd> </request> Description Required. By Value. A long to identify the active session.

GetServerTime Method
Purpose Called to return the current date and time on the database server. Used by clients to synchronize clocks Syntax GetServerTime () Returns Datetime value for current date and time on the database server. Remarks A stored procedure is used to return the current datetime on the database server instead of just returning the time on the computer on which the middleware is running -in case they are running on different computers. Stored Procedure(s) Used sp_S_GetServerTime
2004 CIMNET Inc

www.CimnetInc.com

51

Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>session</object> <msgtype>Exec</msgtype> <cmd>GetServerTime</cmd> </request>

The XML response will include the time in the system specified format. SetMwDbUser Method
Purpose Sets the db_status mw_db_user field used by audit trails based on the current DB connection. Syntax SetMwDbUser (session_id) Parameters Part session_id Returns Description Required. By Value. A long to identify the client session from which the request is being made.

A long = 0 for success or 1 for failure.


Remarks This value allows the audit trail code to distinguish between Factelligence users and external users. It is called when the background service starts up to set this value for future comparisons. If the database login used by the middleware is changed at any time then this method needs to be called (or alternatively the background service can be restarted) Stored Procedure(s) Used None Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted as follows: <?xml version="1.0"?> <request> <object>session</object> <msgtype>Exec</msgtype> <cmd>SetMwDbUser</cmd> <session_id>111</session_id> </request>
2004 CIMNET Inc

www.CimnetInc.com

52

GetVerInfo Method
Purpose To return database and version information to client applications for display and possible validation checks. Syntax GetVerInfo (session_id) Parameters Part session_id Returns An XML formatted string containing this information in the following format: <?xml version="1.0"?> <response> <dbserver>Krista2</server> <database>Fact17</database> <dbversion>1.7.0</dbversion> <spversion>1.7.0</spversion> <defdataversion>1.7.0</defdataversion> <dbmsname>Microsoft SQL Server</dbmsname> <dbmsversion>08.00.0534</dbmsversion> <provider>sqloledb.dll</provider> </response> Remarks Used to display database information on About dialogs and also for client applications to test for specific versions of Stored Procedures / Triggers or default data scripts that include data such as new language strings or Operator buttons. This data is also returned with the response to a StartSession() request. Stored Procedure(s) Used sp_S_Db_Status Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted as follows: <?xml version="1.0"?> <request> <object>session</object> <msgtype>Exec</msgtype> <cmd>GetVerInfo</cmd> <session_id>111</session_id>
2004 CIMNET Inc

Description Required. By Value. A long to identify the client session from which the request is being made.

www.CimnetInc.com

53

</request>

ValidPw Method
Purpose To check whether the supplied user and password is valid Syntax ValidPw (user_id, user_pw) Parameters Part user_id user_pw Returns 0 if successful. Throws an exception with an appropriate description if unsuccessful. Remarks Used to check the user_id and password against the database. Throws an appropriate error message if either one of the parameters fails. Stored Procedure(s) Used None Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1: <?xml version="1.0"?> <request> <object>session</object> <msgtype>Exec</msgtype> <cmd>validpw</cmd> <user_id>111</user_id> <user_pw>111</user_pw> </request> Description Required. By Value. A string to identify the user id Required. By Value. A string to identify the users password

Ent Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: cur_shift_id, cur_shift_start_time, last_domain_change, tree_icon, flow_diag_image, last_edit_comment www.CimnetInc.com

2004 CIMNET Inc

54

GetAllbyXML()

The following columns are NOT available as filters: cur_shift_id, cur_shift_start_time, last_domain_change, tree_icon, flow_diag_image, last_edit_comment

GetByKey() GetSpecificRS() Retrieval of the following specific recordsets are supported: GetStatusInfo(). Available filters are: ent_id, child_levels GetStatusInfoByUser(). Available filters are: session_id, user_id GetShiftSched(). Available filters are: ent_id, start_date, end_date GetAllTopLevel(). RefreshShiftSched(). Parameters are: session_id, ent_id, days_ahead GetRefreshedShiftSched(). Parameters are: session_id, ent_id, start_date, days_ahead Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS StartShift() DoAutoShiftChanges() DoPastShiftChanges() Clone() GetAll_TopLevel() GetStatusInfo() COMMENTS To start a new shift on a given entity and all its descendants that inherit the same schedule. To do automatic shift changes in the background. To do automatic shift changes in the background for shifts that may have been missed as the background service was not running. To clone an entity and all its dependent data. To return all top level entities as defined by the physical hierarchy. To return a recordset of all current status information for a given entity (and optionally its children entities). Note: As from V1.5 multiple running jobs may be returned for a single entity (with different job_pos values). To return a recordset of all current status information for a given entity that a given user is currently controlling. Note: As from V1.5 multiple running jobs may be returned for a single entity (with different job_pos values). To refresh the consolidated shift schedule for a given entity (or all entities that have can schedule shifts) for a specified number of days into the future. Take into account the shift schedule and exceptions. Returns a recordset with all the shifts between specified time limits after applying the exceptions. Return RS of shift schedule for a given ent_id. If this ent has no sched defined find 1st ancestor that does have. Also take into account shift exceptions from shift_exc table. Returns the number of hours of schedule shift time (counting non null shifts only) for a given entity between 2 specified dates. (not implemented yet). To calculate the datetime a specified number of active hours after a specified current time, taking into account only active shift www.CimnetInc.com

GetStatusInfoByUser()

RefreshShiftSched ()

GetRefreshedShiftSched () GetShiftSched ()

GetAvailShiftTime() GetAvailEndTime()

2004 CIMNET Inc

55

schedules on a given entity.

GetAll_TopLevel Method
Purpose To return all entities that are at the top level in the hierarchy (ie. their default parent_ent_id is Null). Syntax GetAll_TopLevel () Returns ADODB.recordset. Remarks All columns from the ent table are included in the recordset as in the standard GetAll() method. This method is required as the standard GetAll() method does not allow an optional parameter of null as that is the default value for optional parameters that are not included. Stored Procedure(s) Used sp_SA_Ent_GetTopLevelEnts Access via Director.cls using GetSpecificRS() Yes. The XML input parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>ent</object> <msgtype>GetSpec</msgtype> <cmd>GetAllTopLevel</cmd> </request>

Add Method
Purpose To add a new entity to the database. This is a standard method which has been enhanced as defined in the remarks section. Syntax Add (session_id, ent_name, description, parent_ent_id, hourly_cost, can_sched_jobs, can_run_jobs, can_capture_util, can_capture_labor, can_do_dnc, can_track_oee, can_sched_shifts, can_store, can_log_data, can_ship, can_receive, cur_shift_id, cur_shift_start_time, last_domain_change, tree_icon, flow_diag_img, identical_job_execs, spare1, spare2, spare3, spare4, last_edit_comment, last_edit_at) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made.
www.CimnetInc.com

2004 CIMNET Inc

56

ent_name

Required. By Value. A string (max 80 chars) containing this entitys name. Optional. By Value. A string (max 80 chars) containing a description of this entity. Optional. By Value. An integer defining the hierarchy level of this entitys parent. Null for root entities. Optional. By Value. A float defining the cost of running this entity per hour. Required. By Value. A flag (1 = Yes) defining whether this entity can have Jobs scheduled to it Required. By Value. A flag (1 = Yes) defining whether this entity can run Jobs or not. Required. By Value. A flag (1 = Yes) defining whether this entity can capture Utilization data or not Required. By Value. A flag (1 = Yes) defining whether this entity can capture Labor data or not Required. By Value. A flag (1 = Yes) defining whether this entity can do DNC control or not Required. By Value. A flag (1 = Yes) defining whether this entity can track Overall Equipment Effectiveness (OEE) or not. Required. By Value. A flag (1 = Yes) defining whether this entity allows shift scheduling or not Required. By Value. A flag (1 = Yes) defining whether this entity can maintain inventory / storage data or not Required. By Value. A flag (1 = Yes) defining whether this entity can log specific process data or not. Required. By Value. A flag (1 = Yes) defining whether shipments can be made from this entity or not. Required. By Value. A flag (1 = Yes) defining whether materials can be received by this entity or not. Optional. By Value. Current shift_id running on this entity. Optional. By Value. Datetime that the current shift started on this entity. Optional. By Value. Datetime that the last domain change
www.CimnetInc.com

description

parent_ent_id

hourly_cost

can_sched_jobs

can_run_jobs

can_capture_util

can_capture_labor

can_do_dnc

can_track_oee

can_sched_shifts

can_store

can_log_data

can_ship

can_receive

cur_shift_id cur_shift_start_time

last_domain_change
2004 CIMNET Inc

57

occurred on this entity. (See manual for definition of domains) tree_icon Optional. By Value. A string defining a path and filename to be used as an image (BMP or GIF file) for this entity in the hierarchy treeviews. Optional. By Value. A string defining a path and filename to be used as an image (BMP or GIF file_ for this entity in the flow diagrams Optional. By Value. An integer defining the number of identical positions that can run independent jobs on this entity. Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to Null. Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to Null. Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to Null. Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to Null. Optional. By Value. A variant (string) to define why this record is required Optional. By Ref. A variant (datetime) returns the date and time of the creation of the current record

flow_diag_img

identical_job_execs

spare1

spare2

spare3

spare4

last_edit_comment

last_edit_at

Returns Long. Database assigned Identity value for the entity. Remarks This method also inserts a row into the grp_ent_link table for every group defined in the database with access_level defaulted = 0 for these insertions. If the parent_ent_id of this new entity is not null (ie. Not at top level of the hierarchy) then this method also adds a row in the ent_link table for this entity to define its parent. Stored Procedure(s) Used sp_I_Ent. The enhanced functionality is taken care of by additional code in this Stored Procedure.

Delete Method
Purpose To delete a given entity from the database. This is a standard method has been enhanced as defined in the remarks section.
2004 CIMNET Inc

www.CimnetInc.com

58

Syntax Delete (session_id, ent_id) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made.
Required. By Value. A long to identify the entity to be deleted.

ent_id Returns

Boolean. True if delete was successful, else false. Remarks This method also deletes all rows in other tables for this entity as defined by cascade deletes in the database. The delete Stored Procedure has also been modified to do the following which are not possible using standard database functionality: Delete All rows in the ent_link table where this entity is a parent or a child. Update all rows in the job_exec table to set the default to or from entities to null if they used this entity.

Stored Procedure(s) Used sp_D_Ent.

StartShift Method
Purpose To start (or end) a shift on a given entity. Syntax StartShift (session_id, ent_id, shift_id) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made. Required. By Value. A long to identify the entity on which to change shift. Required. By Value. A long to identify the shift_id to start on this entity.

ent_id

shift_id

Returns Integer. 0 if shift change was successful, else -1. Remarks


2004 CIMNET Inc

www.CimnetInc.com

59

The ent_id passed as a parameter has its shift changed even if it does not have its can_sched_shifts flag set as this allows a specific shift change on any entity. This method also cascades the shift start recursively to all this entitys children that do not have can_sched_shifts flag set (which implies they define their own shift schedule). As soon as a child entity DOES have the can_sched_shifts flag set then the cascading does NOT continue for any of that childs descendants. The cur_shift_id and cur_shift_start_time fields of the relevant rows of the ent table will be updated on successful completion of this method. To end the current shift use the null shift id (shift_id = 0) Stored Procedure(s) Used sp_U_Ent_StartShift Access via Director.cls using ExecuteXMLCmd() Yes. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>ent</object> <cmd>StartShift</cmd> <msgtype>exec</msgtype> <ent_id>1</ent_id> <shift_id>2</shift_id> </request>

GetStatusInfo Method
Purpose To return all current status information for a given entity (and optionally its children entities) and return the data as a recordset. Syntax GetStatusInfo (ent_id, child_levels) Parameters Part ent_id Description Required. By Value. A long to identify the entity for which status data is required. Optional. By Value. A variant (long) to identify how many levels of child entities to include. Default = 0 which means data is only returned for the specified entity.

child_levels

Returns ADODB.recordset. Columns are initially but may be extended by changing the Stored procedure at any time. Remarks The returned recordset includes entity specific data related to the entity itself, the job it is currently
2004 CIMNET Inc

www.CimnetInc.com

60

running, many KPIs such as OEE etc, and many more which could be added for a specific application at runtime by enhancing the Stored Procedure. If the child_levels parameter is included and is > 0, then that many levels of children entities to the specified entity will be included in the returned data. This saves doing multiple calls to the middleware / database in many cases. Stored Procedure(s) Used sp_SA_Ent_GetStatus Access via Director.cls using GetSpecificRS() Yes. The XML input parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>ent</object> <cmd>GetStatusInfo</cmd> <msgtype>GetSpec</msgtype> <ent_id>1</ent_id> <child_levels>0</child_levels> </request>

GetStatusInfoByUser Method
Purpose To return all current job status information for all entities that a given user is currently logged into from a given session. Syntax GetStatusInfoByUser (session_id, user_id) Parameters Part session_id user_id Returns ADODB.recordset. Remarks The returned recordset includes entity specific data (includes the same columns as GetStatusInfo) related to the entity itself, the job it is currently running, many KPIs such as OEE etc, and many more which could be added for a specific application at runtime by enhancing the Stored Procedure. The entities which a current user is logged into is determined by the ent_logon table which is updated whenever an Operator user adds or removes an entity from his control within a session. Stored Procedure(s) Used sp_SA_ent_GetStatusByUser Access via Director.cls using GetSpecificRS()
2004 CIMNET Inc

Description Required. By Value. A long to identify the users session Required. By Value. A string to identify the user

www.CimnetInc.com

61

Yes. The XML input parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>ent</object> <msgtype>GetSpec</msgtype> <cmd>GetStatusInfoByUser</cmd> <session_id>123</session_id> <user_id>111</user_id> </request>

Clone Method
Purpose To clone an existing entity defined in the database, supplying a new name and optionally changing any of its other parameters. Syntax Clone (session_id, existing_ent_id, ent_name, ent_level, description, parent_ent_id, hourly_cost, can_sched_jobs, can_run_jobs, can_capture_util, can_capture_labor, can_do_dnc, can_track_oee, can_sched_shifts, can_store, can_log_data, can_ship, can_receive, cur_shift_id, cur_shift_start_time, last_domain_change, tree_icon, last_edit_comment) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made. Required. By Value. A long identifying the existing entity to be cloned. Required. By Value. A string (max 80 chars) containing this entitys name. Optional. By Value. A variant (long) defining the hierarchy level of the new entity. A level = 0 implies the top level or root of the hierarchy tree. Defaults to value of existing entity. Optional. By Value. A variant (string) (max 80 chars) containing a description of this entity. Defaults to value of existing entity. Optional. By Value. An variant (long) defining the the new entitys parent. Null for root entities. Defaults to all rows where the existing entity is a child. Optional. By Value. A variant (double) defining the cost of running this entity per hour. Defaults to value of existing 62

existing_ent_id

ent_name

ent_level

description

parent_ent_id

hourly_cost

2004 CIMNET Inc

www.CimnetInc.com

entity. can_sched_jobs Optional. By Value. A variant (boolean) (1 = Yes) defining whether this entity can have Jobs scheduled to it. Defaults to value of existing entity. Optional. By Value. A variant (boolean) (1 = Yes) defining whether this entity can run Jobs or not. Defaults to value of existing entity. Optional. By Value. A variant (boolean) (1 = Yes) defining whether this entity can capture Utilization data or not. Defaults to value of existing entity. Optional. By Value. A variant (boolean) (1 = Yes) defining whether this entity can capture Labor data or not. Defaults to value of existing entity. Optional. By Value. A variant (boolean) (1 = Yes) defining whether this entity can do DNC control or not. Defaults to value of existing entity. Optional. By Value. A variant (boolean) (1 = Yes) defining whether this entity can track Overall Equipment Effectiveness (OEE) or not. Defaults to value of existing entity. Optional. By Value. A variant (boolean) (1 = Yes) defining whether this entity allows shift scheduling or not. Defaults to value of existing entity. Optional. By Value. A variant (boolean) (1 = Yes) defining whether this entity can maintain inventory / storage data or not. Defaults to value of existing entity. Optional. By Value. A variant (boolean) (1 = Yes) defining whether this entity can log specific process data or not. Defaults to value of existing entity. Required. By Value. A flag (1 = Yes) defining whether shipments can be made from this entity or not. Required. By Value. A flag (1 = Yes) defining whether materials can be received by this entity or not. Optional. By Value. Current shift_id as a variant (long) running on this entity. Defaults to value of existing entity. Optional. By Value. A variant (Datetime) that the current shift started on this entity. Defaults to value of existing entity.
www.CimnetInc.com

can_run_jobs

can_capture_util

can_capture_labor

can_do_dnc

can_track_oee

can_sched_shifts

can_store

can_log_data

can_ship

can_receive

cur_shift_id

cur_shift_start_time

2004 CIMNET Inc

63

last_domain_change

Optional. By Value. A variant (Datetime) that the last domain change occurred on this entity. (See manual for definition of domains) Defaults to value of existing entity. Optional. By Value. A variant (string) defining a path and filename to be used as an image (BMP or GIF file) for this entity in the hierarchy treeviews. Defaults to value of existing entity. Optional. By Value. A variant (string) to define why record was changed

tree_icon

last_edit_comment

Returns Long. Database assigned Identity value for the new entity. Remarks If any data exists in the following tables it is also cloned (with the exception of current status data): ent_attr, shift_sched, shift_exc, grp_ent_link, ent_link, dir, job_exec, job_sched_exec, oee_exec, storage_exec, util_exec, util_raw_reas, util_reas_link, labor_exec, labor_raw_reas, labor_reas_link, dnc_exec If the parent_ent_id optional parameter is omitted then this method also clones ALL parent entities but NO child entities of the cloned entity. Passing a null (for a top level entity) or a long for the parent_ent_id creates a single parent entity as specified. So you either clone ALL parents or you specify a single one. Stored Procedure(s) Used sp_I_Ent_Clone. Access via Director.cls using ExecuteXMLCmd() No. Effects on the Database if successful Ent table: All fields for the cloned ent_id are copied unless otherwise specified in optional parameters. Ent_attr table: All rows (attr_id and attr_value fields) for the cloned ent_id are copied. Shift_sched table: If the can_sched_shifts flag is true then all rows for the cloned ent_id are copied. Shift_exc table: If the can_sched_shifts flag is true then all rows for the cloned ent_id are copied. Grp_ent_link table: All rows for the cloned ent_id are copied. Ent_link table: If the parent_ent_id optional parameter is included then this method adds a single row into the ent_link table for this entity to define its parent. If the parent_ent_id optional parameter is omitted then this method clones all rows in the ent_link table where the cloned entity is a child. Children of the cloned entity (ie rows in the ent_link table where the cloned entity is a parent) are NOT inherited in either of the above cases. Dir table: All rows for the cloned ent_id are copied. Job_exec table: If the can_run_jobs flag is true then all data is copied with the exception of the current status fields (cur_wo_id, cur_oper_id, cur_seq_no, cur_step_no, cur_step_start) which are set to NULL. Job_sched_exec table: If the can_sched_jobs flag is true then all data is copied. OEE_exec table: If the can_track_oee flag is true then all data is copied with the exception of the current value fields (current_perf, current_qual, current_oee) which are set to NULL. Item_reas_grp_ent_link table: All rows for the cloned ent_id are copied.
2004 CIMNET Inc

www.CimnetInc.com

64

Storage_exec table: If the can_store flag is true then all data is copied. Util_exec table: If the can_capture_util flag is true then all data is copied with the exception of the current status fields (cur_state_cd, cur_reas_cd, cur_reas_start, current_util) which are set to NULL. Util_raw_reas table: If the can_capture_util flag is true then all rows are copied. Util_reas_link table: If the can_capture_util flag is true then all rows are copied. Labor_exec table: If the can_capture_labor flag is true then all data is copied. Labor_raw_reas table: If the can_capture_labor flag is true then all rows are copied. Labor_reas_link table: If the can_capture_labor flag is true then all rows are copied. DNC_exec table: If the can_do_dnc flag is true then all data is copied.

RefreshShiftSched Method
Purpose To refresh the consolidated shift schedule for a given entity (or all entities that have can schedule shifts) for a specified number of days into the future. The schedule is built based on the shift_sched and shift_exc tables and the consolidated resultset is written to the shift_to_go table, and optionally returned as a recordset by reference. Syntax RefreshShiftSched (session_id, days_ahead, ent_id, shift_sched) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made. Optional. By Value. A variant (long) specifying the number of days into the future to prepare the consolidated schedule for. Defaults to 7 days. Optional. By Value. A variant (long) identifying a specific ent_id for which the shift schedule is required. Defaults to all entities with can_sched_shifts capability. Optional. By Reference. A variant (ADODB recordset) to be populated with the same resultset that is written to the shift_to_go table. Defaults to null.

days_ahead

ent_id

shift_sched

Returns Integer. 0 if successful, else -1. Remarks This method is called by the background service once per day and it can also be called explicitly after a user has edited the default shift schedule or any exceptions to it. This should only be done when the user closes a window after all changes have been entered, as it is a resource intensive task that need not be executed between multiple successive changes to the shift schedule. Only entities with the can_sched_shifts capability are allowed to define shift schedules. If the ent_id passed to this method does not have a shift schedule defined then the result is the same as if no ent_id
2004 CIMNET Inc

www.CimnetInc.com

65

was passed as a parameter: ie. the method processes the schedules for all entities that can_sched_shifts. Null shifts (where shift_id = 0) are NOT included in the resultset. Instead each valid shift has a shift_end time which is used to determine when the shift ends. Shift breaks are included as separate columns in each row, and are null values when no breaks apply. Stored Procedure(s) Used sp_U_Ent_RefreshShiftSched Access via Director.cls using ExecuteXMLCmd() Yes, but does not return a recordset by reference. Use the GetShiftSched method for this purpose. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>ent</object> <cmd>RefreshShiftSched</cmd> <days_ahead>14</days_ahead> <ent_id></ent_id> </request>

DoAutoShiftChanges Method
Purpose To perform automatic shift changes as specified by the consolidated shift schedule for a given entity (or all entities that can schedule shifts). Syntax DoAutoShiftChanges (session_id, ent_id) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made. Optional. By Value. A variant (long) identifying the ent_id for which the auto shift change schedule should be checked. Defaults to all entities with can_sched_shifts capability.

ent_id

Returns Integer. 0 if successful, else -1. Remarks This method is called by the background service every minute so there is usually no need for it to be called explicitly. If the ent_id passed to this method does not have a shift schedule defined then the result is the same as if no ent_id was passed as a parameter: ie. the method checks for automatic shift changes for all entities that can_sched_shifts. If a shift change is due for any of the entities then the StartShift method is called for each of them. Note that the StartShift method will change the shift recursively for all child entities that do not themselves
2004 CIMNET Inc

www.CimnetInc.com

66

have shift schedules defined. This method relies on the data in the shift_to_go table being populated correctly, which is in turn achieved by periodic calls to the RefreshShiftSched method by the background service. The method will also end shifts at the specified times and start the null shift if there is no subsequent valid shift scheduled. Stored Procedure(s) Used None calls StartShift method when required. Access via Director.cls using ExecuteXMLCmd() No.

GetShiftSched Method
Purpose To return the shift schedule for a given entity over a given time period. Syntax GetShiftSched (ent_id, start_date, end_date) Parameters Part ent_id Description Optional. By Value. A variant (long) identifying the ent_id for which the shift schedule is required. Defaults to all entities that can_sched_shifts. Optional. By Value. A variant (datetime) identifying the start of the required period. Defaults to current datetime. Optional. By Value. A variant (datetime) identifying the end of the required period. Defaults to return data for one week after the start date.

start_date

end_date

Returns ADODB.recordset. Columns are ent_id, start_time, end_time, shift_id, break1_startbreak3_end. Remarks This method performs the same function as the GetSched() method of the shift_sched class. It is included in the ent class as well for convenience, just renamed to distinguish it from other schedules that may apply to an entity. Only entities with the can_sched_shifts capability set are allowed to define shift schedules. If the ent_id passed to this method does not have a shift schedule defined then the method looks recursively to the default parent ent_id until a shift schedule is found. If none are defined the returned recordset will be empty. The returned recordset takes into account the exceptions to the default shift schedule as defined in the Shift_Exc table. Stored Procedure(s) Used sp_S_Shift_Sched_GetSched Access via Director.cls using GetSpecificRS() or GetSpecificRSasXML()
2004 CIMNET Inc

www.CimnetInc.com

67

Yes. Returns recordset as an ADO recordset which may be converted to XML format by Director if required. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>ent</object> <cmd>GetShiftSched</cmd> <ent_id>1</ent_id> <start_date>2001/01/01</start_date> <end_date>2001/01/08</end_date> </request>

GetAvailShiftTime Method
Purpose Returns the number of hours of scheduled shift time (counting non null shifts only) for a given entity between 2 specified dates. Syntax GetAvailShiftTime (ent_id, start_date, end_date) Parameters Part ent_id Description Required. By Value. A long to identify the entity on which to check the scheduled shift time. Required. By Value. A datetime to identify the start of the time period. Required. By Value. A datetime to identify the end of the time period.

start_date

end_date

Returns Double specifying the scheduled time in hours. -1 if invalid parameters or error. Remarks This method is useful when determining how long a job will take to perform on a given entity to calculate its estimated finish time or for scheduling purposes. Stored Procedure(s) Used sp_S_ent_GetAvailTime Access via Director.cls using ExecuteXMLCmd() Yes. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>ent</object> <cmd>GetAvailShiftTime</cmd>
2004 CIMNET Inc

www.CimnetInc.com

68

<ent_id>1</ent_id> <start_date>8/1/2001 8:30am</start_date> <end_date>8/8/2001 8:30am</end_date> </request>

GetAvailEndTime Method
Purpose To calculate the datetime a specified number of active hours after a specified time, taking into account only active shift schedules on a given entity. All time during idle shifts is ignored. Syntax GetAvailEndTime (session_id, ent_id, num_hours, start_time) Parameters Part session_Id ent_id Description Required. By Value. A long to identify the client session from which the request is being made. Required. By Value. A long to identify the entity on which the end time is being calculated. The entity may inherit a shift schedule if it does not have its own defined. Required. By Value. A double to specify the number of hours of work time to look ahead. Optional. By Value. A variant (datetime) to specify the start datetime. Defaults to Now.

num_hours start_time Returns Datetime. Remarks

If the specified entity does not have its own defined then it may inherit one from one of its ancestors. Throws an error if no valid shift schedule can be found. This method is used to estimate completion times that require a certain quantity of working minutes on an entity, eg. estimated job finish time. Stored Procedure(s) Used sp_S_Ent_GetAvailEndTime Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>ent</object> <msgtype>Exec</msgtype>
2004 CIMNET Inc

www.CimnetInc.com

69

<cmd>GetAvailEndTime</cmd> <session_id>111</session_id> <ent_id>1121</ent_id> <num_hours>24.6</num_hours> <start_time></start_time> </request>

GetRefreshedShiftSched Method
Purpose To calculate a consolidated shift schedule for a given entity (or all entities that have can schedule shifts) for the period specified by the start_date and specified number of days into the future. The schedule is built based on the shift_sched and shift_exc tables and the consolidated resultset is returned. Syntax GetRefreshedShiftSched (session_id, ent_id, start_date, days_ahead, name) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made. Optional. By Value. A variant (long) identifying a specific ent_id for which the shift schedule is required. Defaults to all entities with can_sched_shifts capability. Required. By Value. A varaiant (datetime) identifying the start of the required period. Optional. By Value. A variant (long) specifying the number of days into the future to prepare the consolidated schedule for. Defaults to 7 days. Optional. By Value. A variant (string) specifying the name of the table to read to get the shift exceptions. Defaults to null. If null, when eventually passed to private GetExceptions method in clsShiftSched, it defaults to shift_exc. If non-null, the resulting recordset is trimmed exactly at the boundaries of the specified period.

ent_id

start_date

days_ahead

name

Returns ADODB.recordset. Columns are ent_id, start_time, end_time, shift_id, break1_start, , break3_end Remarks This method performs the same operations as the Ent.RefreshShiftSched() method, but it does not update the shift_to_go table. Only entities with the can_sched_shifts capability are allowed to define shift schedules. If the ent_id passed to this method does not have a shift schedule defined then the result is the same as if no ent_id was passed as a parameter: ie. the method processes the schedules for all entities that can_sched_shifts.

2004 CIMNET Inc

www.CimnetInc.com

70

Null shifts (where shift_id = 0) are NOT included in the resultset. Instead each valid shift has a shift_end time which is used to determine when the shift ends. Shift breaks are included as separate columns in each row, and are null values when no breaks apply. Stored Procedure(s) Used None Access via Director.cls using GetSpecificRS() Yes, returns recordset in XML format. The XMLCmd parameter must be formatted to include the user_id parameter (except possibly name) as follows: <?xml version="1.0"?> <request> <object>ent</object> <cmd>GetRefreshedShiftSched</cmd> <ent_id></ent_id> <days_ahead>14</days_ahead> <name>temp_shift_exc1</name> </request>

Ent_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset: ent.ent_name as parent_ent_name (parent_ent_id), ent.description as parent_ent_description (parent_ent_id), ent.ent_name as child_ent_name (child_ent_id), ent.description as child_ent_description (child_ent_id), ent.can_sched_jobs (child_ent_id), ent.can_run_jobs (child_ent_id), ent.can_store (child_ent_id), ent.can_capture_labor (child_ent_id), ent.last_edit_at as ent_last_edit_at (child_ent_id) GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Not supported as there are no dependent fields Not supported as there are no dependent fields Stub only. No specific recordsets currently supported As for GetAll()

Attr Class
Summary of the methods supported by this class:
2004 CIMNET Inc

www.CimnetInc.com

71

STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

COMMENTS All columns except last_edit_comment are available as filters As for GetAll()

Stub only. No specific recordsets currently supported

Attr_Set Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Not supported as there are no dependent fields Not supported as there are no dependent fields Stub only. No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id As for GetAll()

Ent_Attr Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset: attr.attr_desc, attr.data_type, ent.ent_name GetAllbyXML() GetByKey() GetSpecificRS() Stub only. No specific recordsets currently supported As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

72

Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

System_Attr Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported COMMENTS The following columns are NOT available as filters to increase performance: attr_desc, attr_seq, attr_constraints, last_edit_comment As for GetAll()

System_Attr_Grp Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() Stub only. No specific recordsets currently supported COMMENTS All columns are available as filters. As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

73

IsValid()

Language_Grp Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported COMMENTS All columns are available as filters. As for GetAll()

Language Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS NextFreeLangId() Clone() DeleteByLang() COMMENTS Stub only. No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id As for GetAll()

NextFreeLangID Method
2004 CIMNET Inc

www.CimnetInc.com

74

Purpose To return the first free language ID for a new language. Syntax NextFreeLangID () Parameters None. Returns Long. The next free language ID. Remarks Usually call this method before calling Clone() to create a new language. Stored Procedure(s) Used sp_S_Language_Next_Free.

Clone Method
Purpose To create a new language (of terminology) by cloning all the defined strings from an existing language. Syntax Clone (session_id, new_lang_id, cloned_lang_id, new_lang_desc) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made. Required. By Value. A long to identify the new language. Required. By Value. A long to identify the existing language to be cloned Required. By Value. A string to describe the new language. The language description is saved as string = 1 for each language.

new_lang_id cloned_lang_id

new_lang_desc

Returns Long. The number of strings created in the new language. Remarks A return value of zero indicates that the clone was not successful, probably because the cloned_lang_id is not defined, or because the new_lang_id is already used. Stored Procedure(s) Used sp_Language_Clone.

DeleteByLang Method
2004 CIMNET Inc

www.CimnetInc.com

75

Purpose To delete all strings for a given language from the database. Syntax DeleteByLang (session_id, lang_id) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made. Required. By Value. A long to identify the language to be deleted.

lang_id Returns

Boolean. True if delete was successful, else false. Remarks Any users that had this language as their default language are now assigned the systems default language. Stored Procedure(s) Used sp_D_Language_By_Lang.

Error_Log Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters to increase performance: description, system_msg. If the following fields are included as filters they are included as: logged_at: returns all rows where logged_at >= parameter value As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

Stub only. No specific recordsets currently supported

Audit_Trail Class
2004 CIMNET Inc

www.CimnetInc.com

76

Summary of the methods supported by this class:


STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported Not supported as this data is added automatically Not supported as this data is not editable Not supported as this data is not editable Not supported as this data is not deletable Not supported as this data is not deletable Only provides access to supported commands Not supported. COMMENTS The following columns are NOT available as filters to increase performance: delete_detail. As for GetAll()

Grp_Name Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Stub only. No specific recordsets currently supported COMMENTS All columns except last_edit_comment are available as filters As for GetAll()

This method also inserts a row into the grp_ent_link table for every entity defined in the database with access_level defaulted = 0 for these insertions.
It also adds a row into the grp_priv_link table for every privilege defined in the database with default priv_value = 0 for these insertions.

Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

This method also deletes all rows in the grp_ent_link and grp_priv_link tables for this group.

User_Name Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll()
2004 CIMNET Inc

COMMENTS The following columns are NOT available as filters: encrypt_pw, email_address, www.CimnetInc.com

77

failed_logins, smtp_server, pop3_server, email_account, email_pw, last_edit_comment, mod_id, row_id. If the following optional filter fields are included they have the this effect: last_pw_change: only rows with last_pw_change AT OR BEFORE the specified datetime are returned. If active = 0, then all active AND inactive users are returned. if active = null or 1, then only active users are returned. The following columns are also included in the returned recordset : labor_dept.dept_desc GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS AddorUpdate() COMMENTS Allows for a user to be added if not already exist, or update existing dependent fields if the user does exist. Useful for importing users from an external system. Does not support updating of a users password use specific ChangePassword() method for this. ChangePassword() Allows changing of a users password, but must include current password as well for authentication. Does not support updating of a users password use specific ChangePassword() method for this. Does not support updating of a users password use specific ChangePassword() method for this. No specific recordsets currently supported As for GetAll().

AddOrUpdate Method
Purpose Add a new user or update the existing user information Syntax AddOrUpdate (session_id, user_id, user_desc, encrypt_pw, active, hourly_cost, email_address, lang_id, def_dept_id, last_pw_change, auth_method, def_lab_cd, smtp_server, pop3_server, email_account, email_pw, spare1, spare2, spare3, spare4) Parameters Standard Add or Update parameters for User_Name class Returns
2004 CIMNET Inc

www.CimnetInc.com

78

Boolean. (True or False) Remarks Searches for the User_Id. If User_Id doesnot exists then the user is added, and if exists then it updates the User information for that user. Stored Procedure(s) Used N/a Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>user_name</object> <msgtype>Exec</msgtype> <cmd>AddOrUpdate</cmd> <user_name> <user_id>userx</user_id> <user_desc>userxdesc</user_desc> <encrypt_pw>userxpwd</encrypt_pw> <active>1</active> <hourly_cost>9</hourly_cost> <email_address></email_address> <lang_id>1</lang_id> <def_dept_id>SA</def_dept_id> <def_lab_cd>I</def_lab_cd> <spare1><spare1> <spare2><spare2> <spare3><spare3> <spare4><spare4> </user_name> </request>

ChangePassword Method
Purpose Change the password of the specified user. Syntax ChangePassword (session_id, user_id, password, target_user_id, new_password) Parameters Part Description

2004 CIMNET Inc

www.CimnetInc.com

79

session_Id user_id password target_user_id new_password Returns

Required. By Value. A variant (long) to identify the client session from which the request is being made. Required. By Value. A variant (string) to identify the user changing the password. Required. By Value. A variant (string) to validate the user changing the password. Required. By Value. A variant (string) to identify the user for whom the password is being changed. Required. By Value. A variant (string) to hold the new password for the user.

Long. 0 if successful. Throws an exception with an appropriate description if unsuccessful. Remarks If the user_id and target_user_id are not the same, then the user should be checked to make sure that they have the right to modify user settings. The new password must be different from the existing password for the user. Stored Procedure(s) Used sp_U_User_Name_Change_Password Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>user_name</object> <msgtype>Exec</msgtype> <cmd>ChangePassword</cmd> <session_id>111</session_id> <user_id>user1</user_id> <password>1</password> <target_user_id>user1</ target_user_id > <new_password>new1</ new_password > </request>

User_Grp_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Stub only. No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

80

Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Not supported as there are no dependent fields Not supported as there are no dependent fields

Priv Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported COMMENTS All columns are available as filters. As for GetAll()

Grp_Priv_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd()
2004 CIMNET Inc

COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset: grp_name.grp_desc, priv.priv_desc As for GetAll()

Stub only. No specific recordsets currently supported

www.CimnetInc.com

81

IsValid() SPECIFIC METHODS GetPrivilegesByUser() GetUsersByPrivilege() GetPriv() COMMENTS

GetPrivilegesByUser Method
Purpose To return all defined privilege access levels for a given user. Syntax GetPrivilegesByUser (user_id) Parameters Part user_id Description Required. By Value. A string identifying the user_id for whom privileges are required.

Returns ADODB.recordset. Columns are priv_id, priv_value and priv_desc. Remarks Privileges are defined by User Group. This method extracts the highest privilege defined for ALL groups that this user belongs to. Stored Procedure(s) Used sp_S_Grp_Priv_Link_By_User Access via Director.cls using GetSpecificRS() Yes. Returns recordset in XML format. The XMLCmd parameter must be formatted to include the user_id parameter as follows: <?xml version="1.0"?> <request> <object>grp_priv_link</object> <cmd>GetPrivilegesByUser</cmd> <user_id>222</user_id> </request>

GetUsersByPrivilege Method
Purpose To return all defined users access levels for a given privilege. Syntax GetUsersByPrivilege (priv_id) Parameters
2004 CIMNET Inc

www.CimnetInc.com

82

Part priv_id

Description Required. By Value. An integer identifying the priv_id for whom users privileges are required.

Returns ADODB.recordset. Columns are user_id and priv_value. Remarks Privileges are defined by User Group. This method extracts the maximum privilege for users from for ALL groups that are assigned this privilege. Stored Procedure(s) sp_S_Grp_Priv_Link_By_Priv Access via Director.cls using GetSpecificRS() Yes. Returns recordset in XML format. The XMLCmd parameter must be formatted to include the priv_id parameter as follows: <?xml version="1.0"?> <request> <object>grp_priv_link</object> <cmd>GetUsersByPrivilege</cmd> <priv_id>2</priv_id> </request>

GetPriv Method
Purpose To return a specific privilege access levels for a given user. Syntax GetPriv (user_id, priv_id) Parameters Part user_id Description Required. By Value. A string identifying the user_id for whom privileges are required. Required. By Value. A long to identify the privilege for which an access level is required.

priv_id

Returns Long. The privilege value for this user and privilege. Remarks Privileges are defined by User Group. This method extracts the highest privilege defined for ALL groups that this user belongs to. Stored Procedure(s) Used 83

2004 CIMNET Inc

www.CimnetInc.com

sp_S_Grp_Priv_Link_GetPriv Access via Director.cls using GetSpecificRS() Yes. Returns recordset in XML format. The XMLCmd parameter must be formatted to include the user_id parameter as follows: <?xml version="1.0"?> <request> <object>grp_priv_link</object> <cmd>GetPriv</cmd> <user_id>15</user_id> <priv_id>222</priv_id> </request>

Grp_Ent_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset: grp_name.grp_desc, ent.ent_name, GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() Stub only. No specific recordsets currently supported As for GetAll()

This method also sets the access level for this group to ALL descendents of this entity. If access rights to child entities for this group have previously been set they will be overwritten by this method.
When reading access rights (which happens more frequently) it will thus not be necessary to check for rights inherited from ancestor entities.

UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS CanAccess() GetEntAccessByUser() GetEntAccessByGrp() GetUserAccessByEnt() GetGrpAccessByEnt() COMMENTS

CanAccess Method
Purpose
2004 CIMNET Inc

www.CimnetInc.com

84

To find out whether a given user group has access rights to a given entity. Syntax CanAccess (grp_id, ent_id) Parameters Part grp_id Description Required. By Value. A long to identify the group / entity combination to be updated. Required. By Value. A long to identify the group / entity combination to be updated.

ent_id

Returns Boolean. True if access is granted, else false. Remarks This method provides an easier to use method of retrieving access rights than using the standard Get****() methods. Stored Procedure(s) Used sp_S_Grp_Ent_Link_Can_Access. Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 if access is granted, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>grp_ent_link</object> <msgtype>Exec</ msgtype > <cmd>CanAccess</cmd> <grp_id>2</grp_id > <ent_id>1</ent_id> </request>

GetEntAccessByUser Method
Purpose To return all entities and whether a given user has access privileges to them or not. Syntax GetEntAccessByUser (user_id) Parameters Part user_id Description Required. By Value. A string identifying the user_id for whom entity access privileges are required.

2004 CIMNET Inc

www.CimnetInc.com

85

Returns ADODB.recordset. Columns are ent_id, ent_name, can_run_jobs, can_capture_util, can_capture_labor, can_do_dnc, can_store, can_log_data, parent_ent_id, and access. Remarks Entity access privileges are defined by User Group. This method checks all groups that this user belongs to and grants access where ANY of these groups have access rights, ie. rights are Ored not ANDed. Stored Procedure(s) Used sp_S_Grp_Ent_Link_EntAccByUser Access via Director.cls using GetSpecificRS() Yes. The XML input parameter must be formatted to include the user_id as follows: <?xml version="1.0"?> <request> <object>grp_ent_link</object> <cmd>GetEntAccessByUser</cmd> <user_id>222</user_id> </request>

GetUserAccessByEnt Method
Purpose To return all defined users access privileges to the specified entity. Syntax GetUserAccessByEnt (ent_id) Parameters Part ent_id Description Required. By Value. A long identifying the entity for which all users access privileges are required.

Returns ADODB.recordset. Columns are user_id, ent_status, max_subtree_access, min_subtree_access. Remarks Entity access privileges are defined by User Group. This method checks all groups that this user belongs to and includes access to which ANY of these groups have access rights, ie. rights are Ored not ANDed. The ent_status field indicates the access level for the specified entity. The max_subtree_access field indicates the maximum access level for all descendants of the specified entity, ie. it indicates whether each user has access to ANY of its children or NONE of them. The min_subtree_access field indicates the minimum access level for all descendants of the specified entity, ie. it indicates whether each user has access to ALL of its children or not.
2004 CIMNET Inc

www.CimnetInc.com

86

Stored Procedure(s) Used sp_S_Grp_Ent_Link_UserAccByEnt Access via Director.cls using GetSpecificRS() Yes. The XML input parameter must be formatted to include the ent_id as follows: <?xml version="1.0"?> <request> <object>grp_ent_link</object> <cmd>GetUserAccessByEnt</cmd> <ent_id>2</ent_id> </request>

GetGrpAccessByEnt Method
Purpose To return all defined user groups access privileges to the specified entity. Syntax GetGrpAccessByEnt (ent_id) Parameters Part ent_id Description Required. By Value. A long identifying the entity for which all groups access privileges are required.

Returns ADODB.recordset. Columns are grp_id, ent_status, max_subtree_access, min_subtree_access, grp_ent_link.last_edit_by, grp_ent_link.last_edit_at Remarks The ent_status field indicates the access level for the specified entity for each group. The max_subtree_access field indicates the maximum access level for all descendants of the specified entity, ie. it indicates whether each group has access to ANY of its children or NONE of them. The min_subtree_access field indicates the minimum access level for all descendants of the specified entity, ie. it indicates whether each group has access to ALL of its children or not. Stored Procedure(s) Used sp_S_Grp_Ent_Link_GrpAccByEnt Access via Director.cls using GetSpecificRS() Yes. Returns recordset as an ADODB recordset. The XML input parameter must be formatted to include the ent_id as follows: <?xml version="1.0"?> <request> <object>grp_ent_link</object> <cmd>GetUserAccessByEnt</cmd>
2004 CIMNET Inc

www.CimnetInc.com

87

<ent_id>2</ent_id> </request>

Shift Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported COMMENTS All columns except last_edit_comment are available as filters As for GetAll()

Shift_Sched Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id. The following columns are also included in the returned recordset : shift.shift_desc, ent.ent_name GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported As for GetAll()

Shift_Exc Class
Summary of the methods supported by this class:
2004 CIMNET Inc

www.CimnetInc.com

88

STANDARD METHODS GetAll()

COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id. The following columns are also included in the returned recordset : ent.ent_name, shift.shift_desc

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS GetExceptions()

As for GetAll()

Stub only. No specific recordsets currently supported

mod_id is optional

COMMENTS Returns a recordset of all shift exceptions in a given date range

GetExceptions Method
Purpose Returns a recordset of all shift exceptions in a given date range. Syntax GetExceptions(start_time, end_time) Parameters Part start_time end_time Returns ADODB.recordset. Columns are ent_id, start_time, end_time, shift_id, additive, and mod_id. Remarks This method uses the date range passed to it to produce a recordset of all the shift exceptions which occur between the two dates. Stored Procedure(s) Used sp_SA_Shift_Exc_GetExceptions Access via Director.cls using GetSpecificRS() Yes. Returns recordset as an ADODB recordset. The XML input parameter must be formatted to include the ent_id as follows: <?xml version="1.0"?>
2004 CIMNET Inc

Description Required. By Value. A Variant (date) to the start of the period. Required. By Value. A Variant (date) to identify end of the period.

www.CimnetInc.com

89

<request> <object>shift_exc</object> <msgtype>GetSpec</msgtype> <cmd>GetExceptions</cmd> <start_time>01/01/2003 08:00:00 AM</start_time> <end_time>01/01/2003 05:00:00 PM</end_time> </request>

Shift_To_Go Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: Breakx_Start, Breakx_End. If the start_time or end_time fields are included as optional filters then only rows with datetime values AT OR AFTER the start time and AT OR BEFORE the end time are returned. As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

Stub only. No specific recordsets currently supported

Not supported Not supported

Message Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: Message, last_edit_comment, row_id If the sent or rcvd fields are included as optional filters then only only rows with datetime values AT OR AFTER the specified datetime filters for either (or both) of these fields are returned. The following columns are also included in the returned recordset : GMT Date and Time as now As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific()


2004 CIMNET Inc

Stub only. No specific recordsets currently supported

www.CimnetInc.com

90

Delete() DeleteAll() ExecuteXMLCmd() IsValid()

Mail_Grp Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported COMMENTS All fields except last_edit_comment are supported as optional filter parameters As for GetAll()

Mail_Grp_Member Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset : mail_grp.name GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

91

Emailatt Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id As for GetAll()

Pred_Msg Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() ExecuteXMLCmd() IsValid() No specific recordsets currently supported COMMENTS The following fields are not permitted as optional filter parameters to increase performance: recipients, message, last_edit_comment As for GetAll()

UI_Config Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS()
2004 CIMNET Inc

COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id As for GetAll()

Stub only. No specific recordsets currently supported www.CimnetInc.com

92

Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS SaveSectionParams() COMMENTS

SaveSectionParams Method
Purpose To save multiple configuration parameters for a given config_id, screen and section. The parameters are submitted as an XML string. Syntax SaveSectionParams (xmlRequest) Parameters Part xmlRequest Description Required. By Value. An XML string containing multiple parameter and value pairs, and the config_id, screen and section to which the parameters apply.

Returns String in XML format returning the status / error description in the following format <result> 0 for success, -1 for failure - always included error description - only included if unsuccessful

<error><desc> Remarks

Before saving the new data any existing configuration data for the defined config_id, screen and section is deleted. This avoids the user having to worry about deleting obsolete configuration data. However, it also means that ALL configuration data for a given section must be included each time this method is called. This also means that it is transparent to the user whether configuration data is being inserted or updated, so they dont need to keep track of whether each parameters already exists or not. Stored Procedure(s) Used sp_D_ui_config to delete existing section data sp_I_ui_config called for each parameter Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 if save is successful, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows:
2004 CIMNET Inc

www.CimnetInc.com

93

<?xml version="1.0"?> <request> <object>ui_config</object> <cmd>SaveSectionParams</cmd> <session_id>123</session_id> <config_id>config_id</config_id> <screen>screen_id</screen> <sectn>section_id</sectn> <parameters> <parameter>abc</parameter> <valu>1</valu> <parameter>xyz</parameter> <valu>Red</valu> </parameters> </request>

UI_Config_Default Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS SaveSectionParams() COMMENTS Stub only. No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id As for GetAll()

SaveSectionParams Method
Purpose To save multiple configuration parameters for a given screen and section. The parameters are submitted as an XML string. Syntax SaveSectionParams (xmlRequest) Parameters
2004 CIMNET Inc

www.CimnetInc.com

94

Part xmlRequest

Description Required. By Value. An XML string containing multiple parameter and value pairs, and the screen and section to which the parameters apply.

Returns String in XML format returning the status / error description in the following format <result> 0 for success, -1 for failure - always included error description - only included if unsuccessful

<error><desc> Remarks

Before saving the new data, any existing configuration data for the defined screen and section is deleted by calling DeleteAll() method in middleware. This avoids the user having to worry about deleting obsolete configuration data. However, it also means that ALL configuration data for a given section must be included each time this method is called. This also means that it is transparent to the user whether configuration data is being inserted or updated, so they dont need to keep track of whether each parameters already exists or not. Stored Procedure(s) Used sp_I_ui_config_default called for each parameter Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 if save is successful, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>ui_config_default</object> <cmd>SaveSectionParams</cmd> <session_id>123</session_id> <screen>screen_id</screen> <sectn>section_id</sectn> <parameters> <parameter>abc</parameter> <valu>1</valu> <parameter>xyz</parameter> <valu>Red</valu> </parameters> </request>

UI_Button Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: tooltip, def_enabled_img, def_disabled_img, param_desc, config_help, dest_option, last_edit_comment www.CimnetInc.com

2004 CIMNET Inc

95

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

As for GetAll()

Stub only. No specific recordsets currently supported Not supported populated with predefined data Not supported populated with predefined data Not supported populated with predefined data Not supported populated with predefined data Not supported populated with predefined data Not supported populated with predefined data Not supported populated with predefined data

UI_Button_Set Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS All fields are supported as optional filter parameters The following columns are also added in the returned recordset : ui_button.button_desc, ui_button.tooltip, ui_button.def_enabled_img, ui_button.def_disabled_img, ui_button.param_desc, ui_button.def_param, ui_button.config_help, ui_button.dest_option, ui_button.spare1-4 As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

Stub only. No specific recordsets currently supported Not supported populated with predefined data Not supported populated with predefined data Not supported populated with predefined data Not supported populated with predefined data Not supported populated with predefined data Not supported populated with predefined data Not supported populated with predefined data

Mgr_Data_Config Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Stub only. No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: rep_desc, rep_filepath, rep_parameters, sort_order, custom_filter, max_pages, last_edit_comment As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

96

Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

Graphic Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS UpdateImage() COMMENTS Stub only. No specific recordsets currently supported This method requires an additional field size which needs to be supplied along with other fields to specify the size of an image This method requires an additional field size which needs to be supplied along with other fields to specify the size of an image Updating graphic_data column is not supported use specific UpdateImage() method for this. COMMENTS The following columns are NOT available as filters: graphic_data, last_edit_comment, row_id As for GetAll()

UpdateImage Method
Purpose To update a specific graphic image in a database. Syntax UpdateImage(session_id, graphic_id, graphic_data, size, last_edit_comment, last_edit_at) Parameters Part session_id Description Required. By Value. A variant (long) to identify the client session from which the request is being made.

2004 CIMNET Inc

www.CimnetInc.com

97

graphic_id graphic_data size last_edit_comment last_edit_at Returns Long. 0 if successful, else 1. Remarks

Required. By Value. A variant (string) to identify the graphic_id. Required. By Value. A variant (string) to identify the graphic data. Required. By Value. A variant (long) to identify the size of the image Optional. By Value. A variant (string) to identify why the image was changed. Optional. By Ref. A variant (datetime) to identify the last_edit_at. Also returns the last date and time of the image updated

This methods updates the supplied graphic image in the graphic table. Stored Procedure(s) Used sp_U_Graphic_UpdateImage Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>graphic</object> <msgtype>exec</msgtype> <cmd>UpdateImage</cmd> <session_id>1234</session_id> <graphic_id>SampleGraphicId1</graphic_id> <graphic_data>5pbOdpIjLEAqK6iMIFAHCgZHuBmsQ+KdblZ..</graphic_data> <size>32000</size> <last_edit_comment></last_edit_comment> <last_edit_at>06/14/2004 18:13:50</last_edit_at> </request>

Tool Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Stub only. No specific recordsets currently supported COMMENTS All fields except last_edit_comment are supported as optional filter parameters As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

98

Delete()

This method also deletes all rows in other tables for this entity as defined by cascade deletes in the database. The delete Stored Procedure has also been modified to do the following which are not possible using standard database functionality:
Update all rows in the doc_type table to set the default viewer and editor tools to null if they used this tool.

DeleteAll() ExecuteXMLCmd() IsValid()

Doc_Type Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS All fields except last_edit_comment are supported as optional filter parameters The following columns are also included in the returned recordset: tool.descrip as editor_tool, tool.descrip as viewer_tool GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported As for GetAll()

File_Type Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset: doc_type.descrip GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Stub only. No specific recordsets currently supported As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

99

Delete() DeleteAll() ExecuteXMLCmd() IsValid()

File_Desc Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset: doc_type.descrip GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Not supported as there are no dependent fields Not supported as there are no dependent fields Stub only. No specific recordsets currently supported As for GetAll()

Dir Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset: ent.ent_name GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Standard method enhanced as described below. Stub only. No specific recordsets currently supported Standard method enhanced as described below. As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

100

SPECIFIC METHODS ChangeSeq() ReSeq()

COMMENTS

Add Method
Purpose To add a new upload or doanload directory for an entity to the database. This is a standard method which has been enhanced as defined in the remarks section. Syntax Add (session_id, ent_id, seq_no, directory, last_edit_comment, last_edit_at, validate) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made. Required. By Value. An integer identifying the entity. Required. By Value. An integer identifying the sequence or priority of using this directory. Required. By Value. A string (max 254 chars) containing the path to this directory. Optional. By Value. A string (max 254 chars) specifying why the record was added. Optional. By Ref. A variant datetime identifying the date and time of creation of this record is returned to the user Optional. By Value. A flag to define whether the data should be validated before saving to the database or not.

ent_id seq_no

directory

last_edit_comment

last_edit_at

validate

Returns Boolean. True if Insert was successful, else False. Remarks Disallow an insert if this directory has already been defined as a download directory (seq_no >= 0) for this entity. This is not prevented by the database as the directory is not part of the primary key on this table to allow for the same upload and download directory for an entity. If the seq_no of the new directory is <= the current maximum seq_no for this entity, then the seq_no fields of these existing rows will be incremented (shuffled down) to allow the insert to this position. If the seq_no of the new directory is leaves a hole between it and the maximum seq_no for this entity, then the seq_no fields of these existing rows will be resequenced to maintain a chronological list of seq_nos starting from 0. Note: The automatic re-sequencing of this data will change the primary key values of the existing rows
2004 CIMNET Inc

www.CimnetInc.com

101

for future data access functions. Stored Procedure(s) Used sp_I_Dir.

Delete Method
Purpose To delete a given directory from the database. This is a standard method which has been enhanced as defined in the remarks section. Syntax Delete (session_id, ent_id, seq_no) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made. Required. By Value. A long to identify the entity directory to be deleted. Required. By Value. A long to identify the entity directory to be deleted.

ent_id seq_no Returns

Boolean. True if delete was successful, else false. Remarks If the deletion of this new directory leaves a hole between it and the maximum seq_no for this entity, then the seq_no fields of these existing rows will be resequenced to maintain a chronological list of seq_nos starting from 0. Note: The automatic re-sequencing of this data will change the primary key values of the existing rows for future data access functions. Stored Procedure(s) Used sp_D_Dir.

ChangeSeq Method
Purpose To change the sequence of a given directory up or down the priority list. Syntax ChangeSeq (session_id, ent_id, orig_seq_no, new_seq_no) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made.
www.CimnetInc.com

2004 CIMNET Inc

102

ent_id

Required. By Value. A long to identify the entity directory to be resequenced. Required. By Value. A long to identify the original seq_no of the entity directory to be resequenced. Required. By Value. A long to identify the new seq_no for this directory

orig_seq_no

new_seq_no

Returns Boolean. True if re-sequence was successful, else false. Remarks This method allows a directory to be moved to any other position in the sequence priority up or down any number of places or to the top or bottom of the list. Note: The re-sequencing of this data will change the primary key values of the existing directories for future data access functions. Stored Procedure(s) Used sp_U_Dir_Change_Seq.

ReSeq Method
Purpose To re-sequence all the directories for a given entity to maintain an ordered sequence starting from 0. Syntax ReSeq (session_id, ent_id) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made. Required. By Value. A long to identify the entity to be resequenced.

ent_id Returns

Boolean. True if re-sequence was successful, else false. Remarks Note: The re-sequencing of this data will change the primary key values of the existing directories for future data access functions. Stored Procedure(s) Used sp_U_Dir_ReSeq.

2004 CIMNET Inc

www.CimnetInc.com

103

Prod DLL Enhanced Methods


Item_State Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported COMMENTS All fields except last_edit_comment are supported as optional filter parameters As for GetAll()

Item_Grade Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported COMMENTS All fields except last_edit_comment are supported as optional filter parameters As for GetAll()

Item_Class Class
Summary of the methods supported by this class:
2004 CIMNET Inc

www.CimnetInc.com

104

STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id As for GetAll()

Stub only. No specific recordsets currently supported

Item_Class_Attr Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset: attr.attr_desc, attr.data_type As for GetAll()

Item Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: reorder_amt, notes. last_edit_comment, row_id The following fields not included in the item table are also permitted as optional filter parameters to increase the range of filter options : item_class.produced as class_produced, item_class.consumed as class_ consumed. The following columns are also included in the returned recordset: item_class.item_class_desc, uom.description as uom_description

2004 CIMNET Inc

www.CimnetInc.com

105

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

As for GetAll()

Stub only. No specific recordsets currently supported

Item_Attr Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset: item.item_desc, attr.attr_desc, attr.data_type As for GetAll()

Uom Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific()
2004 CIMNET Inc

COMMENTS All fields except last_edit_comment are supported as optional filter parameters As for GetAll()

Stub only. No specific recordsets currently supported

www.CimnetInc.com

106

Delete() DeleteAll() ExecuteXMLCmd() IsValid()

Uom_Conv Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id. The following columns are also included in the returned recordset: uom.description for the from_uom_id as from_description, uom.abbreviation for the from_uom_id as from_abbreviation, uom.description for the to_uom_id as to_description, and uom.abbreviation for the to_uom_id as to_abbreviation. As for GetAll() This method also supports fetching a single row using its effective primary keys. Either row_id OR all of the following optional parameters must be supplied to fetch a single row: from_uom_id, to_uom_id, item_id. Stub only. No specific recordsets currently supported

GetAllbyXML() GetByKey()

GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

Item_Reas_Grp Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() Stub only. No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: display_seq, last_edit_comment As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

107

IsValid()

Item_Reas_Grp_Class_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Not supported as there are no dependent fields Not supported as there are no dependent fields Stub only. No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id As for GetAll()

Item_Reas_Grp_Ent_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS GetReasons() COMMENTS Not supported as there are no dependent fields Not supported as there are no dependent fields No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id As for GetAll()

GetReasons Method
Purpose

2004 CIMNET Inc

www.CimnetInc.com

108

To return all the possible reject / waste reason groups and reasons defined for an entity. Reasons linked to an item class may also be optionally included. Syntax GetReasons (ent_id, item_ id, reas_grp_type) Parameters Part ent_id item_ id reas_grp_type Description Required. By Value. A variant (long) to identify the entity. Optional. By Value. A variant (string) to identify the item class Optional. By Value. A variant (long) to filter the resultset to reasons of a specified reason group type.

Returns ADODB.recordset. Columns are reas_grp_id, reas_grp_desc, reas_grp_type, reas_cd, reas_desc sorted by reas_grp_id and then reas_cd. Remarks Reject / Waste reason groups may be associated with the relevant item class, or with the physical entity, or both. In addition entities may inherit reasons from their default parent entities. The reasons associated with an items are only returned if the item_id parameter is included. This method returns all the reasons for this entity and all its default parent entities filtered with reason group type if reas_grp_type is included. All the returned data is consolidated into a single recordset. Stored Procedure(s) Used sp_S_IRG_Ent_Link_Get_Reasons Access via Director.cls using GetSpecificRS() <?xml version="1.0"?> <request> <object>item_reas_grp_ent_link </object> <msgtype>GetSpec</msgtype> <cmd>GetReasons</cmd> <ent_id>1211</ent_id> <item_id>bevcanend</item_id> <reas_grp_type>1</reas_grp_type> </request>

Item_Reas Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: display_seq, last_edit_comment The following fields not included in the item_reas table are also permitted as optional filter parameters to increase the range of filter options : item_reas_grp.reas_grp_type as reas_grp_type www.CimnetInc.com

2004 CIMNET Inc

109

The following columns are also included in the returned recordset: item_reas_grp.reas_grp_desc, item_grade.item_grade_desc, item_state.item_status_desc, item_reas_grp.reas_grp_type GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported As for GetAll()

Job_Exec Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS Only the following columns ARE available as filters to increase performance: ent_id, job_pos, spare1-4. last_edit_by, last_edit_at The following columns are also included in the returned recordset: ent.ent_name (ent_id), ent.ent_name as def_to_ent_name (def_to_ent_id), ent.ent_name as def_from_ent_name (def_from_ent_id), item_reas.reas_desc as def_prod_reas_desc (def_prod_reas_cd), item_reas.reas_desc as def_cons_reas_desc (def_cons_reas_cd) GetAllbyXML() GetByKey() GetSpecificRS() Retrieval of the following specific recordsets are supported: GetQueue(). Available filters are: ent_id, job_state, reqd_by, job_priority, max_rows GetRunnableEntities().Available filters are: ent_id GetSchedulableEntity().Available filters are: ent_id GetReqdCertSignOffs(). Available filters are: wo_id, oper_id, step_no GetStepBomData(). Available filters are: wo_id, oper_id, seq_no, step_no GetJobBomStepQuantities: Available filters are: wo_id, oper_id, seq_no, step_no GetJobQueue: Available filters are: wo_id, item_id GetSchedulableEntities: Available filters are: wo_id, oper_id GetSchedulableParents: Available filters are: ent_id Add() Update() UpdateSpecific() Only the following columns ARE available as filters to increase performance: ent_id, job_pos, spare1-4. last_edit_by, last_edit_at

2004 CIMNET Inc

www.CimnetInc.com

110

Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS StartJob() PauseJob() EndJob() SplitJob() CloneJob() CloneWO() AddProd() RejectProd() AddProdPostExec() AddCons() AddConsPostExec() SetCurLotData() StartStep() StopStep() StepLogin() StepLogout() UpdateStepData() CreateWOFromProcess() VerifyProcess() CertSignoff() CertSignoffAllowed() CertSignoffReqd() CertSignoffDone() CertStartAllowed() SetUIScreenTagValues() ChangeWOQtys() ChangeWOPriority() ChangeWOReqdFinishTime() ChangeWOValues() SetAttr() SetActualSpecValue() DownloadSpecs() ChangeSpecValue()
2004 CIMNET Inc

COMMENTS

The optional step_no and lot_no fields must both be included or both excluded.

www.CimnetInc.com

111

ChangeSpecValues() StartNextJobViaFC() LogJobEvent() UpdateTemplateSpecValues() StartDataEntryJob()

GetQueue Method
Purpose To retrieve the job schedule or job queue available to a specific entity. Syntax GetQueue (ent_id, job_state, reqd_by_time, job_priority, max_rows) Parameters Part ent_id Description Required. By Value. A long to identify the entity for which the job queue is to be retrieved. Optional. By Value. A variant (long) to filter the queue by only retrieving jobs of a specified state. Default is to retrieve jobs regardless of state (no filter). Optional. By Value. A variant (datetime) to filter the queue by only retrieving jobs with a reqd_by datetime BEFORE the specified datetime. Default is no filter for this field. Optional. By Value. A variant (long) to filter the queue by only retrieving jobs <= the specified priority. Default is no filter for this field. Optional. By Value. A variant (long) to filter the rows with the value specified. Default is 0; which is no filter for this field.

job_state

reqd_by

job_priority

max_rows

Returns ADODB.recordset. Columns include all fields from the job table and at least the following joined data: wo.wo_desc, wo.reqd_qty, wo.mo_id, item.item_desc, job_state.state_desc, job_state.color, ent.ent_name (from job.target_sched_ent_id), ent.ent_name as run_ent_name (from job.run_ent_id), item.spare1 as item_spare1 item.spare4 as item_spare4. Remarks All default parent entities will also be included in the retrieve until the first default parent is reached that does NOT have the can_sched_to capability. The optional parameters are used as filters which will be ANDed together if more than one of them is included. Note that the Sort oder and Filter specified for a given entity by the Supervisor Queue screen are applied AFTER this recordset is returned, so this filter should not be set so as to filter out any rows that are necessary for the predefined settings.
2004 CIMNET Inc

www.CimnetInc.com

112

If the max_rows filter is not specified, then resultset is returned as is, ie, no filter is applied to the resultset. If max_rows is specified, then the resultset is restricted to the specified no. of rows (max_rows). Closed work orders (wo.state_cd = 3) are always ignored by GetQueue resultset. Stored Procedure(s) Used sp_SA_Ent_GetSchedParents Access via Director.cls using GetSpecificRS() Yes. The XML input parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>GetSpec</msgtype > <cmd>GetQueue</cmd> <ent_id>1</ent_id> <job_state>1</job_state> <reqd_by_time></reqd_by_time> <job_priority></job_priority> <max_rows></max_rows> </request>

StartJob Method
Purpose To start a job on the specified entity. Syntax StartJob (session_id, user_id, ent_id, wo_id, oper_id, seq_no, status_notes, check_privs, check_certs, job_pos) Parameters Part session_id Description Required. By Value. A long to identify the session from which the job is being started. Required. By Value. A string to identify the user_id starting the job. Required. By Value. A long to identify the entity on which the job is to be run. Required. By Value. A string to identify the wo_id Required. By Value. A string to identify the oper_id Required. By Value. A long to identify the seq_no Optional. By Value. A variant (string) to include notes associated
www.CimnetInc.com

user_id ent_id

wo_id oper_id seq_no status_notes


2004 CIMNET Inc

113

with the state change. Defaults to null. check_privs Optional. By Value. A variant (boolean) to specify whether the users privileges should be checked before executing this action. Defaults to False. Optional. By Value. A variant (boolean) to specify whether the users certifications should be checked before executing this action (Requires Certification module). Defaults to False. Optional. By Value. A long to identify the job position, if > 1 jobs are running on this entity

check_certs

job_pos

Returns Integer. 0 if successful, else -1 Remarks The wo_id, oper_id and seq_no are all required to identify the job to be started on the specified entity. The session_id is required for licensing checks. The user_id may be used for privilege checking. If this job does not exist in the database or if it does exist but its status is not 1 (NEW) or 2 (READY) then an exception is thrown with an appropriate error description. If a job IS currently running on the specified entity then an exception is thrown with an appropriate error description. Similarly if the database update fails for any reason. If the call is successful the job table is updated as follows for the specified job: state_cd = 3 (RUNNING) status_notes = status_notes act_start_time = current datetime If the call is successful the current job data fields in the job_exec table are updated as follows for this entity: Cur_wo_id = wo_id Cur_oper_id = oper_id Cur_seq_no = seq_no Cur_Step_No = 0 Cur_Step_Start = Current datetime Stored Procedure(s) Used SP_U_Job_Exec_StartJob Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>startjob</cmd> <session_id>1239</session_id> <ent_id>1</ent_id> <wo_id>xyz</wo_id>
2004 CIMNET Inc

www.CimnetInc.com

114

<oper_id>20</oper_id> <seq_no>0</seq_no> <status_notes></status_notes> <check_privs>1</check_privs> <check_certs>1</check_certs> <job_pos>0</job_pos> </request> Support in HTC file for Web Based Clients Yes. Job_exec.HTC supports this method. Optional parameters are required in this case.

EndJob Method
Purpose To end a job on an entity. Syntax EndJob (session_id, user_id, ent_id, wo_id, oper_id, seq_no, status_notes, check_privs, check_certs, client_type, job_pos) Parameters Part session_id Description Required. By Value. A long to identify the session from which the job is being ended. Required. By Value. A string to identify the user_id ending the job. Required. By Value. A long to identify the entity on which the job is to be ended. Optional. By Value. A variant (string) to identify the wo_id running on the entity Optional. By Value. A variant (string) to identify the oper_id running on the entity Optional. By Value. A variant (long) to identify the seq_no running on the entity. Optional. By Value. A variant (string) to include notes associated with the state change. Defaults to null. Optional. By Value. A variant (boolean) to specify whether the users privileges should be checked before executing this action. Defaults to False. Optional. By Value. A variant (boolean) to specify whether the produced quantities should be checked before allowing this job to be ended. Defaults to False.
www.CimnetInc.com

user_id ent_id

wo_id

oper_id

seq_no

status_notes

check_privs

check_certs

2004 CIMNET Inc

115

client_type

Optional. By Value. A Variant (long) to identify which client application is trying to end the job. Defaults to 37 (Operator) Optional. By Value. A long to identify the job position, if > 1 jobs are running on this entity

job_pos

Returns Integer. 0 if successful, else -1 Remarks The wo_id, oper_id and seq_no are all required to identify the job to be ended on the specified entity. If the specified job is NOT currently running on the specified entity then an exception is thrown with an appropriate error description. Similarly if the database update fails for any reason. If the call is successful the job table is updated as follows for the specified job: state_cd = 4 (COMPLETED) status_notes = status_notes act_finish_time = current datetime If the call is successful the current job data fields in the job_exec table are updated as follows for this entity: Cur_wo_id = Idle Cur_oper_id = Idle Cur_seq_no = 0 Cur_Step_No = Null Cur_Step_Start = Null If any Steps are currently active on the specified job then they are automatically ended (not implemented yet DB change) Stored Procedure(s) Used SP_U_Job_Exec_EndJob Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>endjob</cmd> <session_id>1239</session_id> <ent_id>1</ent_id> <wo_id>xyz</wo_id> <oper_id>20</oper_id> <seq_no>0</seq_no> <status_notes> </status_notes> <check_privs>1</check_privs> <check_certs>1</check_certs> <client_type>37</client_type> <job_pos>0</job_pos> </request>
2004 CIMNET Inc

www.CimnetInc.com

116

Support in HTC file for Web Based Clients Yes. Job_exec.HTC supports this method. Optional parameters are required ?

PauseJob Method
Purpose To Stop a RUNNING job on an entity. Used to Suspend, Put on Hold or return a Running job to the READY or NEW state. Syntax PauseJob (session_id, user_id, ent_id, wo_id, oper_id, seq_no, paused_job_state, status_notes, check_privs, job_pos) Parameters Part session_id Description Required. By Value. A long to identify the session from which the job is being paused. Required. By Value. A string to identify the user_id pausing the job. Required. By Value. A long to identify the entity on which the job is running. Required. By Value. A string to identify the wo_id Required. By Value. A string to identify the oper_id Required. By Value. . A long to identify the seq_no Required. By Value. . A long to identify the new state of the job. Valid values are 1 (NEW), 2 (READY), 4 (COMPLETE), 5 (SUSPENDED), 6 (ONHOLD) Optional. By Value. A variant (string) to include associated with the state change. Defaults to null. notes

user_id

ent_id

wo_id oper_id seq_no paused_job_state

status_notes

check_privs

Optional. By Value. A variant (boolean) to specify whether the users privileges should be checked before executing this action. Defaults to False. Optional. By Value. A long to identify the job position, if > 1 jobs are running on this entity

job_pos

Returns Integer. 0 if successful, else 1. Remarks The wo_id, oper_id and seq_no are all required to identify the job to be paused on the specified entity. If the specified job is NOT currently running on the specified entity then an exception is thrown with an
2004 CIMNET Inc

www.CimnetInc.com

117

appropriate error description. Similarly if the database update fails for any reason. If the paused_job_state parameter is invalid then it is defaulted to 5 (SUSPENDED). If the call is successful the job table is updated as follows for the specified job: state_cd = paused_job_state status_notes = status_notes act_finish_time = current datetime If the call is successful the current job data fields in the job_exec table are updated as follows for this entity: Cur_wo_id = Idle Cur_oper_id = Idle Cur_seq_no = 0 Cur_Step_No = Null Cur_Step_Start = Null Stored Procedure(s) Used sp_u_job_exec_PauseJob Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>pausejob</cmd> <session_id>1239</session_id> <ent_id>1</ent_id> <wo_id>xyz</wo_id> <oper_id>20</oper_id> <seq_no>0</seq_no> <paused_job_state>5</paused_job_state> <status_notes>Suspended due to lack of Materials</status_notes> <check_privs>1</check_privs> <job_pos>0</job_pos> </request> Support in HTC file for Web Based Clients Yes. Job_exec.HTC supports this method. Optional parameters are required ????

SplitJob Method
Purpose To split a job. Syntax SplitJob (session_id, wo_id, oper_id, orig_seq_no, user_id, split_qty, new_seq_no, split_start_qty, new_state_cd, req_finish_time, target_ent_id, status_notes) Parameters

2004 CIMNET Inc

www.CimnetInc.com

118

Part session_id

Description Required. By Value. A long to identify the session from which the job is being split. Required. By Value. A string to identify the wo_id Required. By Value. A string to identify the oper_id Required. By Value. A long to identify the seq_no from which the split is being made. Required. By Value. A string to identify the user creating this WO. Required. By Value. A double to identify the quantity of the job to be split to the new job. Optional. By Value. A variant (long) to identify the seq_no of the new job. Defaults to the lowest unused seq_no for the given wo and oper. Optional. By Value. A variant (double) to identify the start quantity of the job to be split to the new job. Defaults to null. Optional. By Value. The initial state of the new job as a variant (long). Only the following values are allowable: 1 (NEW), 2 (READY), 5 (SUSPENDED or 6 (ONHOLD). If not defined or invalid then defaults to the state of the current job, or default to 2 (READY) if the current job is any of 3 (RUNNING), 4 (COMPLETE) or 7 (CANCELLED). Optional. By Value. A variant (datetime) indicating the required finish time of the new job. Defaults to the date and time of the current job. Optional. By Value. A variant (long) specifying the entity on which the new job is targeted to run. Defaults to the target_ent_id for the current job. Optional. By Value. A variant (string) for the status_notes field. Defaults to Created by Job Split.

wo_id oper_id orig_seq_no

user_id split_qty

new_seq_no

split_start_qty

new_state_cd

req_finish_time

target_ent_id

status_notes Returns

The seq_no of the new job as an integer if successful ie. if it is >=0, else 1 if there was an error. Remarks This method allows the quantity required for job to be split into 2 jobs so that parts of it can be run on different machines. Eg. It is used when a user clicks on the Do Some button of the Job Start dialog box to do part of a job on a specific machine. The wo_id and oper_id (operation) are retained only a different seq_no is created for the new row in the job table. The split_qty must be < (req_qty qty_prod) of the existing job as the qty_reqd of the original job will be reduced by this amount.
2004 CIMNET Inc

www.CimnetInc.com

119

If the user_id is invalid or has insufficient privileges to split jobs then return an error. The optional parameters may be used to set certain values in the new job which may be different to the original. If they are not specified then the column values from the original job are used with the following exceptions: Run_ent_id = null sched_pinned = false Qty_prod = 0 Qty_prod_erp = null Qty_rejected = 0 Qty_ rejected_erp = null concurrent_link = 0 Act_start_time = null Act_finish_time = null sched_start_time = null sched_finish_time = null All rows in the following tables will also be cloned: job_bom, job_bom_step, job_spec, job_step, job_route and job_attr, with the following exceptions: JOB_ROUTE table: ?? Job_spec.act_spec_value is set = null Job_Spec.act_time is set = null Job_Spec.complete is set = 0 Stored Procedure(s) Used sp_I_Job_Exec_SplitJob (may use sp_I_job ?) Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>splitjob</cmd> <session_id>1239</session_id> <wo_id>xyz</wo_id> <oper_id>10</oper_id> <orig_seq_no>1</orig_seq_no> <user_id>user1</user_id> <split_qty>500</split_qty> <new_seq_no>2</new_seq_no> <split_start_qty></split_start_qty> <new_state_cd>2</new_state_cd> <req_finish_time>9/9/2001</req_finish_time> <target_ent_id>2</target_ent_id> <status_notes>Run Half on Machine 2</status_notes> </request>

CloneJob Method
2004 CIMNET Inc

www.CimnetInc.com

120

Purpose To clone a job and all of its dependent data. Syntax CloneJob ( session_id, wo_id, oper_id, seq_no, user_id, new_wo_id, new_oper_id, new_seq_no, req_qty, start_qty, req_finish_time, target_ent_id, status_notes) Parameters Part session_id Description Required. By Value. A long to identify the session from which the job is being cloned. Required. By Value. A string to identify the wo_id to be cloned Required. By Value. A string to identify the oper_id to be cloned Required. By Value. A long to identify the seq_no to be cloned Required. By Value. A string to identify the user performing this action. Optional. By Value. A variant (string) to identify the wo_id of the new job Optional. By Value. A variant (string) to identify the oper_id of the new job Optional. By Value. A variant (long) to identify the seq_no of the new job. NB. At least one of the new wo, oper or seq_no must be specified and different from the cloned values. Optional. By Value. A variant (double) to identify the required quantity of the new job. Defaults to same value as old job. Optional. By Value. A variant (double) to identify the start quantity of the new job. Defaults to same value as old job. Optional. By Value. The initial state of the new job as a variant (long). Only the following values are allowable: 1 (NEW), 2 (READY), 5 (SUSPENDED or 6 (ONHOLD). If not defined or invalid then defaults to the state of the current job, or default to 2 (READY) if the current job is any of 3 (RUNNING), 4 (COMPLETE) or 7 (CANCELLED). Optional. By Value. A variant (datetime) indicating the required finish time of the new job. Defaults to same value as old job. Optional. By Value. A variant (long) specifying the entity on which the new job is targeted to run. Defaults to same value as old job

wo_id oper_id seq_no user_id

new_wo_id

new_oper_id

new_seq_no

req_qty

start_qty

new_state_cd

req_finish_time

target_ent_id

2004 CIMNET Inc

www.CimnetInc.com

121

status_notes Returns

Optional. By Value. A variant (string) for the status_notes field. Defaults to Created by Job Clone.

Integer: 0 = success, else 1 if there was an error. Remarks This method allows a job to be cloned. It is used when a new WO is created based on an existing one (CloneWO) and also for entering rework etc. Also see SplitJob() for splitting a job. At least one of the new_wo_id, new_oper_id or new_seq_no optional parameters must be specified. If the new job exists in the database an exception will be thrown. Similarly if the job to be cloned does NOT exist. if a new_wo_id is specified then the oper_id and seq_no will remain same for the new job being created. If a new_wo_id is NOT specified then the wo_id and oper_id will stay the same and the next available seq_no (ie. new_seq_no) will be applied to the new job. If the user_id is invalid or has insufficient privileges to clone jobs then return an error. The optional parameters may be used to set certain values in the new job which may be different to the original. If they are not specified then the column values from the original job are used with the following exceptions: Run_ent_id = null sched_pinned = false Qty_prod = 0 Qty_prod_erp = null Qty_rejected = 0 Qty_ rejected_erp = null concurrent_link = 0 Act_start_time = null Act_finish_time = null sched_start_time = null sched_finish_time = null The latest start time will be calculated by using req_qty and req_finish_time All rows in the following tables will also be cloned: job_bom, job_bom_step, job_spec, job_step, job_route and job_attr, with the following exceptions: JOB_ROUTE table: Here if the new_wo_id is same as wo_id (just clone a job) then insert new record with new seq_no, everything else remains same. If new_wo_id is different then wo_id (clone to a new work order), we have to clone the input JOB row before we can clone a row in the job_route**. Job_spec.act_spec_value is set = null Job_Step.act_time is set = null Job_ Step.complete is set = 0 Stored Procedure(s) Used sp_I_Job_Exec_CloneJob, + others Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job_exec</object>
2004 CIMNET Inc

www.CimnetInc.com

122

<msgtype>exec</msgtype> <cmd>clonejob</cmd> <session_id>1239</session_id> <wo_id>xyz</wo_id> <oper_id>10</oper_id> <seq_no>1</seq_no> <user_id>user1</user_id> <new_wo_id>2</new_wo_id> <new_oper_id>2</new_oper_id> <new_seq_no>2</new_seq_no> <req_qty>500</req_qty> <start_qty></start_qty> <new_state_cd>2</new_state_cd> <req_finish_time>9/9/2001</req_finish_time> <target_ent_id>2</target_ent_id> <status_notes></status_notes> </request>

CreateWOfromProcess Method
Purpose To create instance data for a WO based on a given process_id and other WO instance specific data. Syntax CreateWOfromProcess (session_id, wo_id, process_id, item_id, req_qty, user_id, start_qty, init_wo_state, wo_desc, release_time, req_finish_time, wo_priority, cust_info, mo_id, notes) Parameters Part session_id Description Required. By Value. A long to identify the session from which the WO is being created. Required. By Value. A string to identify the wo_id Required. By Value. A string to identify the process_id from which this WO is being created. Required. By Value. A string to identify the final item_id to be made by this WO. (Remember that the same process may be used to make multiple items) Required. By Value. A double to identify the quantity of the final item to be made. Required. By Value. A string to identify the user creating this WO. Optional. By Value. A variant (double) for the required start qty. Defaults to null.
www.CimnetInc.com

wo_id process_id

item_id

req_qty

user_id start_qty

2004 CIMNET Inc

123

init_wo_state

Optional. By Value. A variant (long) for the initial state of all jobs for the WO. Defaults to NEW (1). Optional. By Value. A variant (string) for the WO description. Defaults to the wo_id. Optional. By Value. A variant (datetime) indicating the release time of the WO. Defaults to the current date and time. Optional. By Value. A variant (datetime) indicating the required finish time of the WO. Defaults to the current date and time + 24 hours. Optional. By Value. A variant (long) for the priority of the WO and all its Jobs. Defaults to 1. Optional. By Value. A variant (string) for the customer information field. Defaults to . Optional. By Value. A variant (string) for the manufacturing order field. Defaults to . Optional. By Value. A variant (string) for the WO notes. Defaults to .

wo_desc

release_time

req_finish_time

wo_priority

cust_info

mo_id

notes

Returns Integer. 0 if successful, else -1 Remarks The following tables are populated with the instance specific WO data: wo, job, job_route, job_step, job_spec, job_bom and job_bom_step. BOM, step and spec data is only populated if defined in the template tables (bom_item, bom_item_oper_link, bom_item_oper_step_link, oper_step, oper_step_ent_exc, oper_ent_spec etc) Stored Procedure(s) Used sp_I_Job_Exec_CWOFP_Stack sp_Build_Job sp_Build_BOM sp_BI_to_Job_BOM sp_CALL_build_BOM_with_proper_START_QTY sp_BIOS_to_Job_spec sp_BIOSL_to_Job_BOM_step sp_LOOK_job_route_table Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype>
2004 CIMNET Inc

www.CimnetInc.com

124

<cmd>createwofromprocess</cmd> <session_id>1248</session_id> <wo_id>xyz</wo_id> <process_id>CanFilling</process_id> <item_id>CokeCases</item_id> <req_qty>1000</req_qty> <user_id>user1</user_id> <start_qty> </start_qty> <init_wo_state>2</init_wo_state> <wo_desc>Job for ABC</wo_desc> <release_time></release_time> <req_finish_time>9/9/2001</req_finish_time> <wo_priority></wo_priority> <cust_info></cust_info> <mo_id></mo_id> <notes></notes> </request>

CloneWO Method
Purpose To clone a WO and all its instance specific data based on an existing WO. Syntax CloneWO ( session_id, new_wo_id, existing_wo_id, user_id, req_qty, wo_desc, release_time, req_finish_time, wo_priority, cust_info, mo_id, notes) Parameters Part session_id Description Required. By Value. A long to identify the session from which the WO is being cloned. Required. By Value. A string to identify the new wo_id Required. By Value. A string to identify the wo_id from which this WO is being cloned. Required. By Value. A string to identify the user creating this WO. Optional. By Value. A variant (double) to identify the quantity of the final item to be made. Defaults to req_qty value for existing WO. Optional. By Value. A variant (string) for the WO description. Defaults to the wo_id. Optional. By Value. A variant (datetime) indicating the release time of the WO. Defaults to the current date and time.
www.CimnetInc.com

new_wo_id existing_wo_id

user_id req_qty

wo_desc

release_time

2004 CIMNET Inc

125

req_finish_time

Optional. By Value. A variant (datetime) indicating the required finish time of the WO. Defaults to the current date and time + 24 hours. Optional. By Value. A variant (long) for the priority of the WO and all its Jobs. Defaults to value for existing WO. Optional. By Value. A variant (string) for the customer information field. Defaults to . Optional. By Value. A variant (string) for the manufacturing order field. Defaults to . Optional. By Value. A variant (string) for the WO notes. Defaults to .

wo_priority

cust_info mo_id

notes

Returns Integer. 0 if successful, else -1 Remarks The following tables are populated with the instance specific data for the new WO if such data exists for the existing WO: wo, job, job_route, job_step, job_spec, job_bom and job_bom_step. If the user_id is invalid or has insufficient privileges to create a WO then return an error. Stored Procedure(s) Used sp_I_Job_Exec_CloneWO Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows:
<?xml version="1.0"?> <request> <object>job_exec</object> <cmd>clonewo</cmd>

<msgtype>exec</msgtype> <session_id>1239</session_id>
<new_wo_id>xyz</new_wo_id> <existing_wo_id>abc</existing_wo_id> <user_id>user1</user_id> <req_qty>1000</req_qty> <wo_desc>Job for ABC</wo_desc> <release_time></release_time> <req_finish_time>9/9/2001</req_finish_time> <wo_priority></wo_priority> <cust_info></cust_info> <mo_id></mo_id> <notes></notes> </request>

2004 CIMNET Inc

www.CimnetInc.com

126

SetCurLotData Method
Purpose To set the current lot, container, production code, storage location etc for production or consumption data on a given entity. Syntax SetCurLotData ( session_id, user_id, ent_id, bom_pos, cur_item_id, cur_lot_no, cur_reas_cd, cur_storage_ent_id, cur_update_inv, cur_backflush, job_pos) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string to identify the user. Required. By Value. A long to identify the entity. Optional. By Value. A long. =0 for the current main production item, >0 for consumption items to identify which BOM component, <0 for byproducts to identify the byproduct. Defaults to 0.
Optional. By Value. A variant (string) to identify the new item_id being produced or consumed for this BOM position on this entity. If omitted the current value is not affected. This allows the current item to be changed during production if required.

user_id ent_id bom_pos

cur_item_id

cur_lot_no

Optional. By Value. A variant (string) to identify the new lot number for this BOM position on this entity. If omitted the current value is not affected.

cur_reas_cd

Optional. By Value. A variant (long) to identify the new reason code (production or consumption code or waste / reject reason) for this BOM position on this entity. If omitted the current value is not affected.

cur_storage_ent_id

Optional. By Value. A variant (long) to identify the storage entity produced to or consumed from for this BOM position on this entity. If omitted the current value is not affected.

cur_update_inv

Optional. By Value. A variant (boolean) to flag whether quantities produced or consumed at this BOM position on this entity should update inventory quantities or not. If omitted the current value is not affected.

cur_backflush

Optional. By Value. A variant (boolean) to flag whether quantities produced at this BOM position = 0 (only affects main produced good

2004 CIMNET Inc

www.CimnetInc.com

127

only) on this entity should backflush standard consumption quantities or not. If omitted the current value is not affected.

job_pos

Optional. By Value. A long to identify the job position, if > 1 jobs are running on this entity

Returns Integer. 0 if successful, else -1 Remarks This method is useful when quantities are received directly from counters etc on the production line, but the lot numbers, containers etc are specified independently of those counters This method does not add any production quantities, it just sets the current values so the next time quantities are received via the AddProd method these values are applied (assuming they are not specified in the AddProd method in which case the specified values take precedence and replace these ones). This method will update the values even if no job is currently running on the entity, however when a job is started it may have values defined that automatically set these values for that particular job. Thus its real benefit is modifying all or some of these values once a job is running on an entity. Stored Procedure(s) Used sp_U_Job_Exec_SetCurLotData Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>setcurlotdata</cmd> <session_id>1239</session_id> <ent_id>1</ent_id> <bom_pos>0</bom_pos> <cur_item_id></cur_item_id> <cur_lot_no>lotabc</cur_lot_no> <cur_reas_cd></cur_reas_cd> <cur_storage_ent_id>2</cur_storage_ent_id> <cur_update_inv></cur_update_inv> <cur_backflush></cur_backflush> <job_pos>0</job_pos> </request>

AddProd Method
Purpose To capture production data for the running job on the specified entity. Syntax AddProd (session_id, user_id, ent_id, qty_prod, reas_cd, lot_no, rm_lot_no, to_ent_id, item_id, byproduct_bom_pos, ext_ref, apply_scaling_factor, spare1, spare2, spare3, spare4, job_pos,
2004 CIMNET Inc

www.CimnetInc.com

128

row_id) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string to identify the user. Required. By Value. A long to identify the entity. Required. By Value. A double specifying the production quantity to be added Optional. By Value. A variant (long) to identify the reason code for this quantity produced (production code or reject reason). Defaults to last used reas_cd on this entity. Optional. By Value. A variant (string) to identify the lot number for this quantity produced. Defaults to last used lot_no on this entity. Optional. By Value. A variant (string) to identify the raw material lot no from which this lot was produced. Only valid for disassembly operations. Not currently used. Optional. By Value. A variant (long) to identify the storage entity for this quantity produced. Defaults to last used storage entity used by this entity. Optional. By Value. A variant (string) to identify the item being produced. Defaults to the last produced item on this entity. Optional. By Value. A variant (long) to specify the bom_pos if this is a byproduct (for eg., -1, -2, -3, etc..). Defaults to Null (not a byproduct) Optional. By Value. A variant (string) to specify an external reference for this row. Defaults to Null. Optional. By Value. A variant (Boolean) to specify whether to apply scaling factor or not. Defaults to 0 Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to Null. Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to Null. Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to Null.
www.CimnetInc.com

user_id ent_id qty_prod

reas_cd

lot_no

rm_lot_no

to_ent_id

item_id

byproduct_bom_pos

ext_ref

apply_scaling_factor

spare1

spare2

spare3

2004 CIMNET Inc

129

spare4

Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to Null. Optional. By Value. A variant (long) to identify the job position, if > 1 jobs are running on this entity Optional. By Ref. A variant (long) to return the row_id of the row that was just inserted or updated if this call was successful.

job_pos

row_id

Returns Integer. 0 if successful, else -1 Remarks There must be a job running on the specified entity or an error will be returned. Use the AddProdPostExec() method to enter production after a job has finished running on an entity. The current shift and job details default to the current values for the entity. If any of the lot, reason code or entity values are specified then these values are used for this transaction in place of the default ones stored in the job_bom table. These changes are NOT saved to the job_bom table to be used as the defaults for future transactions. If you wish to change the defaults then use the SetCurLotData() method. The low number of required parameters are designed to facilitate capturing production data from the I/O system via tags as simply as possible. If a row already exists for the primary key values supplied (or defaulted) then this quantity will be added to the existing row. In this case the other specified dependent fields (to_ent_id, ext_ref, spare values etc) are also updated for this row (ie. Including previous quantities). For any optional parameters that are not specified the existing values are left unchanged. If a positive amount of good production is being added, it also checks to see whether there is now enough good product available to ready the next job(s) downstream if its state is currently NEW. This check will eventually encompass all materials, whether produced or merely in inventory. For now, it only checks on materials produced this the same WO. This means finding each next job downstream via the job_route table, and getting its job_bom records excluding those for byproducts (i.e. get those which have a bom_pos greater than or equal to zero). For every item with a non-zero reqd_start_val, a check is made of the item_prod table for the jobs feeding this one, to see whether they have produced enough for this work order to meet this requirement. If all requirements are met, the jobs state is changed to READY. In deciding whether there has been sufficient production, if reqd_start_val_is_pct is true, the effective required quantity for a particular bom_pos is found by multiplying reqd_start_val by qty_per_parent_item and multiplying the result by the jobs qty_at_start. If reqd_start_val_is_pct is false, the effective required quantity is the reqd_start_val. All requirements for a given item_id are then totaled across all bom_pos values. The production to count against this items requirement is found by adding up all production for any job feeding the downsteam one (which will include the job for which production was initially entered), and multiplying it by job_route.input_pct (expressed as a fraction), which is the portion of the upstream jobs production that goes to the downstream job. Then the resulting effective production is added for all jobs producing the same item, and compared to each item requirement. If all item productions are equal to or greater than all item requirements, the jobs state is changed to 2 (READY). If the update_inv flag is set for this produced item then the qty_left field in the item_inv table will be increased by the produced qty_prod. If a negative amount of good production is added, a check must be made to see whether there is still enough good product available to ready the next job(s) downstream if its state is currently other than NEW or CANCELLED. This check need only consider the material produced in the current job. As with the check to ready a job, this will mean finding each next job downstream via the job_route table, and
2004 CIMNET Inc

www.CimnetInc.com

130

getting its job_bom records for this item, then checking the item_prod table for the jobs feeding this one, to see whether they have produced enough for this work order to meet this requirement. If this requirement is no longer met, the downstream jobs state is changed back to NEW if it is currently READY. Otherwise a warning is returned saying that because the job was already started it could not be un-readied.If the backflush flag is set for any of the BOM items for this job then consumption transactions will be generated to consume the materials at standard rates. Similarly, if the update_inv flag is set for any of these BOM items then inventory adjustment transactions will also be applied automatically. Stored Procedure(s) Used sp_I_Item_Prod_AddProd Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>addprod</cmd> <session_id>1239</session_id> <ent_id>1</ent_id> <qty_prod>10.54</qty_prod> <session_id>23</session_id> <user_id>111</user_id> <reas_cd></reas_cd> <item_id></item_id> <lot_no>lotabc</lot_no> <to_ent_id>2</ to_ent_id> <byproduct_bom_pos></byproduct_bom_pos> <ext_ref></ext_ref> <apply_scaling_factor>0</apply_scaling_factor> <spare1></spare1> <spare2></spare2> <spare3></spare3> <spare4></spare4> <job_pos>0</job_pos> </request>

AddProdPostExec Method
Purpose To enter production data for a given job, shift, production code, lot and container in the production transaction table AFTER the job has run on an entity. Syntax AddProdPostExec (session_id, user_id, ent_id, qty_prod, wo_id, oper_id, seq_no, shift_start, shift_id, item_id, reas_cd, lot_no, rm_lot_no, to_ent_id, processed, byproduct, ext_ref, move_status, spare1, spare2, spare3, spare4) Parameters

2004 CIMNET Inc

www.CimnetInc.com

131

Part session_id

Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string to identify the user. Required. By Value. A long to identify the entity. Required. By Value. A double specifying the production quantity to be added Required. By Value. A string to identify the wo_id. Required. By Value. A string to identify the oper_id. Required. By Value. A long to identify the seq_no. Required. By Value. A date to specify the shift during which this production occurred. Required. By Value. A long to specify the shift on the entity. Optional. By Value. A variant (string) to identify the item being produced. Defaults to current value in the job_bom table. Optional. By Value. A variant (long) to specify the reason code for this quantity produced (production code or reject reason). Defaults to current value in the job_bom table. Optional. By Value. A variant (string) to identify the lot number for this quantity produced. Defaults to current value in the job_bom table. Optional. By Value. A variant (string) to identify the lot number of the raw material from which this lot was produced. Only valid for disassembly operations. Not currently used. Optional. By Value. A variant (long) to identify the storage entity for this quantity produced. Defaults to current value in the job_bom table. Optional. By Value. A variant (boolean) to specify the processed flag value for this quantity produced. Defaults to last No (0). Optional. By Value. A variant (boolean) to specify whether this is a byproduct or not. Defaults to NO (0). Optional. By Value. A variant (string) to specify an external reference for this row. Defaults to null. Optional. By Value. A variant (integer) to specify the move status of this row. Defaults to 0.

user_id ent_id qty_prod

wo_id oper_id seq_no shift_start

shift_id item_id

reas_cd

lot_no rm_lot_no

to_ent_id

processed

byproduct

ext_ref

move_status

2004 CIMNET Inc

www.CimnetInc.com

132

spare1

Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to null. Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to null. Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to null. Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to null.

spare2

spare3

spare4

Returns Integer. 0 if successful, else -1 Remarks The shift and job values are required parameters as the data is being entered after the fact. The optional parameters are detailed as specified above if they are not specifically included. If a row already exists for the primary key values supplied (or defaulted) then this quantity will be added to the existing row. In this case the other non-defaulted dependent fields (to_ent_id, processed flag etc) for the ENTIRE row (ie. Including previous quantities) will be changed to those specified by this call. If the update_inv flag is set for this produced item in the job_bom table then the qty_left field in the item_inv table will be increased by the produced qty_prod. If the backflush flag is set for any of the BOM items in the job_bom table for this job then consumption transactions will be generated to consume the materials at standard rates. Similarly, if the update_inv flag is set for any of these BOM items then inventory adjustment transactions will also be applied automatically. Stored Procedure(s) Used Sp_I_item_prod_AddProdPostExec Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>job_exec</object> <cmd>addprodpostexec</cmd> <msgtype>exec</msgtype> <session_id>1239</session_id> <ent_id>1</ent_id> <qty_prod>10.54</qty_prod> <session_id>23</session_id> <user_id>111</user_id> <wo_id>xyz</wo_id> <oper_id>20</oper_id> <seq_no>0</seq_no> <shift_start></shift_start> <shift_id></shift_id> <reas_cd></reas_cd>
2004 CIMNET Inc

www.CimnetInc.com

133

<lot_no>lotabc</lot_no> <to_ent_id>2</ to_ent_id> <item_id></item_id> <processed>0</processed> <byproduct>0</byproduct> <ext_ref></ext_ref> <move_status>0</move_status> <spare1></spare1> <spare2></spare2> <spare3></spare3> <spare4></spare4> </request>

AddCons Method
Purpose To capture consumption data for the RUNNING job on the specified entity. Syntax AddCons (session_id, user_id, ent_id, bom_pos, qty_cons, reas_cd, lot_no , fg_lot_no, from_ent_id, item_id, ext_ref, apply_scaling_factor, spare1, spare2, spare3, spare4, job_pos, row_id) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string to identify the user. Required. By Value. A long to identify the entity. Required. By Value. A long to identify the BOM position on the entity. Required. By Value. A double specifying the consumption quantity to be added Optional. By Value. A variant (long) to identify the reason code for this quantity consumed (consumption code or waste reason). Defaults to last used reas_cd for this bom_pos on this entity. Optional. By Value. A variant (string) to identify the lot number for this quantity consumed. Defaults to last used lot_no for this bom_pos on this entity. Optional. By Value. A variant (string) to identify the lot number of the MAIN produced item for this quantity consumed. Defaults to 134

user_id ent_id bom_pos

qty_cons

reas_cd

lot_no

fg_lot_no

2004 CIMNET Inc

www.CimnetInc.com

default used lot_no for the produced item on this entity. from_ent_id Optional. By Value. A variant (long) to identify the storage entity from which this quantity was consumed. Defaults to default storage entity used for this bom_pos on this entity. Optional. By Value. A variant (string) to identify the item being consumed. Defaults to the last consumed item for this bom_pos on this entity. Optional. By Value. A variant (string) to specify an external reference for this row. Defaults to null. Optional. By Value. A variant (Boolean) to specify whether to apply scaling factor or not. Defaults to 0 Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to Null. Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to Null. Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to Null. Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to Null. Optional. By Value. A variant (long) to identify the job position, if > 1 jobs are running on this entity Optional. By Ref. A variant (long) to return the row_id of the row that was just inserted or updated if this call was successful.

item_id

ext_ref

apply_scaling_factor

spare1

spare2

spare3

spare4

job_pos

row_id

Returns Integer. 0 if successful, else -1 Remarks There must be a job running on the specified entity or an error will be returned. Use the AddConsPostExec() method to enter production after a job has finished running on an entity. The current shift and job details default to the current values for the entity. If any of the lot, container, reason code or entity values are specified then these values are used for this transaction in place of the default ones stored in the job_bom table. If the current job _bom has a substitution (job_bom.current_subst) which matches a record in job_bom_subst table, then the default values are used from job_bom_subst table. These changes are NOT saved to the job_bom table for this bom_pos to be used as the defaults for future transactions. If you wish to change the defaults then use the SetCurProdData() method. Tha same applies if the fg_lot_no field changes. The low number of required parameters are designed to facilitate capturing consumption data from the I/O system via tags as simply as possible. If a row already exists for the primary key values supplied (or defaulted) then this quantity will be added
2004 CIMNET Inc

www.CimnetInc.com

135

to the existing row. In this case the other specified dependent fields (from_ent_id, ext_ref, spare values etc) are also updated for this row (ie. Including previous quantities). For any optional parameters that are not specified the existing values are left unchanged. If the update_inv flag is set for this BOM position then the qty_left field in the item_inv table will be reduced by the consumed qty_cons. Stored Procedure(s) Used sp_I_Item_Cons_AddCons Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>addcons</cmd> <session_id>23</session_id> <user_id>111</user_id> <ent_id>1</ent_id> <bom_pos>1</bom_pos> <qty_cons>10.54</qty_cons> <reas_cd></reas_cd> <lot_no>lotabc</lot_no> <fg_lot_no></fg_lot_no> <from_ent_id>2</from_ent_id> <item_id></item_id> <ext_ref></ext_ref> <spare1></spare1> <spare2></spare2> <spare3></spare3> <spare4></spare4> <job_pos>0</job_pos> </request>

AddConsPostExec Method
Purpose To enter consumption data for a given job, shift, production code, lot and container in the production transaction table AFTER the job has run on an entity. Syntax AddConsPostExec (session_id, user_id, ent_id, , qty_cons, wo_id, oper_id, seq_no, shift_start, shift_id, bom_pos, item_id, reas_cd, lot_no, fg_lot_no, from_ent_id, ext_ref, spare1, spare2, spare3, spare4) Syntax Parameters Part
2004 CIMNET Inc

Description
www.CimnetInc.com

136

session_id

Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string to identify the user. Required. By Value. A long to identify the entity. Required. By Value. A double specifying the consumption quantity to be added Required. By Value. A string to identify the wo_id. Required. By Value. A string to identify the oper_id. Required. By Value. A long to identify the seq_no. Required. By Value. A date to specify the shift during which this production occurred. Required. By Value. A long to specify the shift on the entity. Optional. By Value. A long to identify the BOM position on the entity. Optional. By Value. A variant (string) to identify the item being consumed. Defaults to current value in the job_bom table. Optional. By Value. A variant (long) to specify the reason code for this quantity consumed (consumption code or waste reason). Defaults to current value in the job_bom table. Optional. By Value. A variant (string) to identify the lot number for this quantity consumed. Defaults to current value in the job_bom table. Optional. By Value. A variant (string) to identify the lot number of the MAIN produced item for this quantity consumed. Defaults to current value in the job_bom table where bom_pos = 0. Optional. By Value. A variant (long) to identify the storage entity for this quantity consumed. Defaults to current value in the job_bom table. Optional. By Value. A variant (string) to specify an external reference for this row. Defaults to null. Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to null. Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to null. Optional. By Value. A variant (string) to include optional spare
www.CimnetInc.com

user_id ent_id qty_cons

wo_id oper_id seq_no shift_start

shift_id bom_pos

item_id

reas_cd

lot_no

fg_lot_no

from_ent_id

ext_ref

spare1

spare2

spare3
2004 CIMNET Inc

137

fields for this row. Defaults to null. spare4 Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to null.

Returns Integer. 0 if successful, else -1 Remarks If the wo details are not provided they default to the current job running on the entity. If no job is currently running or they do not match the job currently running on the entity then an exception is thrown. Similarly if an invalid bom_pos value is specified. If any of the lot, container, reason code or entity value changes, then these changes are written to the database (job_bom table) and used as the defaults for future transactions where the defaults are to be applied. The low number of required parameters are designed to facilitate capturing consumption data from the I/O system via tags as simply as possible. If the fg_lot_no field changes, then this change is remembered for the item being produced. This is as if the lot number was changed using the AddProd() or SetCurProdData() methods. If a row already exists for the primary key values supplied (or defaulted) then this quantity will be added to the existing row. In this case the other non-defaulted dependent fields (from_ent_id, processed flag etc) for the ENTIRE row (ie. Including previous quantities) will be changed to those specified by this call. If the update_inv flag is set for this BOM position then the qty_left field in the item_inv table will be reduced by the consumed qty_cons. Stored Procedure(s) Used Sp_I_Item_Cons_AddConsPostExec Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>addcons</cmd> <session_id>23</session_id> <user_id>111</user_id> <ent_id>1</ent_id> <bom_pos>1</bom_pos> <qty_cons>10.54</qty_cons> <wo_id>xyz</wo_id> <oper_id>20</oper_id> <seq_no>0</seq_no> <shift_start></shift_start> <shift_id></shift_id> <item_id></item_id> <reas_cd></reas_cd> <lot_no>lotabc</lot_no> <fg_lot_no></fg_lot_no>
2004 CIMNET Inc

www.CimnetInc.com

138

<from_ent_id>2</from_ent_id> <ext_ref></ext_ref> <spare1></spare1> <spare2></spare2> <spare3></spare3> <spare4></spare4> </request>

RejectProd Method
Purpose To reject all or part of an existing row in the production transaction table (item_prod) for a specified reject reason. The quantity that is rejected may result in a new row or it may simply add to another existing row if the primary key fields matches. Syntax RejectProd (session_id, row_id, reject_qty, new_reas_cd, new_item_id, new_lot_no, new_user_id, new_to_ent_id) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A long to identify the existing item_prod record. Required. By Value. A double specifying the reject quantity Must be less than or equal to the current quantity for this row. Required. By Value. A variant (long) to identify the reason code for this rejected quantity. Optional. By Value. A variant (string) to identify the new item_id. Defaults to the value in the existing row. Optional. By Value. A variant (string) to identify the new lot number for this quantity produced. Defaults to the value in the existing row. Optional. By Value. A variant (string) to change the user for this rejected quantity. Defaults to the value in the existing row. Optional. By Value. A variant (long) to identify the new storage entity for the split quantity. Defaults to the value in the existing row.

row_id

reject_qty

new_reas_cd

new_item_id

new_lot_no

new_user_id

new_to_ent_id

Returns

2004 CIMNET Inc

www.CimnetInc.com

139

Integer. 0 if successful, else -1 Remarks The required fields identify the current row and the quantity to be rejected. The rejected quantity must be less than or equal to the qty_prod value in the existing row. (Rejecting the full quantity is equivalent to simply updating the existing row) The new_reas_cd must exist in the database otherwise an error is returned. If it exists then it will be used to determine the grade_cd, status_cd and good_prod flag for the split row. All optional fields default to the value in the existing row if they are not included. If a row already exists in the database for the rejected row, then the rejected quantity will simply be added to the existing row. If any other optional dependent fields are specified then they will also be changed for the rejected row. NB This may overwrite existing dependent data for the destination row. If the new_item_id value is specified then it must exist in the database otherwise an error is returned. The ext_ref, move_status and spare fields are set to the current values in the existing row. The last_edit_at field of the new row is set to the current datetime. Stored Procedure(s) Used This method delegates to the item_prod.Split method which uses Sp_I_item_prod_Split. Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>rejectprod</cmd> <session_id>123</session_id> <row_id>456</row_id> <reject_qty>5.14</reject_qty> <new_reas_cd>123</new_reas_cd> <new_item_id></new_item_id> <new_lot_no></new_lot_no> <new_user_id></new_user_id> <new_to_ent_id></new_to_ent_id> </request>

VerifyProcess Method
Purpose To verify that a specified process and all its dependent operations and associated data is valid. Syntax VerifyProcess (process_id) Parameters Part process_id Description Required. By Value. A string to identify the process to be verfied.

2004 CIMNET Inc

www.CimnetInc.com

140

Returns Boolean, true if process is valid, otherwise throws an exception detailing the error. Remarks Checks the following characteristics of a process: Stored Procedure(s) Used sp_S_job_exec_VerifyProcess Access via Director.cls using ExecuteXMLCmd() Yes. The XML command must be formatted as follows: <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>Exec</msgtype > <cmd>VerifyProcess</cmd> <process_id>MakeWindow</process_id> </request> That appropriate routing data has been configured in the oper_ent_route table. that there exist a first and last operation. If either of these is missing it attempts to set them in the appropriate operations provided that the routing data has been entered correctly.

StartStep Method
Purpose To start a Step for the job currently running on a given entity. Syntax StartStep (session_id, user_id, ent_id, step_no, lot_no, state_cd, check_cert, labor_option, job_pos) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string to identify the user starting the step Required. By Value. A long to identify the entity on which the Step is to be started. This will identify the job which contains this step. Required. By Value. A string to identify the step being started Required. By Value. A string to identify the lot on which this step is being performed. Optional. By Value. A variant (long) to specify the state of this step.

user_id ent_id

step_no lot_no

state_cd

2004 CIMNET Inc

www.CimnetInc.com

141

Only 3 (RUNNING) or 8 (BYPASSED) are allowed. Defaults to RUNNING. check_cert Optional. By Value. A variant (boolean) to specify whether to perform certification checks on this user before starting the step. Defaults to False. (Requires Certification option to be licensed) Optional. By Value. A variant (boolean) to specify whether to capture labor usage by the step or not. Defaults to False. (Requires Labor option to be licensed) Optional. By Value. A long to identify the job position, if > 1 jobs are running on this entity

labor_option

job_pos

Returns Integer. 0 if successful, else -1 Remarks This method starts a Step for the running job on an entity. If the specified job is not running on the entity then an exception is thrown with an appropriate error message. If the check_cert flag is true then this users certifications are checked against any required certification(s) to start the step, and an error is returned if they are not satisfied. It is permissible to start a step that has previously started provided its state is COMPLETE or BYPASSED. An error is also returned if this step is already RUNNING. An error is returned if all preceding steps within this group for this lot_no have not already been Completed or Bypassed, or if preceding steps within ALL preceding groups have not been Completed or Bypassed. If this step has never been started on this lot_no then a new row is now added to the job_step_data table. If it has previously been started then the state_cd and start_user_id fields of the existing row are updated to the new values. If the Labor_option flag is true then this method will also log this user into this step for the purposes of capturing labor usage against the step. This is equivalent to calling the StepLogin() method. (Future). If the Tag Engine option is licensed and any of the steps spare fields are mapped to tags then the values for this step are automatically written to tags. Note: this is only practical if you only have a single step / lot_no running at a time. Stored Procedure(s) Used SP_U_Job_Step_StartStep Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>startstep</cmd> <session_id>1248</session_id> <user_id>111</user_id> <ent_id>1</ent_id> <step_no>2</step_no>
2004 CIMNET Inc

www.CimnetInc.com

142

<lot_no>SN1234</lot_no> <state_cd>3</state_cd> <cert_check>1</cert_check> <labor_option>0</labor_option> <job_pos>0</job_pos> </request>

StopStep Method
Purpose To End or Bypass a Step for the running job on a given entity. Syntax StopStep (session_id, user_id, ent_id, step_no, lot_no, state_cd, check_cert, labor_option, job_pos) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string to identify the user stopping the step Required. By Value. A long to identify the entity on which the Step is to be stopped. This will identify the job which contains this step. Required. By Value. A string to identify the step being stopped Required. By Value. A string to identify the lot on which this step has being performed. Optional. By Value. A variant (long) to specify the state of this step. Only 4 (COMPLETE) or 8 (BYPASSED) are allowed. Defaults to COMPLETE. Optional. By Value. A variant (boolean) to specify whether to that required certification signoff checks have been completed before stopping the step. Defaults to False. (Requires Certification option to be licensed) Optional. By Value. A variant (boolean) to specify whether to end labor usage capture. Defaults to False. Must be true if the step was started with this flag = True. (Requires Labor option to be licensed) Optional. By Value. A long to identify the job position, if > 1 jobs are running on this entity

user_id ent_id

step_no lot_no

state_cd

check_cert

labor_option

job_pos

Returns Integer. 0 if successful, else -1


2004 CIMNET Inc

www.CimnetInc.com

143

Remarks This method Stops a Step for the running job on an entity. If the specified job is not running on the entity then an exception is thrown with an appropriate error message. An error is returned if this step is not currently RUNNING, or if any other users are still logged onto this step / lot combination. If the check_cert flag is true and this step is being Completed then check that all required certification signoff(s) for the step have been completed. An error is returned if they are not all completed. An error is returned if this step is being Completed and data should have been entered for the step (enter_data flag = True) but has not yet been entered. Similarly, if form_data should have been entered and has not been. The state_cd, act_finish_time and finish_user_id fields of the existing row are updated. If the Labor_option flag is true then this method will also log this user out of this step. This is equivalent to calling the StepLogout() method. (Future) If the Tag Engine option is licensed and any of the steps spare fields are mapped to tags then NULL values for this step are automatically written to tags to indicate to the process that the step has stopped. Note: this is only practical if you only have a single step / lot_no running at a time. Stored Procedure(s) Used sp_U_Job_Step_StopStep Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>stopstep</cmd> <session_id>1248</session_id> <user_id>111</user_id> <ent_id>1</ent_id> <step_no>2</step_no> <lot_no>SN1234</lot_no> <state_cd>4</state_cd> <cert_check>1</cert_check> <labor_option>0</labor_option> <job_pos>0</job_pos> </request>

UpdateStepData Method
Purpose To enter or update data for a Step / Lot combination for the running job on a given entity. Syntax UpdateStepData (session_id, user_id, ent_id, step_no, lot_no, data, job_pos) Parameters Part
2004 CIMNET Inc

Description
www.CimnetInc.com

144

session_id

Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string to identify the user entering the data Required. By Value. A long to identify the entity on which the Step is being done. This will identify the job which contains this step. Required. By Value. A string to identify the step Required. By Value. A string to identify the lot on which this step is being performed. Required. By Value. A string to specify the data to be saved for this step / lot. Optional. By Value. A long to identify the job position, if > 1 jobs are running on this entity

user_id ent_id

step_no lot_no

data

job_pos

Returns Integer. 0 if successful, else -1 Remarks This method allows data to be captured for this step / lot combination. If a job is not running on the entity then an exception is thrown with an appropriate error message. An error is returned if this step is not currently RUNNING. An error is returned if this user is not the same user that FIRST entered data for this step The step_data, step_data_time and data_user_id fields of the existing row are updated. Stored Procedure(s) Used sp_U_Job_Step_UpdateStepData Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>UpdateStepData</cmd> <session_id>1248</session_id> <user_id>111</user_id> <ent_id>1</ent_id> <step_no>2</step_no> <lot_no>SN1234</lot_no> <data>kjhghsdjgahjk</data> <job_pos>0</job_pos> </request>

StepLogin Method
2004 CIMNET Inc

www.CimnetInc.com

145

Purpose To log a user into a Step / Lot for the purposes of capturing labor with respect to the step / lot. Syntax StepLogin (session_id, user_id, ent_id, step_no, lot_no, lab_cd, dept_id, event_time, job_pos) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string to identify the user working on the step Required. By Value. A long to identify the entity on which the Step is being done. This will identify the job which contains this step. Required. By Value. A string to identify the step being worked on Required. By Value. A string to identify the lot on which this step is being performed. Optional. By Value. A variant (long) to specify the labor code being performed on this step. Defaults to current labor code for this user on the entity. Optional. By Value. A variant (long) to specify the dept_id to which this labor is chargeable. Defaults to current dept_id for this user on the entity. Optional. By Value. A variant (datetime) to specify the start time of this labor. Used to synchronize times if required. Defaults to Now. Optional. By Value. A long to identify the job position, if > 1 jobs are running on this entity

user_id

ent_id

step_no lot_no

lab_cd

dept_id

event_time

job_pos

Returns Integer. 0 if successful, else -1 Remarks This method starts collecting labor for this Step / Lot. The user must already have logged onto this entity and he may or may not have logged into one or more other step / lot combinations. If the user is currently logged onto this entity but NOT onto any specific step / lot then the existing labor record is closed off and is replaced with a new one to reflect this step and lot. If the user is currently logged onto this entity AND onto any number of step / lot combinations then a new labor record is added for this step and lot, and the percentage labor allocated to this step / lot is set equal to 1 / (total new number of labor rows for this user and entity). The percentage labor allocated to existing rows is reduced accordingly but their relative ratios remain the same as they were which also results in clsosing off existing active labor rows and adding new rows in each case. Stored Procedure(s) Used
2004 CIMNET Inc

www.CimnetInc.com

146

sp_U_Job_Step_StepLogin Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>StepLogin</cmd> <session_id>1248</session_id> <user_id>111</user_id> <ent_id>1</ent_id> <step_no>2</step_no> <lot_no>SN1234</lot_no> <lab_cd>1</lab_cd> <dept_id>123</dept_id> <event_time></event_time> <job_pos>0</job_pos> </request>

StepLogout Method
Purpose To log a user out of a Step / Lot for the purposes of capturing labor with respect to the step / lot. Syntax StepLogout (session_id, user_id, ent_id, step_no, lot_no, event_time, job_pos) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string to identify the user working on the step Required. By Value. A long to identify the entity on which the Step is being done. This will identify the job which contains this step. Required. By Value. A string to identify the step being worked on Required. By Value. A string to identify the lot on which this step is being performed. Optional. By Value. A variant (datetime) to specify the end time of this labor. Used to synchronize times if required. Defaults to Now. Optional. By Value. A long to identify the job position, if > 1 jobs are running on this entity
www.CimnetInc.com

user_id

ent_id

step_no lot_no

event_time

job_pos

2004 CIMNET Inc

147

Returns Integer. 0 if successful, else -1 Remarks This method stops collecting labor for this User on this Step / Lot. The user must already have logged onto this step / lot combinations, otherwise an error is returned. All current rows for this user and entity (he could be logged onto other steps / lots) are closed off after updating their durations. If this user was currently logged onto other step / lot combinations then the percentage labor freed up by this log off is allocated to existing rows while still maintaining their relative ratios. If this user was NOT currently logged onto other step / lot combinations then the percentage labor freed up by this log off is allocated to a new row with a null step and lot_id values (as he is still logged onto the entity itself). Stored Procedure(s) Used sp_U_Job_Step_StepLogout Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>StepLogin</cmd> <session_id>1248</session_id> <user_id>111</user_id> <ent_id>1</ent_id> <step_no>2</step_no> <lot_no>SN1234</lot_no> <event_time></event_time> <job_pos>0</job_pos> </request>

CertStartAllowed Method
Purpose To find out whether a job or a job step may be started by a specific user based on the users certifications and any of the required certification(s) linked to either the operation, step or item. Syntax CertStartAllowed (user_id, process_id, oper_id, step_no, item_id) Parameters Part user_id Description Required. By Value. A string to identify the user wishing to start the job or step. Optional. By Value. A string to identify the operation. Required if

process_id

2004 CIMNET Inc

www.CimnetInc.com

148

the operation OR operation steps certifications are to be checked. If omitted neither the operation nor the operation steps certification(s) are checked. oper_id Optional. By Value. A string to identify the operation. Required if the operation OR operation steps certifications are to be checked. If omitted neither the operation nor the operation steps certification(s) are checked. Optional. By Value. A string to identify the operation_step. Required if the operation steps certifications are to be checked. If omitted the operation_step certification is not checked. Optional. By Value. A string to identify the item_id to be made. Required if the items certifications are to be checked. If omitted the item certification is not checked.

step_no

item_id

Returns Boolean. True if the user passes ALL certification requirements as filtered by the optional parameters, False if the user Fails any of them an exception is thrown with an appropriate error description including the certification resulting in the denied privilege. Remarks There may be any number of certifications defined at each of the operation, step and item levels, including none. Any defined certifications are ANDed together before allowing the specified user to perform the operation. The audit property of any certification specifies whether it is a certification requirement for STARTING a job or job step based on any combination of the above 3 levels, or whether it is a certification requirement for SIGNING OFF a job or job step based on the certification requirements defined at each of these levels. If both Starting and Sign Off checks are required you should define two certifications to accomplish this. This method only tests for START certifications and automatically passes all SIGNOFF certifications. Stored Procedure(s) Used sp_Cert_Start_Allowed Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>CertStartAllowed</cmd> <user_id>111</user_id> <process_id>MakeWindow</process_id> <oper_id>10</oper_id> <step_no></step_no> <item_id>DHG</item_id> </request>
2004 CIMNET Inc

www.CimnetInc.com

149

CertSignoffAllowed Method
Purpose To find out whether a job or a job step may be signed off by a specific user based on the users certifications and any of the required certification(s) linked to either the operation or the step. Syntax CertSignoffAllowed (user_id, process_id, oper_id, step_no) Parameters Part user_id Description Required. By Value. A string to identify the user wishing to sign off the job or step. Required. By Value. A string to identify the operation. Required if the operation OR operation steps certifications are to be signed off. Required. By Value. A string to identify the operation. Required if the operation OR operation steps certifications are to be signed off. Optional. By Value. A string to identify the operation_step. Required if the operation steps certifications are to be checked. If omitted the operation_step certification is not checked.

process_id

oper_id

step_no

Returns Boolean. True if the user passes ALL certification requirements as filtered by the optional parameters, False if the user Fails any of them an exception is thrown with an appropriate error description including the certification resulting in the denied privilege. Remarks There may be any number of sign off certifications defined at each of the operation and step levels, including none. Any defined certifications are ANDed together before allowing the specified user to sign off the job or step. This method only tests for SIGN OFF certifications and automatically passes any START certifications. Stored Procedure(s) Used sp_Cert_SignOff_Allowed Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>Exec</msgtype> <cmd>CertSignoffAllowed</cmd> <user_id>111</user_id> <process_id>MakeWindow</process_id>
2004 CIMNET Inc

www.CimnetInc.com

150

<oper_id>10</oper_id> <step_no>1</step_no> </request>

CertSignoffReqd Method
Purpose To find out whether a job or a job step requires a certification sign off by a certified user. Syntax CertSignoffReqd (process_id, oper_id, step_no) Parameters Part process_id Description Required. By Value. A string to identify the operation. Required if the operation OR operation steps certification requirements are to be checked for. Required. By Value. A string to identify the operation. Required if the operation OR operation steps certification requirements are to be checked for. Optional. By Value. A string to identify the operation_step. Required if the operation steps certification requirements are to be checked for.

oper_id

step_no

Returns Boolean. True if ANY SIGN OFF certification requirements are defined as filtered by the optional parameters, False if None are required. Remarks There may be any number of sign off certifications defined at each of the operation and step levels, including none. If any certifications are defined the search is terminated as we have then established a True result. This method only checks for SIGN OFF certifications and ignores any START certifications. Stored Procedure(s) Used sp_Cert_SignOff_Reqd Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>Exec</msgtype> <cmd>CertSignoffReqd</cmd> <process_id>MakeWindow</process_id> <oper_id>10</oper_id>
2004 CIMNET Inc

www.CimnetInc.com

151

<step_no>1</step_no> </request>

CertSignoffDone Method
Purpose To find out whether a job or a job step that requires a certification sign off has been signed off or not. Syntax CertSignoffDone (wo_id, oper_id, seq_no, step_no, cert_name, lot_no, prod_log_id, cons_log_id) Parameters Part wo_id Description Required. By Value. A string to identify the job for which sign off is to be checked. Required. By Value. A string to identify the job for which sign off is to be checked. Required. By Value. A long to identify the job for which sign off is to be checked. Optional. By Value. A long to identify the job step. Required if the any of job steps certification sign offs are to be checked for. Optional. By Value. A string to specify which certification sign offs are to be checked for. If omitted then check that ALL required certifications have been signed off. Optional. By Value. A variant (string) to identify a valid lot Optional. By Value. A variant (long) to identify the row_id in item_prod table Optional. By Value. A variant (long) to identify the row_id in item_cons table

oper_id

seq_no

step_no

cert_name

lot_no prod_log_id

cons_log_id

Returns Boolean. True if the specified certification SIGN OFF(S) have been done, otherwise returns False. Remarks There may be any number of sign off certifications defined at each of the operation and step levels, including none. If the step_no optional parameter is omitted then certification signoffs at the step level are not checked. Signoffs at the operation level are always checked. If the cert_name optional parameter is omitted then this method only returns True if ALL required certifications have been signed off on. All certification sign offs are checked for in the cert_audit_log table. Stored Procedure(s) Used

2004 CIMNET Inc

www.CimnetInc.com

152

sp_Cert_SignOff_Done Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>Exec</msgtype> <cmd>CertSignoffDone</cmd> <wo_id>wo123</wo_id> <oper_id>10</oper_id> <seq_no>0</seq_no> <step_no>1</step_no> <cert_name>Welder</cert_name> <lot_no></lot_no> <prod_log_id></prod_log_id> <cons_log_id></cons_log_id> </request>

CertSignoff Method
Purpose To allow a user to Sign Off on a job or a job step that requires a certification sign off. Syntax CertSignoff (session_id, wo_id, oper_id, seq_no, cert_name, lot_no, step_no, user_id, user_pw, sign_off, prod_log_id, cons_log_id, comments) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made. Required. By Value. A string to identify the job for which sign off is to be checked. Required. By Value. A string to identify the job for which sign off is to be checked. Required. By Value. A long to identify the job for which sign off is to be checked. Required. By Value. A string to specify which certification is to be signed off. Optional. By Value. A variant (string) to identify a valid lot Optional. By Value. A variant (long) to identify the job step. Required if the certification to be signed off is for a Step. 153

wo_id

oper_id

seq_no

cert_name

lot_no step_no

2004 CIMNET Inc

www.CimnetInc.com

user_id

Optional. By Value. A variant (string) to identify the user signing off the job or step. Optional. By Value. A variant (string) to specify the users password. If included, the password is verified, if omitted then it is assumed the user was authenticated when he logged in. Optional. By Value. A variant (datetime) to specify the certification audit time Optional. By Value. A variant (long) to identify the row_id in item_prod table Optional. By Value. A variant (long) to identify the row_id in item_cons table Optional. By Value. A variant (string) to include comments describing the audit sign off

user_pw

sign_off

prod_log_id

cons_log_id

comments

Returns Long. 0 if the specified certification was SIGNED OFF successfully. Throws an exception with an appropriate error description if it fails. Remarks This method first checks that the passed user is authorised to sign off on the specified certification. It calls the CertSignoffAllowed() sp to establish this. The optional parameters User_id or User_pw must be supplied. Either one of these two parameters must be supplied. If user_id is specified, then it signs off on the user_id, assuming that the user is authenticated. If user_pw is supplied, then it fetches the user_id to sign off on this certification. If both are supplied, then it uses the user_id to sign off on this certification. And if none are supplied, then an exception is raised with appropriate error description. If the user has these rights then an entry is made in the cert_audit_log to indicate that this certification has been signed off for this job (or step if the step_no is included) Stored Procedure(s) Used sp_Cert_SignOff Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>Exec</msgtype> <cmd>CertSignoff</cmd> <session_id>1239</session_id> <wo_id>wo123</wo_id> <oper_id>10</oper_id> <seq_no>0</seq_no> <cert_name>Welder</cert_name> <lot_no>11</lot_no>
2004 CIMNET Inc

www.CimnetInc.com

154

<step_no>1</step_no> <user_pw></user_pw> <sign_off></sign_off> <prod_log_id></prod_log_id> <cons_log_id></cons_log_id> <comments></comments> </request>

DownloadSpecs Method
Purpose To allow the downloading of specs to the process via the Factory Connector on demand. Syntax DownloadSpecs (session_id, ent_id, wo_id, oper_id, seq_no, step_no) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made. Required. By Value. A long to identify the entity for which the specs are exposed via the Factory Connector. Required. By Value. A string to identify the job for which the specs are to be downloaded. The job does NOT have to be running on the entity when this call is made. Required. By Value. A string to identify the job for which the specs are to be downloaded. Required. By Value. A long to identify the job for which the specs are to be downloaded. Optional. By Value. A long to identify the job step for which the specs are to be downloaded. Required if only the specs for a given step are to be downloaded. Default to -1 which downloads all specs that are independent of steps.

ent_id

wo_id

oper_id

seq_no

step_no

Returns Long. 0 if the specs were downloaded successfully. Throws an exception with an appropriate error description if it fails. Remarks The job does NOT have to be running on the entity when this call is made. This allows specs to be downloaded on demand, for example if the user needs to download specs for the next job in the queue to start setting the machine up for the next job. This functionality exists independently of the entity setting to automatically download specs as soon as a job or a step is started.
2004 CIMNET Inc

www.CimnetInc.com

155

Stored Procedure(s) Used sp_U_Job_Exec_DownloadSpecs Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>DownloadSpecs</cmd> <session_id>123</session_id> <ent_id>1</ent_id> <wo_id>wo123</wo_id> <oper_id>10</oper_id> <seq_no>0</seq_no> <step_no>1</step_no> </request>

SetActualSpecValue Method
Purpose To save an actual value for a specific spec parameter for a job, given the entity on which the job is running but not the actual job details. This facilitates capturing actual spec data values from the Factory Connector even if it doesnt know which job is currently running on an entity. Syntax SetActualSpecValue (session_id, ent_id, spec_id, act_spec_value, job_pos) Parameters Part session_id Description Required. By Value. A long to identify the client or Factory Connector session from which the request is being made. Required. By Value. A long to identify the entity for which the spec value is being collected. This value is used to find the current job running on the entity to identify the correct row to update in the job_spec table. Required. By Value. A string to identify the spec parameter whos actual value is being set. Required. By Value. A string to specify the actual spec value to be saved. Optional. By Value. A long to identify the job position, if > 1 jobs are running on this entity

ent_id

spec_id

act_spec_value

job_pos

Returns Long. 0 if successful, else 1.


2004 CIMNET Inc

www.CimnetInc.com

156

Remarks Returns 1 if a job is not currently running on the specified entity, or if the specified spec does not exist for the running job on the entity. If this spec_id is defined only once for this job (not repeated for different steps) then the method will update it irrespective of which steps are running. If the same spec_id is defined for multiple steps in this job then it will only update the actual spec value for currently running step(s). Stored Procedure(s) Used sp_U_Job_Spec_SetActSpecValue Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>SetActualSpecValue</cmd> <session_id>111</session_id> <ent_id>1</ent_id> <spec_id>oven_temp</spec_id> <act_spec_value>155</act_spec_value> <job_pos>0</job_pos> </request>

SetUIScreenTagValues Method
Purpose Called based on a user action from certain user interface screens to set new values for output tag(s) that are to be written to the Factory Connector. This only applies to UI screens for which output tags may be configured in the Factory Connector namespace (currently Production tab, Queue tab, AddProd dialog, AddCons dialog). Syntax SetUIScreenTagValues (xmlRequest) Parameters Part xmlRequest Description Required. By Value. An XML formatted string to specify the required parameters and the new tag values for all possible tags for the specified screen. Details are included below.

Returns Long. 0 if successful, else 1. Remarks The Factory Connector configuration defines which screens allow output tags to be exposed, and thus which valid values may be written to the middleware using this method. The XML request string must contain the following required elements which have the meanings as described:
2004 CIMNET Inc

www.CimnetInc.com

157

<session_id> Required to identify the client session from which the request is being made. <ent_id> Required to identify the entity for which the tag values apply. It is used to identify which Factory Connector namespace node the new tag values relate to. <screen> Required to identify which UI screen is the source of the user action. This is necessary as there may be many screens that expose tag values for a given entity. Valid values are currently JobScreen, ProdScreen, AddProdScreen, and AddConsScreen. More will be added later such as Inventory. The sub elements within the <tag_values> element are screen dependent and will typically include the values for ALL column values for the selected row on the UI screen irrespective of whether any Factory Connector clients have subscribed to these tag values or not. In the case of the AddProd and AddCons dialogs any of the parameters relating to the transaction will be available. The Factory Connector tag configuration options indicate all the possible values that are exposable as tags for each screen type. The UI screen code always passes all available values in XML format when it calls this method so it requires no knowledge of which tags are exposed and which are not The middleware method takes care of updating only the values for tags that are configured to be exposed by Factory Connector. Stored Procedure(s) Used sp_U_Job_Exec_SetUIScrTagVals Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters. Examples for the 4 supported screen types are shown below: 1) Production <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>Exec</msgtype> <cmd>SetUIScreenTagValues</cmd> <session_id>111</session_id> <ent_id>1</ent_id> <screen>ProdScreen</screen> <tag_values> <wo_id>1234</wo_id> <oper_id>10</oper_id> <seq_no>1</seq_no> <wo_desc>wo1234</wo_desc> <oper_desc>Fill</oper_desc> <item_id>abc</item_id> <item_desc>item abc</item_desc> <lot_no>lot1</lot_no> <user_id>111</user_id> <reas_cd>7</reas_cd> <reas_desc>Good WIP</reas_desc> <ent_desc>Filler 1</ent_desc> <item_grade_cd>2</item_grade_cd> <item_grade_desc>A1</item_grade_desc> <item_state_cd>4</item_state_cd> <item_state_desc>QC</item_state_desc> <qty_prod>45.67</qty_prod> </tag_values> </request> 2) Job <?xml version="1.0"?>
2004 CIMNET Inc

www.CimnetInc.com

158

<request> <object>job_exec</object> <msgtype>Exec</msgtype> <cmd>SetUIScreenTagValues</cmd> <session_id>111</session_id> <ent_id>1</ent_id> <screen>JobScreen</screen> <tag_values> <wo_id>1234</wo_id> <oper_id>10</oper_id> <seq_no>1</seq_no> <wo_desc>wo1234</wo_desc> <oper_desc>Fill</oper_desc> <item_id>abc</item_id> <item_desc>item abc</item_desc> <reqd_finish_time>1/1/2004</reqd_finish_time> <batch_qty>1</batch_qty> <priority>50</priority> <state_cd>3</state_cd> <state_desc>Running</state_desc> <qty_reqd>1000</qty_reqd> <qty_prod>145</qty_prod> <qty_rejects>7</qty_rejects> <start_qty>7</start_qty> </tag_values> </request> 3) AddProd <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>Exec</msgtype> <cmd>SetUIScreenTagValues</cmd> <session_id>111</session_id> <ent_id>1</ent_id> <screen>AddProdScreen</screen> <tag_values> <item_id>abc</item_id> <item_desc>item abc</item_desc> <user_id>111</user_id> <to_ent_id>1211</to_ent_id> <lot_no>lot1</lot_no> <reas_cd>7</reas_cd> <reas_desc>Good WIP</reas_desc> <qty_prod>145</qty_prod> <units>cases</units> </tag_values> </request> 4) AddCons <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>Exec</msgtype> <cmd>SetUIScreenTagValues</cmd> <session_id>111</session_id> <ent_id>1</ent_id>
2004 CIMNET Inc

www.CimnetInc.com

159

<screen>AddConsScreen</screen> <tag_values> <item_id>RM123</item_id> <item_desc>Diet Coke</item_desc> <user_id>111</user_id> <from_ent_id>1216</from_ent_id> <lot_no>lot1</lot_no> <reas_cd>1</reas_cd> <reas_desc>Normal Consumption</reas_desc> <qty_cons>15</qty_cons> <units>gallons</units> </tag_values> </request>

SetAttr Method
Purpose To set the value of a job attribute given the entity on which the job is running but not the actual job details. This facilitates capturing job attribute values from the Factory Connector even if it doesnt know which job is currently running on an entity. Syntax SetAttr (session_id, ent_id, attr_id, attr_value, job_pos) Parameters Part session_id Description Required. By Value. A long to identify the client or Factory Connector session from which the request is being made. Required. By Value. A long to identify the entity on which the job attribute is being collected. This value is used to find the current job running on the entity to identify the correct row to update in the job_attr table. Required. By Value. A string to identify the attribute whos value is being set. Required. By Value. A string to specify the actual attribute value to be saved. Optional. By Value. A long to identify the job position, if > 1 jobs are running on this entity

ent_id

attr_id

attr_value

job_pos

Returns Long. 0 if successful, else 1. Remarks Returns 1 if a job is not currently running on the specified entity, or if the specified attribute does not exist for the running job on the entity. Stored Procedure(s) Used 160

2004 CIMNET Inc

www.CimnetInc.com

sp_U_Job_Attr_SetAttr Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>SetAttr</cmd> <session_id>111</session_id> <ent_id>1</ent_id> <attr_id>color</attr_id> <attr_value>red</attr_value> <job_pos>0</job_pos> </request>

ChangeWOPriority Method
Purpose Change Priority for all the jobs in a Work Order. Syntax ChangeWOPriority (session_id, wo_id, priority) Parameters Part session_Id wo_id new_priority Returns Long. 0 if successful, else 1. Remarks The Wo_id and New_Priority are required parameters. Change the Priority for all the jobs in the Work Order (for the Wo_Id parameter passed) Stored Procedure(s) Used sp_U_Job_Exec_ChangeWOPriority Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows:
2004 CIMNET Inc

Description Required. By Value. A variant (long) to identify the client session from which the request is being made. Required. By Value. A variant (string) to identify the Work Order Id Required. By Value. A variant (long) to identify the new Priority for all the jobs

www.CimnetInc.com

161

<?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>ChangeWOPriority</cmd> <session_id>111</session_id> <wo_id>SampleWO-CIMWO1</wo_id> <new_priority>1</new_priority> </request>

ChangeWOReqFinishTime Method
Purpose Changes the required finish time for all the jobs in a Work Order. Syntax ChangeWOReqFinishTime (session_id, wo_id, Req_Finish_Time) Parameters Part session_Id wo_id req_finish_time Description Required. By Value. A variant (long) to identify the client session from which the request is being made Required. By Value. A variant (string) to identify the Work Order Id Optional. By Value. A variant (datetime) to identify the Required Finish Time

Returns Long. 0 if successful, else 1. Remarks The time difference is calculated between required_finish_time parameter and current work order finish time and this difference is applied for all the jobs in the Work Order and to the work itself. Stored Procedure(s) Used sp_U_Job_Exec_ChWOReqFinTime Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>ChangeWOFinishTime</cmd>
2004 CIMNET Inc

www.CimnetInc.com

162

<session_id>111</session_id> <wo_id>SampleWO-CIMWO1</wo_id> <req_finish_time>12/30/2002</req_finish_time> </request>

ChangeWOQtys Method
Purpose Change Starting and Required Quantities for a Work Order. Syntax ChangeWOQtys (session_id, wo_id, qty_reqd, qty_at_start) Parameters Part session_Id wo_id qty_reqd qty_at_start Returns Long. 0 if successful, else 1. Remarks Applies the Starting Quantities and Required Quantities to the final job and propagates the quantities to all the jobs Description Required. By Value. A variant (long) to identify the client session from which the request is being made. Required. By Value. A variant (string) to identify the Work Order Id Required. By Value. A variant (long) to identify the Required Quantity Required. By Value. A variant (long) to identify the starting quantity

Stored Procedure(s) Used sp_Alloc_Job_Qty Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>ChangeWOQuantities</cmd> <session_id>111</session_id> <wo_id>TestWO1</wo_id>
2004 CIMNET Inc

www.CimnetInc.com

163

<qty_reqd>100</qty_reqd> <qty_at_start>75</qty_at_start> </request>

StartNextJobViaFC Method
Purpose To start the next job in the queue for the specified entity. This is usually only used when starting a job automatically via Factory Connector. Syntax StartNextJobViaFC (session_id, user_id, ent_id, job_pos) Parameters Part session_id Description Required. By Value. A long to identify the session from which the job is being started. Required. By Value. A string to identify the user_id starting the job. Required. By Value. A long to identify the entity on which the job is to be run. Optional. By Value. A variant (long) to specify the job_pos on the entity on which the job is to be run. (Defaults to 0)

user_id ent_id

job_pos

Returns Integer. 0 if successful, else 1. Any errors are logged to the error_log as Factory Connector (FC) cannot prompt a user with them. Remarks This method is designed for use with Factory Connector and should only be used when the job queues are carefully controlled, otherwise the wrong job may be started. The GetQueue() method is called to retrieve the job queue for this entity taking into account scheduling to parent entities etc. The wo_id, oper_id and seq_no of the job to be started are determined by the specified queue sequence for the specified entity. Only READY jobs will be included. If no such jobs are scheduled an error will be returned. The session_id is required for licensing checks. The user_id may be validated as being the default background user. If a job IS currently running on the specified entity then it will be ended and the current job automatically started immediately thereafter. If the call is successful the job table is updated as it would normally be when starting a job see the StartJob method for details of this. Stored Procedure(s) Used None Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be
2004 CIMNET Inc

www.CimnetInc.com

164

formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</ msgtype > <cmd>StartNextJobViaFC</cmd> <session_id>1234</session_id> <user_id>111</user_id> <ent_id>1</ent_id> <job_pos></job_pos> </request>

ChangeSpecValue Method
Purpose To change a specific spec parameters value for the current running job and optionally the Operation from which this job was created (if defined). This allows for runtime changing of spec values by users with appropriate privileges based on the job currently running on an entity. Syntax ChangeSpecValue (session_id, user_id, ent_id, spec_id, new_spec_value, update_template, bom_pos, bom_ver_id, job_pos, comments) Parameters Part session_id Description Required. By Value. A long to identify the client or Factory Connector session from which the request is being made. Required. By Value. A string to identify the user making the change. This value is used to authorize whether this user is permitted to make such changes or not. Required. By Value. A long to identify the entity on which the current job is running. The current job is used to identify the correct row(s) to update in the job_spec, oper_ent_spec or bom_item_oper_spec tables. Required. By Value. A string to identify the spec parameter whos value is being changed. Required. By Value. A string to specify the new spec value to replace the existing one. Required. By Value. A boolean to specify whether to also update the spec value in the oper_ent_spec or bom_item_oper_spec tables. The spec value in the job_spec table is always updated. Optional. By Value. A variant (long) to specify the bom_pos

user_id

Ent_id

spec_id new_spec_value

update_template

bom_pos

2004 CIMNET Inc

www.CimnetInc.com

165

bom_ver_id job_pos

Optional. By Value. A variant (string) to specify the bom version id Optional. By Value. A variant (long) to specify the job_pos on the entity on which the job is to be run. (Defaults to 0) Optional. By Value. An optional variant (string) to include comments describing the spec change. The comments will be included in the audit trail if this option is enabled.

comments

Returns Long. 0 if successful, else 1. Remarks Returns 1 if a job is not currently running on the specified entity, or if the specified spec does not exist for the running job on the entity. The user is first checked to see if he / she has the required privilege to edit specifications. This is determined by the May Edit Specs privilege in the Supervisor group. Returns 1 if this user does not have this privilege. First updates the job_spec table with the new value for the spec. If this spec_id is defined only once for this job (not repeated for different steps) then the method will update it irrespective of which steps are running. If the same spec_id is defined for multiple steps in this job then it will only update the new spec value parameter for currently running step(s). If the update_template optional parameter is true then the code also searches both the oper_ent_spec and bom_item_oper_spec tables for the same spec_id (and optional step_no values as defined above) for this process and operation, and updates these spec_value fields as well if any are found. These updates will occur only for the preferred versions in the oper_ent_spec and bom_item_oper_spec tables as defined in the oper_spec_ver table.If audit trails are enabled on these tables then this change will also be logged automatically into the audit trail. Stored Procedure(s) Used sp_U_Job_Spec_ChangeValue Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>ChangeSpecValue</cmd> <session_id>1234</session_id> <user_id>111</user_id> <ent_id>1</ent_id> <spec_id>oven_temp</spec_id> <new_spec_value>155</new_spec_value> <update_template>0</update_template> <bom_pos></bom_pos> <bom_ver_id></bom_ver_id> <job_pos></job_pos> <comments></comments>
2004 CIMNET Inc

www.CimnetInc.com

166

</request>

GetSchedulableEntities Method
Purpose To return all the schedulable entities for a job. Used to limit which entities a job may be switched to before it is run. Syntax GetSchedulableEntities (wo_id, oper_id) Parameters Part wo_id oper_Id Description Required. By Value. A variant (string) to identify the wo_id Required. By Value. A variant (string) to identify the operation

Returns ADODB.recordset. Remarks This method first extracts the process_id from which this WO was derived if it was derived from a process. Based on this process_id and the passed oper_id it then reads all entities from the oper_ent_link table that can perform this operation. All these entities AND any of their descendants that have the can_sched_jobs capability are included in the returned recordset. If a process_id is not defined (ie. is null) or if the system parameter to enable this feature (Limit Schedulable Entities) is set to false then return all entities have the can_sched_jobs capability without filtering them with the oper_ent_link table. Stored Procedure(s) Used sp_SA_Job_Exec_GetSchedEnts Access via Director.cls using GetSpecificRS() The XML input parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job_exec</object> <cmd>GetSchedulableEntities</cmd> <msgtype>getspec</msgtype> <wo_id>TestSpec-001</wo_id> <oper_id>12</oper_id> </request>
www.CimnetInc.com

2004 CIMNET Inc

167

GetReqdCertSignoffs Method
Purpose To return a recordset containing details of all certifications that require signoff for a given job and / or step. Syntax GetReqdCertSignoffs (wo_id, oper_id, step_no) Parameters Part wo_id Description Required. By Value. A string to identify the WO for which required signoff certifications are to be returned. Required. By Value. A string to identify the WO operation for which required signoff certifications are to be returned. Optional. By Value. A long to identify the job step. Required if the certification to be signed off is for a Step. If not specified only certifications required for the operation are returned. If specified then only certifications required for this step are returned, and NO operation specific certifications are returned.

oper_id

step_no

Returns A recordset including all the required signoff certifications. The recordset columns include the following: cert_name, signoff_notes, num_signoffs_reqd, comments_reqd, avail_to_oper, avail_to_oper_step. Remarks This method is useful when > 1 signoff certifications are defined for a job or step. It returns all required signoff certifications whether or not they have currently been signed off on for this job. If 1 is supplied for the step_no parameter, then this method returns all step numbers along with all required signoff certifications for each step whether or not they have currently been signed off for a step. The method will extract the process_id for the specified wo_id to avoid the client having to first read this from the database. If no process_id is specified for the wo then an empty recordset will be returned. Stored Procedure(s) Used sp_SA_Job_Exec_GetReqdSignoffs Access via Director.cls using GetSpecificRS() <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>GetSpec</msgtype> <cmd>GetReqdCertSignoffs</cmd> <wo_id>wo123</wo_id>
2004 CIMNET Inc

www.CimnetInc.com

168

<oper_id>10</oper_id> <step_no>1</step_no> </request>

GetStepBOMData Method
Purpose To return a single recordset containing details of all step data for a given job, including any BOM data IF a BOM item is linked to this step. Syntax GetStepBOMData (wo_id, oper_id, seq_no, step_no) Parameters Part wo_id Description Required. By Value. A string to identify the WO for which required signoff certifications are to be returned. Required. By Value. A string to identify the WO operation for which required signoff certifications are to be returned. Required. By Value. A long to identify the job. Optional. By Value. A long to identify the job step. If specified the returned data only includes a single row of data for the specified step_no if it exists.

oper_id

seq_no step_no

Returns A recordset including all the step data for a job. If the step has a BOM item linked to it as defined in the job_bom_step table then include in separate columns the related BOM data, otherwise null values are included in these columns (ie. it does an outer join on the BOM data). The recordset columns include the following: [job_step].step_no, step_seq, step_desc, action_type, std_time, complete_cond, allow_bypass, enter_data, step_grp_id, spc_char, form_name, spare1, spare2, spare3, spare4, spare5, spare6, [job_bom_step].bom_pos,qty_per_parent_item, [job_bom].item_id, reqd_grade_cd, instruction, qty_per_parent_item, max_qty_per_parent_item, min_qty_per_parent_item, update_inv, backflush, def_reas_cd, def_lot_no, def_storage_ent_id, scaling_factor, must_consume_from_inv, may_choose_alt_inv_loc, may_create_new_lots, must_consume_from_wip, must_consume_before_prod, constant_qty, spare1, spare2, spare3, spare4. The rows are sorted by step_seq and then by step_no Remarks This method is useful when step and bom data (if linked) needs to be accessed within a single recordset as may be the case when downloading all the step data to a PLC. Stored Procedure(s) Used sp_SA_Job_Exec_GetStepBOMData Access via Director.cls using GetSpecificRS()

2004 CIMNET Inc

www.CimnetInc.com

169

<?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>GetSpec</msgtype> <cmd>GetStepBOMData</cmd> <wo_id>wo123</wo_id> <oper_id>10</oper_id> <seq_no>1</seq_no> <step_no></step_no> </request>

LogJobEvent Method
Purpose To add a new row to the job_event table. This allows multiple events to be logged for a given job or step. Syntax LogJobEvent (session_id, ent_id, event_time, job_pos, step_no, event_type, bom_pos, lot_no, item_id, cert_name, done_by_user_id, checked_by_user_id, item_prod_row_id, item_cons_row_id, spec_id, comments, value1, value2, value3, value4, value5, value6, value7, value8, value9, value10) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A long to identify the currently running job to which this event applies if any. Optional. By Value. A variant (datetime) to specify the timestamp for this event. Defaults to Now. Optional. By Value. A variant (long) to identify the job position if > 1 jobs are currently running on this entity. Defaults to 0. Optional. By Value. A variant (long) to identify the step for which this event applies if any. Defaults to null. Optional. By Value. A variant (string) to categorize this event to facilitate retrieval filters. Defaults to null. Optional. By Value. A variant (long) to identify the bom_pos to which this event applies if any. Defaults to null. Optional. By Value. A variant (string) to specify the lot_no to which this event applies if any. Defaults to null.
www.CimnetInc.com

ent_id

event_time

job_pos

step_no

event_type

bom_pos

lot_no

2004 CIMNET Inc

170

item_id

Optional. By Value. A variant (string) to specify the item_id to which this event applies if any. Defaults to null. Optional. By Value. A variant (string) to specify the certification to which this event applies if any. Defaults to null. Optional. By Value. A variant (string) to identify the user that performed an action if any. Defaults to null. Optional. By Value. A variant (string) to identify the user that checked an action if any. Defaults to null. Optional. By Value. A variant (long) to identify a production transaction (row in item_prod table) that this event relates to if any. Defaults to null. Optional. By Value. A variant (long) to identify a consmuption transaction (row in item_cons table) that this event relates to if any. Defaults to null. Optional. By Value. A variant (string) to specify a specification parameter to which this event applies if any. Defaults to null. Optional. By Value. A variant (string) to specify any comments that apply to this event if any. Defaults to null. Optional. By Value. Variants (string) to specify any additional user defined values that apply to this event if any. All default to null.

cert_name

done_by_user_id

checked_by_user_id

item_prod_row_id

item_cons_row_id

spec_id

comments

value1 value10

Returns Long: >= 0 returns the row_id of the inserted row. 1 if error. Remarks This method allows a variety of different events to be captured for this job / step. If a job is not running on the entity then an exception is thrown with an appropriate error message. At least one of the optional parameters should be included otherwise the event would be meaningless. Use the event_type field if you wish to extract events by any specified categories for reporting purposes. Stored Procedure(s) Used sp_I_Job_Event Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>job_exec</object> <cmd>LogJobEvent</cmd> <session_id>1248</session_id> <ent_id>1</ent_id> <event_time></event_time>
2004 CIMNET Inc

www.CimnetInc.com

171

<job_pos></job_pos> <step_no>2</step_no> <event_type>AddCons</event_type> <bom_pos>1</bom_pos> <lot_no>SN1234</lot_no> <item_id>Chem1234</item_id> <cert_name></cert_name> <done_by_user_id>111</done_by_user_id> <checked_by_user_id></checked_by_user_id> <item_prod_row_id></item_prod_row_id> <item_cons_row_id>5331</item_cons_row_id> <spec_id></spec_id> <comments></comments> <value1></value1>

</request> GetJobBOMStepQuantities Method


Purpose To return a single recordset containing details of quantities related to the step for a given job, including BOM data IF a BOM item is linked to this step. Syntax GeJobBOMStepQuantities (wo_id, oper_id, seq_no, step_no) Parameters Part wo_id oper_id seq_no step_no Returns A recordset including all the BOM data for a job. If the step has a BOM item linked to it as defined in the job_bom_step table then include in separate columns the related BOM data, otherwise null values are included in these columns (ie. it does an outer join on the BOM data). The recordset columns include the following: [job_bom] bom_pos, qty_per_parent_item as quantity, [job_bom_step] qty_per_parent_item as qty_at_step, mod_id. Also includes additional fields as 0 as changed. job_bom.qty_per_parent_item job_bom_step.qty_per_parent_item as remaining, item.num_decimals and item. The display of item field is derived from system_attr (=210). If attribute value is specified as 1, the item_id is substituted for item, if attr_value = 2, item_desc is substituted, if attr_value = 3, item_id (item_desc) is substituted and if attr_value = 4, then item_desc(item_id) is substituted. Remarks This method is useful when job bom and job bom step data (if linked) needs to be accessed within a
2004 CIMNET Inc

Description Required. By Value. A string to identify the WO Required. By Value. A string to identify the WO operation Required. By Value. A long to identify the job. Required. By Value. A long to identify the job step.

www.CimnetInc.com

172

single recordset Stored Procedure(s) Used sp_SA_Job_Exec_GetJBStepQuants Access via Director.cls using GetSpecificRS() <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>GetSpec</msgtype> <cmd>GetJobBOMStepQuantities</cmd> <wo_id>wo123</wo_id> <oper_id>10</oper_id> <seq_no>1</seq_no> <step_no>1</step_no> </request>

ChangeSpecValues Method
Purpose To change a specific spec parameters value for the current running job and optionally the Operation from which this job was created (if defined). This allows for runtime changing of spec values by users with appropriate privileges based on the job currently running on an entity. Syntax ChangeSpecValues (session_id, user_id, ent_id, spec_id, new_spec_value, new_min_value, new_max_value, update_template, check_privs, bom_pos, bom_ver_id, comments, job_pos) Parameters Part session_id Description Required. By Value. A long to identify the client or Factory Connector session from which the request is being made. Required. By Value. A string to identify the user making the change. This value is used to authorize whether this user is permitted to make such changes or not. Required. By Value. A long to identify the entity on which the current job is running. The current job is used to identify the correct row(s) to update in the job_spec, oper_ent_spec or bom_item_oper_spec tables. Required. By Value. A string to identify the spec parameter whos value is being changed. Optional. By Value. A string to specify the new spec value to replace the existing one. Optional. By Value. A string to specify the new min_value to
www.CimnetInc.com

user_id

ent_id

spec_id

new_spec_value

new_min_value
2004 CIMNET Inc

173

replace the existing one. new_max_value Optional. By Value. A string to specify the new max_value to replace the existing one. Optional. By Value. A boolean to specify whether to also update the spec value in the oper_ent_spec or bom_item_oper_spec tables. The spec value in the job_spec table is always updated. Defaults to 0. Optional. By Value. A variant (boolean) to specify whether the users privileges should be checked before executing this action Defaults to False. Optional. By Value. A variant (long) to specify the bom_pos. Defaults to 0 Optional. By Value. A variant (string) to specify the bom version id Optional. By Value. An optional variant (string) to include comments describing the spec change. The comments will be included in the audit trail if this option is enabled. Optional. By Value. A variant (long) to specify the job_pos on the entity on which the job is to be run. (Defaults to 0)

update_template

check_privs

bom_pos

bom_ver_id comments

job_pos

Returns Long. 0 if successful, else 1. Remarks Returns 1 if a job is not currently running on the specified entity, or if the specified spec does not exist for the running job on the entity. If check_privs option is True, then privileges is checked for this user. The user is first checked to see if he / she has the required privilege to edit specifications. This is determined by the May Edit Specs privilege. If new_min_value or new_max_value is specified, then it is also validated against May Edit minimum/maximum specification limits. Returns 1 if this user does not have privileges. If the specified user is not the current user for this session, then the current user for this session is logged off while changes to the specifications are made. And the current user is logged back in after the spec changes are completed. This is used to identify the exact user who made the spec changes. Users access level is validated against the Specifications. Users access level must be greater than or equal to the specification access level of the row which is being updated else returns 1 with appropriate error. First updates the job_spec table with the new value for the spec. If this spec_id is defined only once for this job (not repeated for different steps) then the method will update it irrespective of which steps are running. If the same spec_id is defined for multiple steps in this job then it will only update the new spec value parameter for currently running step(s). If the update_template optional parameter is true then the code also searches both the oper_ent_spec and bom_item_oper_spec tables for the same spec_id (and optional step_no values as defined above) for this process and operation, and updates these spec_value fields as well if any are found. These updates will occur only for the preferred versions in the oper_ent_spec and bom_item_oper_spec tables
2004 CIMNET Inc

www.CimnetInc.com

174

as defined in the oper_spec_ver table. No changes will be made if new_spec_value, new_min_value and new_max_value is null. If audit trails are enabled on these tables then this change will also be logged automatically into the audit trail. Stored Procedure(s) Used sp_U_Job_Spec_ChangeValues Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>ChangeSpecValues</cmd> <session_id>1234</session_id> <user_id>111</user_id> <ent_id>1</ent_id> <spec_id>oven_temp</spec_id> <new_spec_value>155</new_spec_value> <new_min_value>147</new_min_value> <new_max_value>153</new_max_value> <update_template>0</update_template> <check_privs>1</check_privs> <bom_pos></bom_pos> <bom_ver_id></bom_ver_id> <comments></comments> <job_pos></job_pos> </request>

UpdateTemplateSpecValues Method
Purpose To update all operation spec parameter values based on spec values of the current running job. This allows for runtime changing of spec values by users with appropriate privileges based on the job currently running on an entity. Syntax UpdateTemplateSpecValues(session_id, user_id, ent_id, check_privs, job_pos) Parameters Part session_id Description Required. By Value. A long to identify the client or Factory Connector session from which the request is being made. Required. By Value. A string to identify the user making the change. This value is used to authorize whether this user is permitted to make such changes or not.

user_id

2004 CIMNET Inc

www.CimnetInc.com

175

ent_id

Required. By Value. A long to identify the entity on which the current job is running. The current job is used to identify the correct row(s) to update in the job_spec, oper_ent_spec or bom_item_oper_spec tables. Optional. By Value. A variant (boolean) to specify whether the users privileges should be checked before executing this action Defaults to False. Optional. By Value. A variant (long) to specify the job_pos on the entity on which the job is to be run. (Defaults to 0)

check_privs

job_pos

Returns Long. 0 if successful, else 1. Remarks Returns 1 if a job is not currently running on the specified entity If check_privs option is True, then privileges is checked for this user. The user is first checked to see if he / she has the required privilege to edit specifications. This is determined by the May Edit Specs privilege. Returns 1 if this user does not have privileges. The current job information is extracted from the specified job_pos. Then for the current running job, spec_values for all the specs are updated in oper_ent_spec and bom_item_oper_spec tables. These updates will occur only for the preferred versions in the oper_ent_spec and bom_item_oper_spec tables as defined in the oper_spec_ver table. An error is returned, if a spec exists in both oper_ent_spec and bom_item_oper_spec table. If audit trails are enabled on these tables then this change will also be logged automatically into the audit trail. Stored Procedure(s) Used sp_U_Job_Spec_UpdTemplSpecVals Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job_exec</object> <msgtype>Exec</msgtype> <cmd> UpdateTemplateSpecValues</cmd> <session_id>1234</session_id> <user_id>111</user_id> <ent_id>1</ent_id> <check_privs>1</check_privs> <job_pos></job_pos> </request>

GetRunnableEntities Method
Purpose To return an entity and a list of all descendent entities that can run jobs.

2004 CIMNET Inc

www.CimnetInc.com

176

Syntax GetRunnableEntities(ent_id) Parameters Part ent_id Returns ADODB.recordset. Recordset columns are: ent_id and ent_name Remarks This method lists the specified entity if it has the can_run_jobs capability set to true and all of its descendent entities that have the can_run_jobs capability set to true. Stored Procedure(s) Used sp_SA_Ent_GetRunnableEntities Access via Director.cls using GetSpecificRS() <request> <object>job_exec</object> <msgtype>getspec</msgtype> <cmd>GetRunnableEntities</cmd> <ent_id>1221</ent_id> </request> Description Required. By Value. A variant (string) to identify the ent_id

GetSchedulableEntity Method
Purpose To return an entity that can schedule a job. Syntax GetSchedulableEntity(ent_id) Parameters Part ent_id Returns ADODB.recordset. Recordset columns are: ent_id Remarks This method lists the supplied entity if it can schedule a job. If not, this method walks through all of its parent entities that have the can_sched_jobs capability set to true. It returns the first ancestor entity it finds that can schedule jobs. Stored Procedure(s) Used sp_SA_Ent_GetSchedulableEntity Access via Director.cls using GetSpecificRS()
2004 CIMNET Inc

Description Required. By Value. A variant (string) to identify the ent_id

www.CimnetInc.com

177

<request> <object>job_exec</object> <msgtype>getspec</msgtype> <cmd>GetSchedulableEntity</cmd> <ent_id>1211</ent_id> </request>

GetSchedulableParents Method
Purpose To return a list of all parent entities from an entity that can schedule jobs. Syntax GetSchedulableParents(ent_id) Parameters Part ent_id Returns ADODB.recordset. Recordset columns are: ent_id, ent_name, description Remarks This method lists the supplied entity, and all of its parent entities that have the can_sched_jobs capability set to true. Stored Procedure(s) Used sp_SA_Ent_GetSchedParents Access via Director.cls using GetSpecificRS() <request> <object>job_exec</object> <msgtype>getspec</msgtype> <cmd>GetSchedulableParents</cmd> <ent_id>1212</ent_id> </request> Description Required. By Value. A variant (string) to identify the ent_id

GetJobQueue Method
Purpose To return a recordset containing a list of all jobs in a work order Syntax GetJobQueue(wo_id, item_id) Parameters Part
2004 CIMNET Inc

Description
www.CimnetInc.com

178

wo_id item_id Returns

Required. By Value. A variant (string) to identify the wo_id Optional. By Value. A variant (string) to identify the item_id

ADODB.recordset. Recordset columns are: All columns from job table, wo.wo_desc, wo.req_qty, wo.mo_id, item.item_desc, job_state.state_desc, job_state.color, ent.ent_name, run_ent_name, item.spare1 to item.spare4. Remarks This method lists all the jobs for a work order. If the optional item_id is included, then the records are filtered by item_id as well. Jobs with a work order state of closed are discarded. Stored Procedure(s) Used sp_SA_Job_Exec_GetJobQueue Access via Director.cls using GetSpecificRS() <request> <object>job_exec</object> <msgtype>getspec</msgtype> <cmd>getjobqueue</cmd> <session_id>1234</session_id> <wo_id>wo1</wo_id> <item_id></item_id> </request>

StartDataEntryJob Method
Purpose To create and start a new data entry job on the fly by ending the current job on an entity. Syntax StartDataEntryJob(session_id, user_id, ent_id, wo_id, oper_id, item_id, est_prod_rate, uom_id) Parameters Part session_id Description Required. By Value. A variant (long) to identify the valid session from which the job is being started. Required. By Value. A variant (string) to identify the user_id starting the job. Required. By Value. A variant (long) to identify the entity on which the job is to be run. Required. By Value. A variant (string) to identify the wo_id. Required. By Value. A variant (string) to identify the oper_id.

user_id

ent_id

wo_id oper_id

2004 CIMNET Inc

www.CimnetInc.com

179

item_id est_prod_rate

Required. By Value. A variant (string) to identify the item_id. Required. By Value. A variant (double) to identify the estimated production rate. Optional. By Value. A variant (long) to identify the uom_id. Defaults to Null.

uom_id

Returns Long. 0 if successful, else -1 Remarks The wo_id, oper_id, item_id and ent_id are all required to identify the job to be started on the specified entity. The session_id is required for licensing checks. The user_id is used for checking the privileges. This method first checks whether the supplied entity can run jobs. An exception is raised if the supplied entity cannot run jobs. This method then checks if the supplied item exists in the database. If not, a new item is created on the fly with the default values. This first item_class record where produced is set to 1 (true) is the item_class which is used to create this new item. An exception is raised if there are no item classes where produced is set to true. An exception is also raised if the supplied item matches the existing item in the item table and the supplied uom_id does not match the corresponding uom_id column in the item table. A new work order is created with its default values if the supplied work order does not exist in the database. An exception is raised if the supplied work order exists and the work order state is closed. This method then checks whether the supplied job exists in the database and the supplied entity matches with the run_ent_id field in the job table. An exception is thrown, if a job exists and the supplied item does not matches with the existing jobs item. The supplied est_prod_rate is updated with the existing jobs record, if the supplied est_prod_rate does not match with the existing est_prod_rate column in the jobs table. If such a job does not exist, a new job record is created on the fly with its default values. The init_sched_ent_id and target_sched_ent_id values are assigned with the supplied ent_id value, only if the supplied entity can schedule jobs. If not, the first preferred ancestor entity that is schedulable is assigned to the init_sched_ent_id and target_sched_ent_id fields. An exception is thrown, if neither the supplied entity nor any of its ancestor entities can schedule jobs. The run_ent_id field is assigned with the supplied ent_id value. The seq_no and the display_seq_no are the next highest numbers of the supplied work order. If any job is running on the supplied entity that differs from the supplied wo_id and oper_id, then that job is ended on the supplied entity whose job position is 0. After the current job is ended successfully, a job that was newly created or the job that was retrieved is started on the supplied entity at job position = 0. Stored Procedure(s) Used sp_U_Job_Exec_StrtDataEntryJob Access via Director.cls using ExecuteXMLCmd()

Yes. The XML request must be formatted to include the required method parameters as follows:
<request> <object>job_exec</object> <msgtype>exec</msgtype> <cmd>StartDataEntryJob</cmd> <session_id>123456</session_id>
2004 CIMNET Inc

www.CimnetInc.com

180

<user_id>cimnet</user_id> <ent_id>1211</ent_id> <wo_id>wo1</wo_id> <oper_id>10</oper_id> <item_id>bevcola</item_id> <est_prod_rate>1</est_prod_rate> <uom_id></uom_id> </request>

AddConsDirect Method
Purpose To capture specific consumption data. Syntax AddConsDirect(session_id, from_ent_id, item_id, lot_no, qty_cons, reas_cd, grade_cd, status_cd, user_id, wo_id, oper_id, seq_no, shift_start, fg_lot_no, item_scrapped, ent_id, shift_id, qty_cons_erp, ext_ref, transaction_type, spare1, spare2, spare3, spare4, row_id) Parameters Part session_id Description Required. By Value. A variant (long) to identify the valid session from which the job is being started. Required. By Value. A variant (long) to identify the entity where the item is consumed from the inventory. Required. By Value. A variant (string) to identify the item_id. Required. By Value. A variant (string) to identify the lot_no Required. By Value. A variant (double) specifying the quantity to be consumed from the inventory. Required. By Value. A variant (long) specifying the reason code for this quantity consumed. Required. By Value. A variant (long) specifying the grade code for this quantity consumed. Required. By Value. A variant (long) specifying the status code for this quantity consumed. Required. By Value. A variant (string) to identify the uesr_id. Optional. By Value. A variant (string) to identify the wo_id. Defaults to Null. Optional. By Value. A variant (string) to identify the oper_id.

from_ent_id

item_id lot_no qty_cons

reas_cd

grade_cd

status_cd

user_id wo_id

oper_id

2004 CIMNET Inc

www.CimnetInc.com

181

Defaults to Null. seq_no Optional. By Value. A variant (long) to identify the seq_no. Defaults to Null. Optional. By Value. A variant (datetime) to identify the shift_start. Defaults to Null. Optional. By Value. A variant (string) to identify the fg_lot_no. Defaults to Null. Optional. By Value. A variant (int) to specify the item_scrapped. Defaults to 0. Optional. By Value. A variant (long) to identify the ent_id. Defaults to Null. Optional. By Value. A variant (long) to identify the shift_id. Defaults to 0. Optional. By Value. A variant qty_cons_erp. Defaults to 0. (double) to identify the

shift_start

fg_lot_no

item_scrapped

ent_id

shift_id

qty_cons_erp

ext_ref transaction_type

Optional. By Value. A variant (string) to identify the ext_ref. Optional. By Value. A variant transaction_type. Defaults to 0. (long) to identify the

spare1

Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to Null. Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to Null. Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to Null. Optional. By Value. A variant (string) to include optional spare fields for this row. Defaults to Null. Optional. By Ref. A variant (long) to return the row_id of the row that was just inserted or updated in the item_cons table if this call was successful.

spare2

spare3

spare4

row_id

Returns Long. 0 if successful, else -1 Remarks The supplied from_ent_id, lot_no and item_id must match a row in the item_inv table or else an exception is thrown. If an existing row matches the supplied values in the item_cons table excluding the qty_cons, qty_cons_erp, last_edit_by, last_edit_at and row_id columns, then the supplied qty_cons and qty_cons_erp are added to the existing row. If no existing rows matches the supplied values, a new row
2004 CIMNET Inc

www.CimnetInc.com

182

is created in the item_cons table with the supplied values. The qty_left and qty_left_erp values in the inventory (item_inv) table are reduced by the consumed quantities (qty_cons and qty_cons_erp) accordingly. Stored Procedure(s) Used sp_I_Item_Cons_AddConsDirect Access via Director.cls using ExecuteXMLCmd()

Yes. The XML request must be formatted to include the required method parameters as follows:
<?xml version="1.0"?> <request> <object>job_exec</object> <cmd>AddConsDirect</cmd> <msgtype>exec</msgtype> <session_id>12345</session_id> <from_ent_id>141</from_ent_id> <item_id>bevcola12pk</item_id> <lot_no>cola-414-12</lot_no> <qty_cons>1</qty_cons> <reas_cd>1234</reas_cd> <grade_cd>12</grade_cd> <status_cd>1234</status_cd> <user_id>CIMNET</user_id> <wo_id></wo_id> <oper_id></oper_id> <seq_no></seq_no> <shift_start></shift_start> <fg_lot_no></fg_lot_no> <item_scrapped>1</item_scrapped> <ent_id></ent_id> <shift_id></shift_id> <qty_cons_erp></qty_cons_erp> <ext_ref></ext_ref> <transaction_type></transaction_type> <spare1></spare1> <spare2></spare2> <spare3></spare3> <spare4></spare4> </request>

Job_Event Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns ARE available as filters: row_id, event_time, wo_id, oper_id, seq_no, step_no, event_type, ent_id, last_edit_by, last_edit_at www.CimnetInc.com

2004 CIMNET Inc

183

The following optional filter fields are applied as follows: Event_time : returns all rows where event_time >= parameter value GetAllbyXML() The following columns ARE available as filters: event_time, wo_id, oper_id, seq_no, step_no, event_type, ent_id, last_edit_by, last_edit_at The following optional filter fields are applied as follows: Event_time : returns all rows where event_time >= parameter value GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Not supported: Not have composite primary key No specific recordsets currently supported Not supported: Use job_exec.LogJobEvent() instead

Job_Sched_Exec Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are not available as filters: queue_time, sort_order, filtr, last_edit_comment The following columns are also included in the returned recordset: ent.ent_name GetAllbyXML() GetByKey() GetSpecificRS() Retrieval of the following specific recordsets are supported: GetRefreshedShiftSched (). Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS ApplySchedule() GetRefreshedShiftSched() CreateTempShiftExc() RefreshTempShiftExc() DropTempShiftExc()
2004 CIMNET Inc

The following columns are not available as filters: queue_time, sort_order, filter.

Not supported: Table does not have composite primary key.

COMMENTS

(Stub only not implemented yet) (Stub only not implemented yet)

www.CimnetInc.com

184

CreateWOAltInfo() CreateWOJobs() DropWOAltInfo()

(Stub only not implemented yet) (Stub only not implemented yet) (Stub only not implemented yet)

ApplySchedule Method
Purpose To apply the specified schedule in one transaction. Syntax ApplySchedule (session_id, schedule) Parameters Part session_Id schedule Returns Long 0 if the schedule is applied, or 1 if the schedule cannot be applied. Remarks The schedule XML string will have the format as defined below. Stored Procedure(s) Used Add, Delete, and UpdateSpecific of affected classes as needed Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows (Sections, tags, or values within parentheses are optional. Values within braces are not, if their tags are present. Sections within parentheses followed by ellipsis may be repeated 0 or more times. These punctuation elements are not part of the actual XML.): <?xml version="1.0"?> <request> <object>job_sched_exec</object> <cmd>ApplySchedule</cmd> <session_id>{value}</session_id> <schedule> (<job_update> <wo_id>{value}</wo_id> <oper_id>{value}</oper_id> <seq_no>{value}</seq_no> (<target_sched_ent_id>{value}</target_sched_ent_id>)
2004 CIMNET Inc

Description Required. By Value. A variant (long) to identify the client session from which the request is being made. Required. By Value. A variant (string) containing an XML string listing the new schedule

www.CimnetInc.com

185

(<sched_pinned>{value}</sched_pinned>) (<est_setup_time>(value)</est_setup_time>) (<est_teardown_time>(value)</est_teardown_time>) (<est_prod_rate>{value}</est_prod_rate>) (<est_transfer_time>(value)</est_transfer_time>) (<sched_start_time>(value)</sched_start_time>) (<sched_finish_time>(value)</sched_finish_time>) </job_update>) (<job_bom_update> <wo_id>{value}</wo_id> <oper_id>{value}</oper_id> <seq_no>{value}</seq_no> <bom_pos>{value}</bom_pos> (<reqd_start_val>{value}</reqd_start_val>) (<reqd_start_val_is_pct>{value}</reqd_start_val_is_pct>) (<mod_id>{value}</mod_id>) </job_bom_update>) (<job_sched_exec_update> <ent_id>{value}</ent_id> (<queue_time>(value)</queue_time>) </job_sched_exec_update>) (<res_add> <res_desc>{value}</res_desc> <res_class>{value}</res_class> <qty_avail>{value}</qty_avail> <allow_neg_bal>{value}</allow_neg_bal> <num_decimals>{value}</num_decimals> </res_add>) (<res_update> <res_id>{value}</res_id> (<res_desc>{value}</res_desc>) (<res_class>{value}</res_class>) (<qty_avail>{value}</qty_avail>) (<allow_neg_bal>{value}</allow_neg_bal>) (<num_decimals>{value}</num_decimals>) (<mod_id>(value)</mod_id>) </res_update>) (<res_delete> <res_id>{value}</res_id> (<mod_id>(value)</mod_id>) </res_delete>) (<res_exc_update_or_add> <res_id>{value}</res_id> <start_time>{value}</start_time> <end_time>{value}</res_class> <comments>(value)</comments>
2004 CIMNET Inc

www.CimnetInc.com

186

<allow_neg_bal>{value}</allow_neg_bal> (<mod_id>(value)</mod_id>) </res_exc_update_or_add>) (<res_exc_delete> <res_id>{value}</res_id> <start_time>{value}</start_time> (<mod_id>(value)</mod_id>) </res_exc_delete>) (<res_job_link_update_or_add> <res_id>{value}</res_id> <wo_id>{value}</wo_id> <oper_id>{value}</oper_id> <seq_no>{value}</seq_no> <qty_reqd>{value}</qty_reqd> (<mod_id>(value)</mod_id>) </res_job_link_update_or_add>) (<res_job_link_delete> <res_id>{value}</res_id> <wo_id>{value}</wo_id> <oper_id>{value}</oper_id> <seq_no>{value}</seq_no> (<mod_id>(value)</mod_id>) </res_job_link_delete>) (<shift_exc_addition> <ent_id>{value}</ent_id> <start_time>{value}</start_time> <end_time>{value}</end_time> (<shift_id>(value)</shift_id>) <additive>{value}</additive> </shift_exc_addition>) (<shift_exc_update> <ent_id>{value}</ent_id> <start_time>{value}</start_time> (<end_time>{value}</end_time>) (<shift_id>{value}</shift_id>) (<additive>{value}</additive>) (<mod_id>(value)</mod_id>) </shift_exc_update>) (<shift_exc_delete> <ent_id>{value}</ent_id> <start_time>{value}</start_time> (<mod_id>(value)</mod_id>) <shift_exc_delete>) (<wo_update> <wo_id>{value}</wo_id> (<release_time>(value)</release_time>)
2004 CIMNET Inc

www.CimnetInc.com

187

(<req_finish_time>(value)</req_finish_time>) (<wo_priority >(value)</wo_priority>) (<mod_id>{value}</mod_id>) </wo_update>) </schedule> </request>

RefreshTempShiftExc Method
Purpose Refresh the contents of the temporary data in temp_shift_exc table with the contents of the "real" Shift_Exc table. Syntax RefreshTempShiftExc (session_id) Parameters Part session_id Returns True if successfully refreshed, else False. Remarks Each session will have independent data in temp_shift_exc table. This method copies all the data from shift_exc table to temp_shift_exc table tied up with the session_id Stored Procedure(s) Used sp_U_JSE_RefreshTempShiftExc Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version=1.0> <request> <object>job_sched_exec</object> <cmd>RefreshTempShiftExc</cmd> <msgtype>exec</msgtype> <session_id>12121</session_id> </request> Description Required. By Value. A variant (long) to identify a valid session to identify the data to be refreshed from shift_exc.

DropTempShiftExc Method
Purpose Deletes the data from Temp_Shift_Exc table.
2004 CIMNET Inc

www.CimnetInc.com

188

Syntax DropTempShiftExc (session_id) Parameters Part session_id Returns True if successfully refreshed, else False. Remarks Each session will have independent data in temp_shift_exc table. All data in temp_shift_exc table corresponding to the session_id are deleted. Stored Procedure(s) Used sp_U_JSE_DropTempShiftExc Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version=1.0> <request> <object>job_sched_exec</object> <cmd>DropTempShiftExc</cmd> <session_id>12121</session_id> </request> Description Required. By Value. A variant (long) to identify a valid session

CreateWOAltInfo Method
Purpose TBD Create a temporary table which returns all combination of possible jobs.; 0 if successful.

CreateWOJobs Method
Purpose TBD To instantiate a particular set of jobs to a particular work order; 0 if successful.

DropWOAltInfo Method
Purpose TBD Drop the temporary table generated by CreateWoAltInfo; 0 if successful.

2004 CIMNET Inc

www.CimnetInc.com

189

Job_State Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported COMMENTS All fields except last_edit_comment are permitted as optional filter parameters As for GetAll()

WO Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: req_qty, notes, not_deletable, last_edit_comment, mod_id, row_id. If the release_time filter is included all rows AT AND AFTER the specified filter are included. If the req_finish_time filter is included all rows AT AND BEFORE the specified filter are included. The following columns are also included in the returned recordset : process.process_desc, item.item_desc GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() mod_id is optional Stub only. No specific recordsets currently supported As for GetAll()

Wo_Attr Class
Summary of the methods supported by this class:
2004 CIMNET Inc

www.CimnetInc.com

190

STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset : attr.attr_desc, attr.data_type, wo.wo_desc As for GetAll()

Stub only. No specific recordsets currently supported

Job Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS

The following fields are not permitted as optional filter parameters to increase performance: job_desc, qty_reqd, qty_prod, qty_prod_erp, qty_rejected, qty_rejected_erp, sched_pinned, qty_at_start, batch_size, check_inv, est_fixed_lab, est_lab_rate, est_setup_time, est_teardown_time, est_prod_rate, est_transfer_time, job_cost, notes, assoc_file, assoc_file_type, status_notes, display_seq, data_log_grp_id, folder_ver_id, last_edit_comment, row_id If any of the req_finish_time, sched_start_time, latest_start_time or sched_finish_time optional filters are included all rows with these values AT OR BEFORE the filter datetime are included in the resultset.
If any of the act_start_time, act_finish_time or edit_time optional filters are included all rows with edit_time value AT OR AFTER the filter datetime are included in the resultset. The following columns are also included in the returned recordset: wo.wo_desc, wo.req_qty, item.item_desc, ent.ent_name as init_sched_ent_name (init_sched_ent_id), ent.ent_name as target_sched_ent_name (target_sched_ent_id), ent.ent_name as run_ent_name (run_ent_id), data_log_grp.grp_desc as data_log_grp_desc,

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd()

As for GetAll()

Stub only. No specific recordsets currently supported

2004 CIMNET Inc

www.CimnetInc.com

191

IsValid() SPECIFIC METHODS GetCanLogDataCapability GetDisplaySeq() GetNextSeqNo() COMMENTS

GetCanLogDataCapability Method
Purpose To return a value indicating a job that can log data or not. Syntax GetCanLogDataCapability(wo_id, oper_id, seq_no, can_log_data) Parameters Part wo_id oper_id seq_no can_log_data Returns Long. A Variant (long) value resulting a job that can log data or not. Remarks This method first extracts the init_sched_ent_id and the target_sched_ent_id from the job table and checks whether these entities can log data. If not, then this method walks through all their descendent entities to find out whether this job can log data. The method returns True (=1) as soon as any first descendent entity that can log data is found otherwise it returns 0. Stored Procedure(s) Used sp_SA_Job_Can_Log_Data Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job</object> <msgtype>exec</msgtype> <cmd>GetCanLogDatCapability</cmd> <wo_id>wo1</wo_id> <oper_id>10</oper_id> <seq_no>1</seq_no> </request>
2004 CIMNET Inc

Description Required. By Value. A variant (string) to identify the wo_id Required. By Value. A variant (string) to identify the oper_id Required. By Value. A variant (long) to identify the seq_no Optional. By Ref. A variant (long) resulting the can_log_data capability

www.CimnetInc.com

192

Sample XML Response: <?xml version="1.0"?> <response> <result>0</result> <can_log_data>1</can_log_data>

</response> GetDisplaySeq Method


Purpose To return the next available display_seq no for a specific job. Syntax GetDisplaySeq(wo_id, oper_id, display_seq) Parameters Part wo_id oper_id display_seq Returns Long. A Variant (long) value resulting the next available display seq no. Remarks This method returns 1 if job does not exist, otherwise it returns max display seq + 1. Stored Procedure(s) Used sp_SA_Job_GetDisplaySeq Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job</object> <msgtype>exec</msgtype> <cmd>GetDisplaySeq</cmd> <wo_id>wo1</wo_id> <oper_id>10</oper_id> </request> Sample XML Response: <?xml version="1.0"?> <response>
2004 CIMNET Inc

Description Required. By Value. A variant (string) to identify the wo_id Required. By Value. A variant (string) to identify the oper_id Required. By Ref. A variant (long) resulting the next available display seq_no.

www.CimnetInc.com

193

<result>0</result>

<display_seq>1</display_seq> </response> GetNextSeqNo Method


Purpose To return the next seq no for a specific job. Syntax GetNextSeqNo(wo_id, oper_id, next_seq_no) Parameters Part wo_id oper_id next_seq_no Returns Long. A Variant (long) value resulting the next available seq no Remarks This method returns 1 if job does not exist, otherwise it returns max seq_no + 1. Stored Procedure(s) Used sp_SA_Job_GetNextSeqNo Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job</object> <msgtype>exec</msgtype> <cmd>GetNextSeqNo</cmd> <wo_id>wo1</wo_id> <oper_id>10</oper_id> </request> Sample XML Response: <?xml version="1.0"?> <response> <result>0</result> Description Required. By Value. A variant (string) to identify the wo_id Required. By Value. A variant (string) to identify the oper_id Required. By Ref. A variant (long) resulting the next available seq_no.

<next_seq_no>1</next_seq_no> </response>

2004 CIMNET Inc

www.CimnetInc.com

194

Job_Attr Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset: attr.attr_desc, attr.data_type As for GetAll()

Job_Route Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Retrieval of the following specific recordsets are supported: GetJobPath(). Available filters are: wo_id, sort_order GetJobRoute(). Available filters are: wo_id Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id As for GetAll()

GetJobPath Method
Purpose To get a list of jobs for a work order in the order the jobs should be run.

2004 CIMNET Inc

www.CimnetInc.com

195

Syntax GetJobPath (wo_id, sort_ascending) Parameters Part wo_id sort_order Returns ADODB.recordset with the wo_id, oper_id, seq_no, and max_path_len. Remarks This method starts with the final jobs for the work order and works its way towards the first jobs. Each step away from the final job adds to the max_path_len. Where more than one job feeds another job, the max_path_len will be the same. Stored Procedure(s) Used sp_SA_Job_GetJobPath Access via Director.cls using GetSpecificRS() Yes, Returns recordset in XML format. The XMLCmd parameter must be formatted to include the user_id parameter as follows: <?xml version="1.0"?> <request> <object>job_route</object> <msgtype>GetSpec</msgtype> <cmd>GetJobPath</cmd> <wo_id>SampleWO-CIMWO1</wo_id> <sort_acsending>1</sort_acsending> </request> Description Required. By Value. A variant (string) to identify the Work Order Id Optional. By Value. A variant (Boolean) to determine the sort order (default is True)

GetJobRoute Method
Purpose Returns the record set needed to build the routing diagram for a work order. Syntax GetJobRoute (wo_id) Parameters Part Description

2004 CIMNET Inc

www.CimnetInc.com

196

wo_id Returns

Required. By Value. A Variant (string) to identify the work order.

ADODB.recordset. Columns are wo_id, oper_id, seq_no, run_ent_id, run_ent_name, qty_prod, qty_reqd, target_sched_ent_id, target_sched_ent_name, start_cd, color, and display seq. Remarks This method builds a recordset that can be used to build the routing diagram for the specified work order. Stored Procedure(s) Used sp_SA_Job_GetJobRoute Access via Director.cls using GetSpecificRS() Yes. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>wo</object> <msgtype>GetSpec</msgtype> <cmd>GetJobRoute</cmd> <wo_id>wo1</wo_id> </request>

Item_Prod Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: qty_prod, qty_prod_erp, last_edit_comment If the following optional filter fields are included the filter test is as follows:: Last_Edit_at returns all rows where last_edit_at >= parameter value The following columns are also included in the retunred recordset: user_name.user_desc, item.item_desc, item_reas.reas_desc, ent.ent_name, shift.shift_desc, item_grade.item_grade_desc, item_grade.color as item_grade_color, item_state.item_status_desc, item_state.color as item_state_color, ent.ent_name as to_ent_name (to_ent_id) GetAllbyXML() The following columns are NOT available as filters: qty_prod, qty_prod_erp, last_edit_comment If the following optional filter fields are included the filter test is as follows:: Last_Edit_at returns all rows where last_edit_at >= parameter value GetByKey() This method also supports fetching a single row using its effective primary keys. Either row_id OR all of the following optional parameters must be supplied to fetch a single row: wo_id, oper_id, seq_no, shift_start, item_id, lot_no, rm_lot_no, reas_cd, user_id No specific recordsets currently supported Not supported. Use job_exec.AddProd() and AddProdPostExec() to add rows to this table.

GetSpecificRS() Add()

2004 CIMNET Inc

www.CimnetInc.com

197

Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS Split() COMMENTS Used to split a production row eg if some produced goods are rejected.

Split Method
Purpose To split a given row in the production transaction table. The quantity that is split may result in a new row or it may simply add to another existing row if the primary key fields matches Syntax Split (session_id, old_row_id, split_qty_prod, new_wo_id, new_oper_id, new_seq_no, new_shift_start, new_item_id, new_lot_no, , new_reas_cd, new_user_id, new_ent_id, new_shift_id, new_to_ent_id, split_qty_prod_erp, split_processed_flag, split_byproduct_flag) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A long to identify the existing row_id on which the production has to be splitted Required. By Value. A double specifying the production quantity to be split. Must be less than or equal to the current quantity for this row. Optional. By Value. A variant (string) to identify the new wo_id. Defaults to the value in the existing row. Optional. By Value. A variant (string) to identify the new oper_id. Defaults to the value in the existing row. Optional. By Value. A variant (long) to identify the new seq_no. Defaults to the value in the existing row. Optional. By Value. A variant (date) to identify the new shift during which this production occurred. Defaults to the value in the existing row. Optional. By Value. A variant (string) to identify the new item_id. Defaults to the value in the existing row.
www.CimnetInc.com

old_row_id

split_qty_prod

new_wo_id

new_oper_id

new_seq_no

new_shift_start

new_item_id

2004 CIMNET Inc

198

new_lot_no

Optional. By Value. A variant (string) to identify the new lot number for this quantity produced. Defaults to the value in the existing row. Optional. By Value. A variant (long) to identify the new reason code for this quantity produced (production code or reject reason). Defaults to the value in the existing row. Optional. By Value. A variant (string) to identify the new user for this quantity produced. Defaults to the value in the existing row. Optional. By Value. A variant (long) to identify the new entity on which the split production occurred. Defaults to the value in the existing row. Optional. By Value. A variant (long) to identify the new shift ID. Defaults to the value in the existing row. Optional. By Value. A variant (long) to identify the new storage entity for the split quantity. Defaults to the value in the existing row. Optional. By Value. A variant (double) specifying the split production quantity that has been reported to an ERP system. Defaults to the same ratio of qty_prod as in the existing row. Optional. By Value. A variant (boolean) to specify the processed flag value for the split quantity. Defaults to the value in the existing row. Optional. By Value. A variant (boolean) to specify whether the split quantity is a byproduct or not. Defaults to the value in the existing row.

new_reas_cd

new_user_id

new_ent_id

new_shift_id

new_to_ent_id

split_qty_prod_erp

split_processed_flag

split_byproduct_flag

Returns Integer. 0 if successful, else -1 Remarks The required fields identify the current row and the quantity to be split. The split quantity must be less than or equal to the qty_prod value in the existing row. (An equal quantity is equivalent to simply updating the existing row. All optional fields default to the value in the existing row, except the split_qty_prod_erp field which defaults to the same percentage of qty_prod as in the existing row. At least one of the new_*** values that forms the primary key must be specified to identify the destination row for the split. If a row already exists in the database for the split destination row, then the split quantity will simply be added to the existing row. If any other optional dependent fields are specified then they will be changed for the split row. NB This may overwrite existing dependent data for the destination row. If the wo_id, oper_id or seq_no change (ie. indicating a new job) and this job does not exist then an error is returned.
2004 CIMNET Inc

www.CimnetInc.com

199

If the new_shift_start value is specified then the new_shift_id must also be specified. No validation checks are done on these values. If the new_item_id value is specified then it must exist in the database otherwise an error is returned. If the new_reas_cd value is specified then it must exist in the database otherwise an error is returned. If it exists then it will be used to determine the grade_cd, status_cd and good_prod flag for the split row. The ext_ref, move_status and spare fields are set to the current values in the existing row. The last_edit_at field of the new row is set to the current datetime. Stored Procedure(s) Used Sp_I_item_prod_Split Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>item_prod</object> <msgtype>exec</msgtype> <cmd>split</cmd> <session_id>123</session_id> <old_wo_id>xyz</ old_wo_id> <old_oper_id>20</old_oper_id> <old_seq_no>0< old_seq_no> <old_shift_start>9/9/2001 7:00AM</old_shift_start> <old_item_id>item1</old_item_id> <old_lot_no>lotabc</old_lot_no> <old_reas_cd>1</old_reas_cd> <old_user_id>111</old_user_id> <split_qty_prod>5.14</split_qty_prod> <new_wo_id></new_wo_id> <new_oper_id></new_oper_id> <new_seq_no><new_seq_no> <new_shift_start></new_shift_start> <new_item_id></new_item_id> <new_lot_no></new_lot_no> <new_reas_cd>123</new_reas_cd> <new_user_id></new_user_id> <new_ent_id></new_ent_id> <new_shift_id></new_shift_id> <new_to_ent_id></new_to_ent_id> <split_qty_prod_erp></split_qty_prod_erp> <split_processed_flag></split_processed_flag> <split_byproduct_flag></split_byproduct_flag> </request>

Process_Class Class
Summary of the methods supported by this class:
2004 CIMNET Inc

www.CimnetInc.com

200

STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

COMMENTS The following columns ARE available as filters: process_class_id, last_edit_by, last_edit_at The following columns ARE available as filters: process_class_id, last_edit_by, last_edit_at

No specific recordsets currently supported.

Not supported: No dependent data Not supported: No dependent data

Not supported: Table does not have composite primary key.

Process Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: notes, last_edit_comment, mod_id, row_id. If the following fields are included as filters the filter is not equality: Created_at returns all rows where created_at >= parameter value Last_Edit_at returns all rows where last_edit_at >= parameter value Last_Status_Change_at returns all rows where last_status_change_at >= parameter value. The following columns are also included in the returned recordset : user_name.user_desc as creator_desc (creator), user_name.user_desc as approver_desc (approver), user_name.user_desc as last_editor_desc (last_editor), user_name.user_desc as last_user_to_change_status_des (last_user_to_change_status), user_name.user_desc as checked_out_by_desc (checked_out_by) GetAllbyXML() GetByKey() GetSpecificRS() Retrieval of the following specific recordsets are supported: GetItemProdAtOper(). Available filters are: process_id, oper_id, item_id, item_produced GetProducedItems(). Available filters are: item_id, process_id Add() The session_id and user_id must be included as parameters. The following fields are not available as parameters as they are populated automatically by the middleware: creator, approver, created_at, last_editor, last_edit_at, last_user_to_change_status, last_status_change_at, checked_out_by. By default the new process is automatically checked out to the user who inserted it. Not supported as many fields are updated automatically. Use UpdateSpecific() instead. www.CimnetInc.com As for GetAll()

Update()

2004 CIMNET Inc

201

UpdateSpecific()

The session_id and user_id must be included as parameters. The following fields are not available as parameters as they are populated automatically by the middleware: creator, approver, created_at, last_editor, last_edit_at, last_user_to_change_status, last_status_change_at, checked_out_by. In future this process will have to be checked out by this user for the update to be successful. The session_id and user_id must be included as parameters. Not supported use Delete().

Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS Clone() CheckIn() CheckOut() GetNextVerId()

COMMENTS Clone an existing Process to a new Process CheckIn a process that a user has checked out Checkout a process for a user to edit. Returns the next process version id in the process class

Clone Method
Purpose To clone an existing Process in the database supplying a new Process ID. Syntax Clone (session_id, user_id, existing_process_id, new_process_id, new_process_desc, new_process_ver_id, disassociate_items) Parameters Part session_Id user_id existing_process_id new_process_id new_process_desc new_process_ver_id disassociate_items Description Required. By Value. A variant (long) to identify the client session from which the request is being made. Required. By Value. A variant (string) to identify the user Required. By Value. A variant (string) to identify the source Process Id Required. By Value. A variant (string) to identify the new Process Id. Required. By Value. A variant (string) to identify the new process description Optional. By Value. A variant (string) to identify the new process version id Optional. By Value. A variant (boolean) to specify whether or not the items are cloned with the process. Default = True (ie. do not include items)

Returns Boolean. If called in XML format the mod_id for the new record is also returned.
2004 CIMNET Inc

www.CimnetInc.com

202

Remarks All data in the Process, Process_Attr, Oper, Oper_Attr, Oper_Step_Grp, Oper_Step, Oper_Ent_Link, Oper_Ent_Route, Oper_Spec_Ver, Oper_Ent_Spec, Oper_Step_Ent_Exc and Oper_Step_File, Cert_Oper_Link and Cert_Oper_Step_Link for the exising_process_id are cloned to the new_process_id. If disassociate_items is false, all data in the Item_Process_Link, BOM_Item_Oper_Link, and BOM_Item_Oper_Step_Link, BOM_Item_Oper_Spec are cloned to the new_process_id. Stored Procedure(s) Used sp_I_Process_Clone Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>process</object> <msgtype>Exec</msgtype> <cmd>Clone</cmd> <session_id>111</session_id> <user_id>testuser</user_id> <existing_process_id>CIMWO1</existing_process_id> <new_process_id>CIMWO1_V2</new_process_id> <new_process_desc>CIMWO1_V2 cloned process</new_process_desc> <new_process_ver_id></new_process_ver_id> <disassociate_items>0</ disassociate_items > </request>

CheckIn Method
Purpose CheckIn a process that a user has checked out. Syntax CheckIn (user_id, process_id) Parameters Part user_id process_Id Returns Long 0. if the specified process was checked in successfully. Throws an exception with an appropriate error description if it fails. Remarks This method will return successful only when the supplied user_id is same as the user_is in the checked_out_by field for the process. If both the user_ids are same, then it nullifies the checked_out_by
2004 CIMNET Inc

Description Required. By Value. A variant (string) to identify the user_id Required. By Value. A variant (string) to identify the process_id

www.CimnetInc.com

203

field in the process table. The appropriate error message is returned if the method fails. Stored Procedure(s) Used sp_U_Process_CheckIn Access via Director.cls using GetSpecificRS() The XML input parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>process</object> <cmd>CheckIn</cmd> <msgtype>exec</msgtype> <user_id>TestUser1</user_id> <process_id>TestProc1</process_id> </request>

CheckOut Method
Purpose Checkout a process for a user to edit. Syntax Checkout (user_id, process_id) Parameters Part user_id process_Id Description Required. By Value. A variant (string) to identify the user_id Required. By Value. A variant (string) to identify the process_id

Returns Long 0. if the specified process was checked out successfully. Throws an exception with an appropriate error description if it fails. Remarks This method first checks the user has a valid privilege to edit the process. This method will return successful only when the user has a valid permission to edit the process, the process is not currently checked out by another user, and the process is not a certified process. In all other cases, this method will fail and returns the appropriate error messages. The supplied user_id is written to the checked_out_by field of the process record if the check out succeeds. Stored Procedure(s) Used sp_U_Process_CheckOut

2004 CIMNET Inc

www.CimnetInc.com

204

Access via Director.cls using GetSpecificRS() The XML input parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>process</object> <cmd>CheckOut</cmd> <msgtype>exec</msgtype> <user_id>TestUser1</user_id> <process_id>TestProc1</process_id> </request>

GetNextVerId Method
Purpose Returns the next process version id in the process class. Syntax GetNextVerId(process_class_id, next_process_ver_id) Parameters Part process_class_id Description Required. By Value. A Variant (string) to identify the process class id Required. By Ref. A Variant (string) resulting the next process version id

next_process_ver_id

Returns Long. The value of next process version id is returned via next_process_ver_id byref parameter Remarks This method is used to get the next process version id in the process class. The process version format is specified in the system attribute table (=223). Also, this method returns the next process version only if the Automatically Generate Process Version Numbers system attribute (=220) is set to true. When called via ExecuteXMLCmd(), the resultant version id is returned via identity field. Stored Procedure(s) Used sp_SA_Process_GetNextVerId Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>process</object> <msgtype>exec</msgtype> <cmd>GetNextVerId</cmd>
2004 CIMNET Inc

www.CimnetInc.com

205

<process_class_id>pclass</process_class_id> </request>

GetItemProdAtOper Method
Purpose To return a recordset containing a list of all items that can be produced by a process at a specific operation. Syntax GetItemProdAtOper(process_id, oper_id, item_id, item_produced) Parameters Part process_id oper_id item_id item_produced Description Required. By Value. A variant (string) to identify the Process Required. By Value. A variant (string) to identify the Operation Required. By Value. A variant (string) to identify the final item produced by the process. Optional. By Value. A variant (long) to define whether the recordset should contain all the items produced by the process (=0) or the item produced at a specific operation (=1)

Returns ADODB.recordset. The recordset columns includes the following: parent_item_id, parent_ver_id, item_id, ver_id, ver_comments, item_prod. Remarks This method lists all possible items that can be produced by a process at a specific operation. The item_prod column in the recordset indicates the item being produced by the given operation. If item_produced flag is set (=1), then the recordset only returns the items that are produced at a specific operation along with all the preferred versions for the produced items. Stored Procedure(s) Used sp_SA_Process_GetItmProdAtOper Access via Director.cls using GetSpecificRS() <?xml version="1.0"?> <request> <object>process</object> <msgtype>getspec</msgtype> <cmd>GetItemProdAtOper</cmd> <process_id>process1</process_id> <oper_id>10</oper_id> <item_id>itemA</item_id> <item_produced></item_produced> </request>
2004 CIMNET Inc

www.CimnetInc.com

206

GetProducedItems Method
Purpose To return a recordset containing a list of all processes and its produced items. Syntax GetProducedItems(process_id, item_id, oper_exist) Parameters Part process_id item_id oper_exist Returns ADODB.recordset. The recordset columns includes the following: process_id, item_id and item_desc. Remarks This method lists all processes and the items that can be produced by the process. If the optional process_id is included, then this method returns only the process_id which is included, along with all the items that can be produced by the process. If the optional item_id is included, then this method returns all the process that can produce the specified item. If oper_exist flag is set to 1 (true), then this method returns the processes that has atleast one operation exists, and the processes that does not have any operations are excluded from the resultset. Stored Procedure(s) Used sp_SA_Process_GetProducedItems Access via Director.cls using GetSpecificRS() <?xml version="1.0"?> <request> <object>process</object> <msgtype>getspec</msgtype> <cmd>GetProducedItems</cmd> <process_id>process1</process_id> <item_id>itemA</item_id> <oper_exist></oper_exist> </request> Description Optional. By Value. A variant (string) to identify the process. Optional. By Value. A variant (string) to identify the item. Optional. By Value. A variant (long) to specify the oper_exist flag. Defaults to 0.

Process_Attr Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset : attr.attr_desc, attr.data_type www.CimnetInc.com

2004 CIMNET Inc

207

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

As for GetAll()

Stub only. No specific recordsets currently supported

Item_Process_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset: item.item_desc, process.process_desc, process.process_status, process.process_level, item_class.item_class_id, item_class.item_class_desc As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS GetNextItemPref

Stub only. No specific recordsets currently supported

COMMENTS Returns the next available item preference number

GetNextItemPref Method
Purpose Returns the next available item preference number. Syntax GetNextItemPref(process_id) Parameters

2004 CIMNET Inc

www.CimnetInc.com

208

Part process_id Returns Long. Remarks

Description Required. By Value. A Variant (string) to identify the process.

This method finds the largest item preference for the process, and returns the next higher number. Stored Procedure(s) Used sp_SA_IPL_GetNextItemPref Access via Director.cls using GetSpecificRS() Yes. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>item_process_link</object> <msgtype>GetSpec</msgtype> <cmd>GetNextItemPref</cmd> <process_id>proc1</process _id> </request>

Oper Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: def_reject_rate, display_seq, oper_cost, assoc_file, assoc_file_type, notes, data_log_grp_id, last_edit_comment, mod_id, row_id. The following columns are also included in the returned recordset : process.process_desc As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

Stub only. No specific recordsets currently supported

Oper_Attr Class
Summary of the methods supported by this class:
2004 CIMNET Inc

www.CimnetInc.com

209

STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset : attr.attr_desc, attr.data_type As for GetAll()

Stub only. No specific recordsets currently supported

Oper_Ent_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: est_fixed_lab, est_lab_rate, est_setup_time, est_teardown_time, est_prod_rate, batch_size, est_transfer_time, init_prod_pct, last_edit_comment, mod_id, row_id The following columns are also included in the returned recordset : ent.ent_name, process.process_desc As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete()

Stub only. No specific recordsets currently supported

This method also deletes all rows in other tables for this entity as defined by cascade deletes in the database. The delete Stored Procedure has also been modified to do the following which are not possible using standard database functionality:
Delete All rows in the oper_ent_route table where this row is an input or an output operation.

DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS GetCanLogDataCapability COMMENTS

GetCanLogDataCapability Method
2004 CIMNET Inc

www.CimnetInc.com

210

Purpose To return a value indicating data can be logged at this operation or not. Syntax GetCanLogDataCapability(process_id, oper_id, step_no, can_log_data) Parameters Part process_id oper_id Step_no can_log_data Returns Long. A Variant (long) value resulting that can log data or not Remarks This method first extracts the ent_id from the oper_ent_link table based on supplied process_id and oper_id, and checks whether this entity can log data. If more than one entity exists in the oper_ent_link table for the supplied process_id and oper_id, then it loops through all the entities in the oper_ent_link table for the supplied process_id and oper_id and checks every entity to see if it or its descendent entities can log data at this operation. Entities that are specified in the oper_step_ent_exc table for a specific step in this process are ignored. This method returns True (=1) as soon as any first descendent entity that can log data is found otherwise it returns 0. Stored Procedure(s) Used sp_SA_OEL_Can_Log_Data Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>oper_ent_link</object> <msgtype>exec</msgtype> <cmd>GetCanLogDatCapability</cmd> <process_id>processA</process_id> <oper_id>10</oper_id> <step_no>1</step_no> </request> Sample XML Response: <?xml version="1.0"?> <response> <result>0</result> <can_log_data>1</can_log_data> </response> Description Required. By Value. A variant (string) to identify the process_id Required. By Value. A variant (string) to identify the oper_id Required. By Value. A variant (long) to identify the step_no Optional. By Ref. A variant (long) resulting the can_log_data capability

2004 CIMNET Inc

www.CimnetInc.com

211

Oper_Ent_Route Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset : process.process_desc, ent.ent_name, ent.ent_name as input_ent_name (input_ent_id) As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

Stub only. No specific recordsets currently supported

Oper_Ent_Item_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported COMMENTS The following fields are not permitted as optional filter parameters to increase performance: est_fixed_lab, est_lab_rate, est_setup_time, est_teardown_time, est_prod_rate, est_transfer_time, init_prod_pct, last_edit_comment, row_id As for GetAll()

OEE_Exec Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: target_perf, current_perf, target_qual, current_qual, def_prod_rate, www.CimnetInc.com

2004 CIMNET Inc

212

target_oee, current_oee, last_edit_comment The following columns are also included in the returned recordset : ent.ent_name (ent_id), ent_name as job_ent_name (job_ent_id), ent.ent_name as util_ent_name (util_ent_id), GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported As for GetAll()

TPM_Stat Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: qty_good, qty_reject, std_prod_rate. The following columns are also included in the returned recordset : ent.ent_name, shift.shift_desc, item.item_desc As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

Stub only. No specific recordsets currently supported

Lot_Attr Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() COMMENTS The following columns are NOT permitted as filters: last_edit_comment, row_id The following columns are also included in the returned recordset : attr.attr_desc, attr.data_type, item.item_desc As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

213

GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

Stub only. No specific recordsets currently supported

Not supported as there are no dependent fields Not supported as there are no dependent fields

2004 CIMNET Inc

www.CimnetInc.com

214

EnProd DLL Enhanced Methods


BOM_Ver Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following additional columns are also included in the returned recordset: item.item_desc (parent_item_id) GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS Clone() Copy() COMMENTS No specific recordsets currently supported As for GetAll()

Clone Method
Purpose To clone an existing BOM version in the database supplying a new Item ID and/or a new BOM version ID. Syntax Clone (session_id, existing_parent_item_id, existing_ver_id, new_parent_item_id, new_ver_id, new_ver_comments) Parameters Part session_id Description Required. By Value. A variant (long) to identify the client session from which the request is being made.

2004 CIMNET Inc

www.CimnetInc.com

215

existing_item_id existing_ver_id new_item_id new_ver_id new_ver_comments Returns Long. 0 if successful, else 1. Remarks

Required. By Value. A variant (string) to identify the item_id of the BOM version being cloned. Required. By Value. A variant (string) to identify the ver_id of the BOM version being cloned Required. By Value. A variant (string) to identify the item_id for the new BOM version. Required. By Value. A variant (string) to identify the ver_id for the new BOM version. Optional. By Value. A variant (string) to identify the BOM version comments for the newly cloned bom

If any data exists in the BOM_item table, it is also cloned. The existing_item_id may be the same as the new_item_id if the existing_ver_id is different from the new_ver_id, and the existing_ver_id may be the same as the new_ver_id if the existing_item_id is different from the new_item_id. This bom_ver clones data from bom_Ver, bom_Item, bom_item_oper_link, bom_item_oper_spec and bom_item_oper_step_link Stored Procedure(s) Used sp_I_BOM_Ver_Clone Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>bom_ver</object> <msgtype>Exec</msgtype> <cmd>Clone</cmd> <session_id>111</session_id> <existing_item_id>SampleItemID</ existing_item_id > <existing_ver_id>SampleVerID</ existing_ver_id > <new_item_id>NewItemID</ new_item_id > <new_ver_id>NewVerID</ new_ver_id > <new_ver_comments></new_ver_comments> </request>

Copy Method
Purpose To copy an existing BOM version in the database supplying a new Item ID and/or a new BOM version ID.

2004 CIMNET Inc

www.CimnetInc.com

216

Syntax Copy (session_id, existing_parent_item_id, existing_ver_id, new_parent_item_id, new_ver_id, new_ver_comments) Parameters Part session_id existing_item_id existing_ver_id new_item_id new_ver_id new_ver_comments Returns Long. 0 if successful, else 1. Remarks If any data exists in the BOM_item table, it is also cloned. The existing_item_id may be the same as the new_item_id if the existing_ver_id is different from the new_ver_id, and the existing_ver_id may be the same as the new_ver_id if the existing_item_id is different from the new_item_id. This bom_ver copy copies data from bom_Ver and bom_Item Stored Procedure(s) Used sp_I_BOM_Ver_Copy Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>bom_ver</object> <msgtype>exec</msgtype> <cmd>copy</cmd> <session_id>111</session_id> <existing_item_id>SampleItemID</ existing_item_id > <existing_ver_id>SampleVerID</ existing_ver_id > <new_item_id>NewItemID</ new_item_id > <new_ver_id>NewVerID</ new_ver_id > <new_ver_comments></new_ver_comments>
2004 CIMNET Inc

Description Required. By Value. A variant (long) to identify the client session from which the request is being made. Required. By Value. A variant (string) to identify the item_id of the BOM version being cloned. Required. By Value. A variant (string) to identify the ver_id of the BOM version being cloned Required. By Value. A variant (string) to identify the item_id for the new BOM version. Required. By Value. A variant (string) to identify the ver_id for the new BOM version. Optional. By Value. A variant (string) to identify the BOM version comments for the newly copied bom

www.CimnetInc.com

217

</request>

BOM_Item Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: instruction, qty_per_parent_item, max_qty_per_parent_item, min_qty_per_parent_item, def_lot_no, scaling_factor, must_consume_from_inv, may_choose_alt_inv_loc, may_create_new_lots, must_consume_from_wip, must_consume_before_prod, constant_qty, est_time, last_edit_comment, mod_id, row_id. The following additional columns are also included in the returned recordset: item.item_desc as parent_item_desc (parent_item_id), item.item (item_id), item_grade.item_desc (parent_item_id), item_reas.reas_desc (def_reas_cd), ent.ent_name (def_storage_ent_id), item.uom_id (item_id), uom.uom_description (item_id), item.num_decimals (item_id) GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported As for GetAll()

BOM_Item_Oper_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are NOT permitted as optional filter parameters to increase performance: qty_per_parent_item, reqd_start_pct, def_reas_cd, def_lot_no, def_storage_ent_id, last_edit_comment, mod_id, row_id. The following additional columns are also included in the returned recordset: item.item_desc (parent_item_id), oper.oper_desc (process_id, oper_id) GetAllbyXML() GetByKey() GetSpecificRS() Retrieval of the following specific recordsets are supported: GetBomOperInfo(). Available filters are: parent_Item_id, ver_id, process_id, oper_id Add() Update() UpdateSpecific()
2004 CIMNET Inc

As for GetAll()

www.CimnetInc.com

218

Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS ChangeProducedItem() COMMENTS To change the BOM 0 item for the operation

ChangeProducedItem Method
Purpose To change the BOM 0 item for the operation. Syntax ChangeProducedItem (session_id, process_id, oper_id, old_item_id, old_ver_id, new_item_id, new_ver_id) Parameters Part session_Id process_id oper_id old_item_id old_ver_id new_item_id new_ver_id Returns Boolean. True if the update is made or False if the update fails. Remarks The method should use zero for the BOM position since this function is only intended for changing the BOM 0 item. This method should check all upstream operations and change the item produced to the new_item_id if the item currently produced is the old_item_id. Stored Procedure(s) Used sp_U_BOM_Item_Oper_Link_ChPrIt Description Required. By Value. A variant (long) to identify the client session from which the request is being made. Required. By Value. A variant (string) to identify the process Required. By Value. A variant (string) to identify the operation Required. By Value. A variant (string) to identify the item currently produced Required. By Value. A variant (string) to identify the BOM version currently being used Required. By Value. A variant (string) to identify the item that should be produced Required. By Value. A variant (string) to identify the BOM version that should be used

2004 CIMNET Inc

www.CimnetInc.com

219

Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>bom_item_oper_link</object> <msgtype>Exec</msgtype> <cmd>ChangeProducedItem</cmd> <session_id>111</session_id> <process_id>Process 1</process_id> <oper_id>10</oper_id> <old_item_id>Item 1</old_item_id> <old_ver_id>Ver 1</old_ver_id> <new_item_id>Item 2</new_item_id> <new_ver_id>Ver 2</new_ver_id>

</request> GetBomOperInfo Method


Purpose Returns the record set of all the components used in and by-products produced by an operation. Syntax GetBomOperInfo(parent_item_id, ver_id, process_id, oper_id) Parameters Part parent_item_id Description Required. By Value. A Variant (string) to identify the item being produced at the operation. Required. By Value. A Variant (string) to identify the version of the BOM. Required. By Value. A Variant (string) to identify the process being used to produce the item. Required. By Value. A Variant (string) to identify the operation being performed..

ver_id

process_id

oper_id

Returns ADODB.recordset. Columns are bom_pos, item_desc, parent_item_id, ver_id, item_id, reqd_start_pct, QTY-CONS-ITM, TOT-QTY-AVL, QTY-CONS@OPER, mod_id, and process_id. Remarks The recordset build by this method includes the total amount of a component to be consumed or produced, the total amount already accounted for, and the amount accounted for by the operation. Stored Procedure(s) Used
2004 CIMNET Inc

www.CimnetInc.com

220

sp_SA_BIOL_GetBomOperInfo Access via Director.cls using GetSpecificRS() Yes. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>bom_item_oper_link</object> <msgtype>GetSpec</msgtype> <cmd>GetBomOperInfo</cmd> <parent_item_id>item1</parent_item _id> <ver_id>ver1.1</ver _id> <process_id>proc1</process _id> <oper_id>10</oper _id> </request>

Job_BOM Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: instruction, qty_per_parent_item, max_qty_per_parent_item, min_qty_per_parent_item, reqd_start_val, reqd_start_val_is_pct, def_lot_no, scaling_factor, must_consume_from_inv, may_choose_alt_inv_loc, may_create_new_lots, must_consume_from_wip, must_consume_before_prod, constant_qty, est_time, last_edit_comment, mod_id, row_id. The following columns are also included in the returned recordset: item.item_desc, item_grade.item_grade_desc, item_grade.color, item_reas.reas_desc, ent.ent_name, consumed_so_far (sum of item_cons.qty_cons where bom_pos > 0 else 0), job.qty_reqd, job.qty_at_start, item.num_decimals, qty_used_in_steps (sum of job_bom_step.qty_per_parent_item where bom_pos <> 0) GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS GetJobBomData() COMMENTS To return a recordset containing all job bom records for a specific work order with the values substituted if any. mod_id is optional No specific recordsets currently supported As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

221

GetJobBomData Method
Purpose To return a recordset containing all job bom records for a specific work order with the values substituted if any. Syntax GetJobBomData(wo_id, oper_id, seq_no, bom_pos) Parameters Part wo_id oper_id seq_no bom_pos Returns ADODB.recordset. Columns are job_bom.wo_id, job_bom.oper_id, job_bom.seq_no, job_bom.bom_pos, job_bom_subst_exist, job_bom.current_subst, job_bom_subst.pref, job_bom_subst.subst_level, item.item_desc, item_grade.item_grade_desc, item_grade.color, item_reas.reas_desc, ent.ent_name, job_bom.mod_id and all columns from item_id to last_edit_at are from job_bom table or from job_bom_subst table. Remarks The data is retrieved from the job_bom table only if there are no matching records in the job_bom_subst table for a given bom_pos or the job_bom.current_subst is null. But if there are matching records in a job_bom_subst table for a given bom_pos, it instead returns the data from the job_bom_subst table whose alt_no is the same as the job_bom.current_subst value. The additional column job_bom_subst_exist returns 1 (true) if matching substitution record exists in job_bom_subst table for a given bom_pos, else 0 (false) is returned. Stored Procedure(s) Used sp_SA_Job_Bom_GetJobBomData Access via Director.cls using GetSpecificRS() Yes. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>job_bom</object> <msgtype>GetSpec</msgtype> <cmd>GetJobBomData</cmd> <wo_id>wo1</wo_id> <oper_id>10</oper_id> <seq_no>1</seq_no> <bom_pos></bom_pos> </request> Description Required. By Value. A Variant (string) to identify the work order. Required. By Value. A Variant (string) to identify the oper_id. Required. By Value. A Variant (long) to identify the seq_no Optional. By Value. A Variant (long) to identify the bom_pos.

2004 CIMNET Inc

www.CimnetInc.com

222

Item_Cons Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: qty_cons, qty_cons_erp, last_edit_comment If the following optional filter fields are included they have the this effect: Last_Edit_at returns all rows where last_edit_at >= parameter value The following columns are also included in the returned recordset: item.item_desc, item_reas.reas_desc, ent.ent_name (ent_id), shift.shift_desc, item_grade.item_grade_desc, item_grade.color as item_grade_color, item_state.item_status_desc, item_state.color as status_color, ent.ent_name as from_ent_name (from_ent_id) GetAllbyXML() The following columns are NOT available as filters: qty_cons, qty_cons_erp. If the following optional filter fields are included they have the this effect: Last_Edit_at returns all rows where last_edit_at >= parameter value GetByKey() This method also supports fetching a single row using its effective primary key. Either row_id OR all of the following optional parameters must be supplied to fetch a single row: wo_id, oper_id, seq_no, shift_start, item_id, lot_no, fg_lot_no, reas_cd, user_id No specific recordsets currently supported Not supported. Use job_exec.AddCons() and AddConsPostExec() to add rows to this table.

GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS Split()

COMMENTS Used to split a production row eg if some produced goods are rejected.

Split Method
Purpose To split a given row in the consumption transaction table. The quantity that is split may result in a new row or it may simply add to another existing row if the primary key fields matches. Syntax Split (session_id, old_row_id, split_qty_cons, new_wo_id, new_oper_id, new_seq_no, new_shift_start, new_item_id, new_lot_no, , new_fg_lot_no, new_reas_cd, new_user_id, new_ent_id, new_shift_id, new_from_ent_id, split_qty_cons_erp) Parameters Part Description

2004 CIMNET Inc

www.CimnetInc.com

223

session_id

Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A long to identify the existing consumption row id to be splitted Required. By Value. A double specifying the consumption quantity to be split. Must be less than or equal to the current quantity for this row. Optional. By Value. A variant (string) to identify the new wo_id. Defaults to the value in the existing row. Optional. By Value. A variant (string) to identify the new oper_id. Defaults to the value in the existing row. Optional. By Value. A variant (long) to identify the new seq_no. Defaults to the value in the existing row. Optional. By Value. A variant (date) to identify the new shift during which this consumption occurred. Defaults to the value in the existing row. Optional. By Value. A variant (string) to identify the new item_id that was consumed. Defaults to the value in the existing row. Optional. By Value. A variant (string) to identify the new lot number for this quantity consumed. Defaults to the value in the existing row. .

old_row_id

split_qty_cons

new_wo_id

new_oper_id

new_seq_no

new_shift_start

new_item_id

new_lot_no

new_fg_lot_no

Optional. By Value. A variant (string) to identify the new FG lot number for this quantity consumed. Defaults to the value in the existing row. Optional. By Value. A variant (long) to identify the new reason code for this quantity consumed (consumption code or scrap reason). Defaults to the value in the existing row. Optional. By Value. A variant (string) to identify the new user for this quantity consumed. Defaults to the value in the existing row. Optional. By Value. A variant (long) to identify the new entity on which the split consumption occurred. Defaults to the value in the existing row. Optional. By Value. A variant (long) to identify the new shift ID. Defaults to the value in the existing row. Optional. By Value. A variant (long) to identify the new storage entity for the split quantity. Defaults to the value in the existing
www.CimnetInc.com

new_reas_cd

new_user_id

new_ent_id

new_shift_id

new_from_ent_id

2004 CIMNET Inc

224

row. split_qty_cons_erp Optional. By Value. A variant (double) specifying the split consumption quantity that has been reported to an ERP system. Defaults to the same ratio of qty_cons as in the existing row.

Returns Integer. 0 if successful, else -1 Remarks The required fields identify the current row and the quantity to be split. The split quantity must be less than or equal to the qty_cons value in the existing row. (An equal quantity provides a simple way to update the existing row but change some of the primary key values) All optional fields default to the value in the existing row, except the split_qty_cons_erp field which defaults to the same percentage of qty_cons as in the existing row. At least one of the new_*** values that forms the primary key must be specified to identify the destination row for the split. If a row already exists in the database for the split destination row, then the split quantity will simply be added to the existing row. If any other optional dependent fields are specified then they will be changed for the split row. NB This may overwrite existing dependent data for the destination row. If the wo_id, oper_id or seq_no change (ie. indicating a new job) and this job does not exist then an error is returned. If the new_shift_start value is specified then the new_shift_id must also be specified. No validation checks are done on these values. If the new_item_id value is specified then it must exist in the database otherwise an error is returned. If the new_reas_cd value is specified then it must exist in the database otherwise an error is returned. If it exists then it will be used to determine the grade_cd, status_cd and item_scrapped flag for the split row. The ext_ref and spare fields are set to the current values in the existing row. The last_edit_at field of the new row is set to the current datetime. Stored Procedure(s) Used Sp_I_item_cons_Split Access via Director.cls using ExecuteXMLCmd() <?xml version="1.0"?> <request> <object>item_cons</object> <msgtype>exec</msgtype> <cmd>split</cmd> <session_id>123</session_id> <old_row_id>2</old_row_id> <split_qty_cons>5.14</split_qty_cons> <new_wo_id></new_wo_id> <new_oper_id></new_oper_id> <new_seq_no><new_seq_no> <new_shift_start></new_shift_start> <new_item_id></new_item_id>
2004 CIMNET Inc

www.CimnetInc.com

225

<new_lot_no></new_lot_no> <new_fg_lot_no></new_fg_lot_no> <new_reas_cd>123</new_reas_cd> <new_user_id></new_user_id> <new_ent_id></new_ent_id> <new_shift_id></new_shift_id> <new_from_ent_id></new_from_ent_id> <split_qty_cons_erp></split_qty_cons_erp> </request>

Item_Subst Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS

The following columns are NOT available as filters: instruction, qty_per_parent_item, max_qty_per_parent_item, min_qty_per_parent_item, scaling_factor, must_consume_from_inv, may_choose_alt_inv_loc, may_create_new_lots, must_consume_from_wip, must_consume_before_prod, constant_qty, est_time, last_edit_comment, row_id. The following columns that are NOT allowed as optional filters are also included in the returned recordset: item.item_desc, item.uom_id, item.num_decimals

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

As for GetAll()

No specific recordsets currently supported

Bom_Item_Subst Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: instruction, qty_per_parent_item, max_qty_per_parent_item, min_qty_per_parent_item, scaling_factor, must_consume_from_inv, may_choose_alt_inv_loc, may_create_new_lots, must_consume_from_wip, must_consume_before_prod, www.CimnetInc.com

2004 CIMNET Inc

226

constant_qty, est_time, last_edit_comment, row_id. The following columns that are NOT allowed as optional filters are also included in the returned recordset: item_desc as parent_item_desc (from bom_item_subst.parent_item_id), item.item_desc (from bom_item_subst.item_id), item.uom_id, item.num_decimals (from bom_item_subst.item_id) GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported As for GetAll()

Job_Bom_Subst Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: instruction, qty_per_parent_item, max_qty_per_parent_item, min_qty_per_parent_item, scaling_factor, must_consume_from_inv, may_choose_alt_inv_loc, may_create_new_lots, must_consume_from_wip, must_consume_before_prod, constant_qty, est_time, last_edit_comment, row_id. The following columns that are NOT allowed as optional filters are also included in the returned recordset: item.item_desc, ent.ent_name as def_storage_ent_name (from job_bom_subst.def_storage_ent_id), item.uom_id, item.num_decimals GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported As for GetAll()

Oper_Step_Grp Class
2004 CIMNET Inc

www.CimnetInc.com

227

Summary of the methods supported by this class:


STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported COMMENTS The following fields are not permitted as optional filter parameters to increase performance: step_grp_desc, last_edit_comment, row_id As for GetAll()

Oper_Step Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: step_desc, std_time, allow_bypass, form_name, script_id, last_edit_comment, mod_id, row_id. The following columns are also included in the returned recordset : oper.oper_desc, process.process_desc, oper_step_grp.step_grp_seq, oper_step_grp.repeatability, can_log_data As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

Stub only. No specific recordsets currently supported

Oper_Step_File Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML()
2004 CIMNET Inc

COMMENTS The following fields are not permitted as optional filter parameters to increase performance: assoc_file, assoc_file_type, last_edit_comment, row_id As for GetAll() www.CimnetInc.com

228

GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported

Oper_Step_Ent_Exc Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Not supported as there are no dependent fields Not supported as there are no dependent fields Stub only. No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id As for GetAll()

BOM_Item_Oper_Step_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Retrieval of the following specific recordsets are supported: GetBomOperStepInfo(). Available filters are: parent_item_id, ver_id, process_id, oper_id, step_no Add() Update() UpdateSpecific()
2004 CIMNET Inc

COMMENTS The following fields are not permitted as optional filter parameters to increase performance: qty_per_parent_item, last_edit_comment, mod_id, row_id As for GetAll()

www.CimnetInc.com

229

Delete() DeleteAll() ExecuteXMLCmd() IsValid()

GetBomOperStepInfo Method
Purpose Returns the record set of all the components used in and by-products produced by a step. Syntax GeBomOperStepInfo(parent_item_id, ver_id, process_id, oper_id, step_no) Parameters Part parent_item_id Description Required. By Value. A Variant (string) to identify the item being produced at the operation. Required. By Value. A Variant (string) to identify the version of the BOM. Required. By Value. A Variant (string) to identify the process being used to produce the item. Required. By Value. A Variant (string) to identify the operation being performed. Required. By Value. A Variant (long) to identify the step being performed.

ver_id

process_id

oper_id

step_no

Returns ADODB.recordset. Columns are bom_pos, parent_item_id, ver_id, item_id, item_desc, qty_per_parent_item, qty_at_step, mod_id, qty_at_all_steps. Remarks The recordset build by this method includes the total amount of a component to be consumed or produced at the operation, the total amount already accounted for at the operation, and the amount accounted for by the step. Stored Procedure(s) Used sp_SA_BIOSL_GetBomOperStepInfo Access via Director.cls using GetSpecificRS() Yes. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>bom_item_oper_link</object> <msgtype>GetSpec</msgtype>
2004 CIMNET Inc

www.CimnetInc.com

230

<cmd>GetBomOperStepInfo</cmd> <parent_item_id>Item2</parent_item _id> <ver_id>ver1.2</ver _id> <process_id>proc1</process _id> <oper_id>10</oper _id> <step_no>1</step_no> </request>

Job_Step_Grp Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported COMMENTS The following fields are not permitted as optional filter parameters to increase performance: step_grp_desc, last_edit_comment, row_id As for GetAll()

Job_Step Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: step_desc, std_time, allow_bypass, form_name, script_id, last_edit_comment, row_id The following columns are also included in the returned recordset : job_step_grp.step_grp_desc, job_step_grp.step_grp_seq, job_step_grp.repeatability, job_step_grp.last_edit_comment as step_grp_last_edit_comment, job_step_grp.last_edit_by as step_grp_last_edit_by, job_step_grp.last_edit_at as step_grp_last_edit_at As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete()


2004 CIMNET Inc

Stub only. No specific recordsets currently supported

This method also deletes all rows in other tables for this entity as defined
www.CimnetInc.com

231

by cascade deletes in the database. The delete Stored Procedure has also been modified to do the following which is not possible using standard database functionality:
Delete All rows in the job_bom_step table where this row is referenced. (The DBMS only allows a cascade delete from job_bom to job_bom_step) DeleteAll() ExecuteXMLCmd() IsValid()

Job_Step_File Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported COMMENTS The following fields are not permitted as optional filter parameters to increase performance: assoc_file, assoc_file_type, last_edit_comment, row_id As for GetAll()

Job_BOM_Step Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() No specific recordsets currently supported COMMENTS The following fields are not permitted as optional filter parameters to increase performance: qty_per_parent_item, last_edit_comment, mod_id, row_id As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

232

IsValid()

Job_Step_Data Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS

The following fields are not permitted as optional filter parameters to increase performance: step_data, step_data_time, last_edit_comment, row_id
If any of the the act_start_time, act_finish_time or last_edit_at filters is included all rows AT AND AFTER the specified filter are included. As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

Stub only. No specific recordsets currently supported

Spec Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: units, display_seq, last_edit_comment, mod_id, row_id The resultset is sorted by display_seq GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported As for GetAll()

Oper_Spec_Ver Class
2004 CIMNET Inc

www.CimnetInc.com

233

Summary of the methods supported by this class:


STANDARD METHODS GetAll() COMMENTS

The following fields are not permitted as optional filter parameters to increase performance: ver_comments, last_edit_comment, mod_id, row_id
If the ver_date optional filter is included all rows with ver_date value AT OR AFTER the filter datetime are included in the resultset. The following columns are also included in the returned recordset : process.process_desc

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

As for GetAll()

No specific recordsets currently supported

Oper_Ent_Spec Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: spec_value, assoc_file, assoc_file_type, comments, min_value, max_value, access_level, last_edit_comment, mod_id, row_id The following columns are also included in the returned recordset : spec.grp_id, ent.ent_name, process.process_desc, spec.units, spec.spare1-4, spec.data_type GetAllbyXML() GetByKey() GetSpecificRS() Retrieval of the following specific recordsets are supported: GetSpecs(). Available filters are: process_id, oper_id, ent_id, ver_id, step_no GetItemEntSpecs(). Available filters are: process_id, oper_id, ent_id, item_id Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() As for GetAll()

GetSpecs Method
2004 CIMNET Inc

www.CimnetInc.com

234

Purpose Returns a recordset of all specs along with the value and step number if the spec if used on an entity at the operation. Syntax GetSpecs(process_id, oper_id, ent_id, ver_id, step_no) Parameters Part process_id oper_id ent_id ver_id step_no Returns ADODB.recordset. Columns are spec.grp_id, spec.spec_id, oper_ent_spec.spec_value, oper_ent_spec.step_no, and oper_ent_spec.mod_id, oper_ent_spec.access_level, spec.data_type Remarks This method performs an outer join to get a recordset of all specs in the specified version with the value and step number set if the spec is used for the entity in the operation. Stored Procedure(s) Used sp_SA_Oper_Ent_Spec_GetSpecs Access via Director.cls using GetSpecificRS() Yes. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>oper_ent_spec</object> <msgtype>GetSpec</msgtype> <cmd>GetSpecs</cmd> <process_id>proc1</process _id> <oper_id>oper1</oper _id> <ent_id>1</ent_id> <ver_id>ver1.3</ver _id> <step_no></step_no> </request> Description Required. By Value. A Variant (string) to identify the process. Required. By Value. A Variant (string) to identify the operation. Required. By Value. A Variant (long) to identity the entity. Required. By Value. A Variant (string) to BOM version. Optional. By Value. A Variant (long) to identify the step.

GetItemEntSpecs Method
Purpose
2004 CIMNET Inc

www.CimnetInc.com

235

To return a recordset containing a list of all item and entity specs for a process Syntax GetItemEntSpecs(process_id, oper_id, ent_id, item_id) Parameters Part process_id Oper_id ent_id item_id Returns ADODB.recordset. The recordset columns includes the following: process_id, oper_id, step_no, oper_ent_spec.ent_id, item_id, item_desc, bom_ver_id, bom_item_oper_spec.bom_pos, spec_ver_id, spec_id, spec_value, assoc_file, assoc_file_type, comments, min_value, max_value, access_level, entity_specs, spec.grp_id, spec.units Remarks This method lists all item and entity specs for a specific process. The entity_specs column in the resultset differentiates the entity specs and item specs. Entity specs from the oper_ent_spec table are identified by the entity_specs column where the column value equals 1. Item Specs from the bom_item_oper_spec table are identified by the entity_specs column where the column value equals 0. Only the preferred BOM version and the preferred specification version are used in the list of specs that is generated. Stored Procedure(s) Used sp_SA_OES_GetItemEntSpecs Access via Director.cls using GetSpecificRS() <?xml version="1.0"?> <request> <object>oper_ent_spec</object> <msgtype>getspec</msgtype> <cmd>GetItemEntSpecs</cmd> <process_id>process1</process_id> <oper_id>10</oper_id> <ent_id>1234</ent_id> <item_id>itemA</item_id> </request> Description Required. By Value. A variant (string) to identify the process_id Required. By Value. A variant (string) to identify the oper_id Required. By Value. A variant (long) to identify the entity Required. By Value. A variant (string) to identify the item_id

BOM_Item_Oper_Spec Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: assoc_file, assoc_file_type, comments, min_value, max_value, www.CimnetInc.com

2004 CIMNET Inc

236

access_level, last_edit_comment, mod_id, row_id. The following fields not included in the bom_item_oper_spec table are also permitted as optional filter parameters to increase the range of filter options : spec.grp_id as grp_id. The following additional columns are also included in the returned recordset: item.item_desc (item_id), process.process_desc (process_id), spec.grp_id (spec_id), spec.units, spec.spare1-4, spec.data_type GetAllbyXML() GetByKey() GetSpecificRS() Retrieval of the following specific recordsets are supported: GetSpecs(). Available filters are: item_id, ver_id, bom_pos, process_id, oper_id, spec_ver_id Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() As for GetAll()

GetSpecs Method
Purpose Returns a recordset of all specs along with the value and step number if the spec if used for an item at the operation. Syntax GetSpecs(item_id, ver_id, bom_pos, process_id, oper_id, spec_ver_id) Parameters Part item_id ver_id bom_pos Description Required. By Value. A Variant (string) to identify the item. Required. By Value. A Variant (string) to BOM version. Required. By Value. A Variant (long) to identify the items position in the BOM. Required. By Value. A Variant (string) to identify the process. Required. By Value. A Variant (string) to identify the operation. Required. By Value. A Variant (string) to identify the version of the specification.

process_id oper_id spec_ver_id

Returns
2004 CIMNET Inc

www.CimnetInc.com

237

ADODB.recordset. Columns are spec.grp_id, spec.spec_id, bom_item_oper_spec.spec_value, bom_item_oper_spec.step_no, and bom_item_oper_spec.mod_id, bom_item_oper_spec.access_level, spec.data_type Remarks This method performs an outer join to get a recordset of all specs in the specified version with the value and step number set if the spec is used for the item in the operation. Stored Procedure(s) Used sp_SA_BIOSpec_GetSpecs Access via Director.cls using GetSpecificRS() Yes. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>bom_item_oper_spec</object> <msgtype>GetSpec</msgtype> <cmd>GetSpecs</cmd> <item_id>item1</item _id> <ver_id>ver 1.5</ver _id> <bom_pos>1</bom_pos> <process_id>proc1</process _id> <oper_id>oper</oper _id> <spec_ver_id>spec Ver 1</spec_ver _id> </request>

Job_Spec Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: spec_value, act_spec_value, assoc_file, assoc_file_type, comments, min_value, max_value, access_level, last_edit_comment, mod_id, row_id The following columns are also included in the returned recordset : spec.grp_id, spec.units, spec.spare1-4, spec.data_type GetAllbyXML() GetByKey() GetSpecificRS() Retrieval of the following specific recordsets are supported: GetJobSpecs(). Available filters are: wo_id, oper_id, seq_no, step_no Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

238

IsValid()

GetJobSpecs Method
Purpose To return a recordset containing a list of all specs and an indication of which specs are used by the specified job. Syntax GetJobSpecs(wo_id, oper_id, seq_no, step_no) Parameters Part wo_id oper_id seq_no step_no Returns ADODB.recordset. The recordset columns include the following: spec.grp_id, spec.spec_id, job_spec.step_no, job_spec.access_level, job_spec.mod_id Remarks This method lists all the specifications from the spec table and indicates which specs are used by the specified job. Stored Procedure(s) Used sp_SA_Job_Spec_GetJSByFilter Access via Director.cls using GetSpecificRS() <?xml version="1.0"?> <request> <object>job_spec</object> <msgtype>getspec</msgtype> <cmd> GetJobSpecs</cmd> <wo_id>process1</wo_id> <oper_id>10</oper_id> <seq_no>0</seq_no> <step_no>1</step_no> </request> Description Required. By Value. A variant (string) to identify the wo_id Required. By Value. A variant (string) to identify the oper_id Required. By Value. A variant (long) to identify the seq_no Required. By Value. A variant (long) to identify the step_no

Storage_Exec Class
Summary of the methods supported by this class:
STANDARD METHODS
2004 CIMNET Inc

COMMENTS www.CimnetInc.com

239

GetAll()

The following columns are NOT available as filters: last_edit_comment If the following optional filter fields are included they have the this effect: max_capacity returns all rows where max_capacity >= parameter value The following columns are also included in the returned recordset : ent.ent_name, ent.ent_name as storage_ent_name (storage_ent_id)

GetAllbyXML() GetByKey() GetSpecificRS()

As above

Retrieval of the following specific recordsets are supported: GetShortages(). Available filters are ent_id GetInventory(). Available filters are ent_id, include_moveable_entities, last_edit_by, last_edit_at

Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS AddInv() ReduceInv() Transfer() TransferAndUpdateInv() Split()

Not supported. Use job_exec.AddCons() and AddConsPostExec() to add rows to this table.

COMMENTS

AddInv Method
Purpose To add a quantity of an item with given dependent data to a storage location. Syntax AddInv (session_id, user_id, ent_id, item_id, grade_cd, status_cd, add_qty, lot_no, add_qty_erp, date_in, expiry_date, wo_id, oper_id, seq_no, from_ent_id, goods_received, checkgradestatus, row_id) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string to identify the user.

user_id

2004 CIMNET Inc

www.CimnetInc.com

240

ent_id

Required. By Value. A long to identify the storage entity to which we are adding the quantity of inventory. Required. By Value. A string to identify the item_id Required. By Value. A long to identify the grade of the added item(s) Required. By Value. A long to identify the state of the added item(s) Required. By Value. A double specifying the quantity to be added. Optional. By Value. A string to identify the lot number Optional. By Value. A variant (double) specifying how much of the added quantity has already been reported to the ERP system. Defaults to 0. Optional. By Value. A variant (date) specifying when this quantity was received into this location. Defaults to Now. Optional. By Value. A variant (date) specifying when this quantity will expire. Defaults to Null (never). Optional. By Value. A variant (string) to identify a wo_id that produced this quantity. Defaults to Null. Optional. By Value. A variant (string) identify the oper_id that produced this quantity. Defaults to Null. Optional. By Value. A variant (long) to identify the seq_no that produced this quantity. Defaults to Null. Optional. By Value. A variant (long) to identify the entity from which these item(s) where transferred, if any. Optional. By Value. A variant (boolean) to specify whether these item(s) have been received from a supplier or not. Defaults to No. This value only affects the item_transfer log if it is specified. Optional. By Value. A variant (Boolean) to specify whether to make a check on Grade and Status Optional. By Reference. A variant (long) to return the row_id of the row that was just inserted or updated if this call was successful.

item_id grade_cd

status_cd

add_qty

lot_no add_qty_erp

date_in

expiry_date

wo_id

oper_id

seq_no

from_ent_id

goods_received

checkgradestatus

row_id

Returns Integer. 0 if successful, else -1


2004 CIMNET Inc

www.CimnetInc.com

241

Remarks The first four input parameters identify the row in the item_inventory table to which the specified quantity is to be added. If such a row already exists then this quantity will be added to the existing quantity in that row, AND any specified dependent fields that are included as optional parameters (eg. grade, status, wo etc) will overwrite the current values in the row. If it is important to maintain such values then your system should be designed so that the ent_id, item_id, lot_no field combinations are unique for each row where dependent data is to be maintained. If the ent_id field does not have the can_store capability then an error will be returned. Likewise if the status field of the storage entity is Inactive (??) Stored Procedure(s) Used sp_I_Item_Inv_Add Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>storage_exec</object> <cmd>AddInv</cmd> <ent_id>1</ent_id> <item_id>xyz</item_id> <grade_cd>1</grade_cd> <status_cd>4</status_cd> <add_qty>24</add_qty> <lot_no>lot123</lot_no> <add_qty_erp>0</add_qty_erp> <date_in></date_in> <expiry_date></expiry_date> <wo_id></wo_id> <oper_id></oper_id> <seq_no></seq_no> <from_ent_id></from_ent_id> <goods_received></goods_received> <checkgradestatus>1</checkgradestatus> </request>

ReduceInv Method
Purpose To reduce the quantity of an item from a given storage location. Syntax ReduceInv (session_id, user_id, ent_id, item_id, grade_cd, status_cd, reduce_qty, lot_no, reduce_qty_erp, date_out, goods_shipped) Parameters Part
2004 CIMNET Inc

Description
www.CimnetInc.com

242

session_id

Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string to identify the user. Required. By Value. A long to identify the storage entity from which we are reducing the quantity of inventory. Required. By Value. A string to identify the item_id Required. By Value. A long to identify the unique storage location Required. By Value. A long to identify the unique storage location Required. By Value. A double specifying the quantity to be removed. Optional. By Value. A string to identify the lot number Optional. By Value. A variant (double) specifying how much of the removed quantity has already been reported to the ERP system. Defaults to 0. Optional. By Value. A variant (date) specifying when this quantity was removed from this location. Defaults to Now. Optional. By Value. A variant (boolean) to specify whether these item(s) have been shipped to a customer or not. Defaults to No. This value only affects the item_transfer log if it is specified.

user_id ent_id

item_id grade_cd status_cd reduce_qty

lot_no reduce_qty_erp

date_out

goods_shipped

Returns Integer. 0 if successful, else -1 Remarks The first four input parameters identify the row in the item_inventory table from which the specified quantity is to be removed. If such a row already exists then this quantity will be reduced from the existing quantity in that row, if it doesnt exist then the action depends on the storage_exec setting (requires new database) of whether negative quantities are allowed or not. If negative quantities are allowed then a row is added with the qty_left value set = -(reduce_qty). Similarly, this setting determines what happens if the reduce_qty exceeds the qty_left in the row it either gets set = 0 or the calculated negative value. If the qty_left = 0 after the reduction then the date_out field is set to the date_out value passed as a parameter (defaults to Now). If the qty_left > 0 after the reduction then the date_out field is left unchanged, even if the optional date_out parameter is included. If the qty_left = 0 after the reduction then depending on the storage_exec.auto_del_zero_inv flag, the row will be deleted from the database. If the ent_id field does not have the can_store capability then an error will be returned. Likewise if the status field of the storage entity is Inactive (??) Stored Procedure(s) Used
2004 CIMNET Inc

www.CimnetInc.com

243

sp_U_Item_Inv_Reduce Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>storage_exec</object> <cmd>ReduceInv</cmd> <ent_id>1</ent_id> <item_id>xyz</item_id> <reduce_qty>24</reduce_qty> <lot_no>lot123</lot_no> <reduce_qty_erp>0</reduce_qty_erp> <date_out></date_out> <goods_shipped></goods_shipped> </request>

Transfer Method
Purpose To transfer a specified quantity of an item between 2 given storage locations. Syntax Transfer (session_id, user_id, from_ent_id, to_ent_id, item_id, lot_no, , transfer_qty, transfer_qty_erp) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string to identify the user. Required. By Value. A long to identify the storage entity FROM which we are transferring the quantity of inventory. Required. By Value. A long to identify the storage entity TO which we are transferring the quantity of inventory. Required. By Value. A string to identify the item_id Required. By Value. A string to identify the lot number Required. By Value. A double specifying the quantity to be transferred. Optional. By Value. A variant (double) specifying how much of the transferred quantity has already been reported to the ERP
www.CimnetInc.com

user_id from_ent_id

to_ent_id

item_id lot_no transfer_qty

transfer_qty_erp

2004 CIMNET Inc

244

system. Defaults to 0. Returns Integer. 0 if successful, else -1 Remarks The first five input parameters identify the row in the item_inventory table from which the specified quantity is to be transferred, and the destination location. If such a row already exists for the destination location then the transferred quantity will be added to the qty_left value for the destination row. In this case if any of the dependent data (grade, status, expiry_date, wo data) does not match between the source and destination rows then an error will be returned. If a row does not already exist for the destination combination then a new row will be inserted and its dependent fields will be set equal to the values from the source data rows. If both the from_ent_id and to_ent_id fields do not have the can_store capability then an error will be returned. Likewise if the status field of the to_ent_id is Inactive (??) Stored Procedure(s) Used sp_U_Item_Inv_Transfer Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>storage_exec</object> <cmd>Transfer</cmd> <from_ent_id>1</from_ent_id> <to_ent_id>2</to_ent_id> <item_id>xyz</item_id> <lot_no>lot123</lot_no> <transfer_qty>24</transfer_qty> <transfer_qty_erp>0</transfer_qty_erp> </request>

Split Method
Purpose To add a quantity of an item with given dependent data to a storage location. Syntax Split (session_id, user_id, old_row_id, , , split_qty, new_ent_id, new_item_id, new_lot_no, , new_grade_cd, new_status_cd, add_qty_erp) Parameters Part session_id Description Required. By Value. A long to identify the session from which the

2004 CIMNET Inc

www.CimnetInc.com

245

call is being made. user_id old_row_id split_qty new_ent_id Required. By Value. A string to identify the user. Required. By Value. A long to identify the storage location Required. By Value. A double specifying the quantity to be split. Optional. By Value. A variant (long) to identify the storage entity TO which we are splitting the quantity of inventory. Defaults to value in split source row. Optional. By Value. A variant (string) to specify the item_id of the new row. Defaults to value in split source row. Optional. By Value. A variant (string) to specify the lot number of the new row. Defaults to value in split source row.

new_item_id

new_lot_no

new_grade_cd

Optional. By Value. A variant (long) to specify the grade of the new row. Defaults to value in split source row. Optional. By Value. A variant (long) to specify the status of the new row. Defaults to value in split source row. Optional. By Value. A variant (double) specifying how much of the split quantity has already been reported to the ERP system. Defaults to 0.

new_status_cd

split_qty_erp

Returns Integer. 0 if successful, else -1 Remarks The first four input parameters identify the row in the item_inventory table from which the specified quantity is to be split. If the row does not exist an error is returned. The split_qty must be <= the qty_left in the source row otherwise an error is returned. At least one of the new_ent_id, new_item_id, new_lot_no fields must be specified as this is required to specify a new row in the item_inv table. If the destination row already exists then this quantity will be added to the existing quantity in that row. In this case if any of the dependent data (grade, status, expiry_date, wo data) does not match between the source and destination rows then an error will be returned. If the new_ent_id field does not have the can_store capability then an error will be returned. Likewise if the status field of the new_ent_id is Inactive (??) Stored Procedure(s) Used sp_U_Item_Inv_Split Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows:
2004 CIMNET Inc

www.CimnetInc.com

246

<?xml version="1.0"?> <request> <object>storage_exec</object> <cmd>Split</cmd> <old_ent_id>1</old_ent_id> <old_item_id>xyz</old_item_id> <old_lot_no>lot123</old_lot_no> <split_qty>12</split_qty> <new_ent_id></new_ent_id> <new_item_id></new_item_id> <new_lot_no>lot456</new_lot_no> <new_grade_cd></new_grade_cd> <new_status_cd></new_status_cd> <split_qty_erp></split_qty_erp> </request>

TransferAndUpdateInv
Purpose To transfer a specified quantity of an item between 2 given storage locations with the option of updating the Grade Code, Status Code and Expiry Date of the destination row should it conflict with these same dependent fields in the source row. This method also allows the item_id, lot_no values to be changed during the transfer. Syntax TransferAndUpdateInv (session_id, user_id, from_ent_id, item_id, transfer_qty, transfer_option, to_ent_id, to_item_id, lot_no, to_lot_no, from_grade_cd, to_grade_cd, from_status_cd, to_status_cd, transfer_qty_erp) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string to identify the user. Required. By Value. A long to identify the storage entity FROM which we are transferring the quantity of inventory. Required. By Value. A string to identify the item_id Required. By Value. A double specifying the quantity to be transferred. Required. By Value. A variant (int32) specifying options should the Grade Code, Status Code and Expiry date dependent fields of the source and possible destination row NOT match.

user_id from_ent_id

item_id transfer_qty

transfer_option

Transfer Option 1 :- Source rows Grade Code, Status Code


2004 CIMNET Inc

www.CimnetInc.com

247

and Expiry date must match with Destination rows Grade Code, Status Code and Expiry date. If not an error is returned.
Transfer Option 2:- Even if source rows Grade Code, Status Code and Expiry Date do not match a possible destination rows Grade Code, Status Code and Expiry Date, the original destination rows Grade Code, Status Code and Expiry Date will be retained and the source rows quantity will be added to it. Transfer Option 3:- Even if source rows Grade Code, Status Code and Expiry Date do not match a possible destination rows Grade Code, Status Code and Expiry Date, the source rows Grade Code, Status Code and Expiry Date will overwrite the existing values in the destination row and the source rows quantity will be added to it. to_ent_id Optional. By Value. A long to identify the storage entity TO which we are transferring the quantity of inventory. Optional. By Value. A string to identify the destination Item Optional. By Value. A string to identify the lot number Optional. By Value. A string to identify the destination lot no Optional. By Value. A long to identify the unique source location Optional. By Value. A long to identify the unique destination location Optional. By Value. A long to identify the unique source location Optional. By Value. A long to identify the unique destination location Optional. By Value. A variant (double) specifying how much of the transferred quantity has already been reported to the ERP system. Defaults to 0.

to_item_id lot_no to_lot_no from_grade_cd to_grade_cd

from_status_cd to_status_cd

transfer_qty_erp

Returns Integer. 0 if successful, else -1 Remarks The first five input parameters identify the row in the item_inventory table from which the specified quantity is to be transferred, and the destination location. If such a row already exists for the destination location then the transferred quantity will be added to the qty_left value for the destination row. In this case if any of the dependent data (grade, status, expiry_date, wo data) does not match between the source and destination rows then an error will be returned. If a row does not already exist for the destination combination then a new row will be inserted and its dependent fields will be set equal to the values from the source data rows.
2004 CIMNET Inc

www.CimnetInc.com

248

If both the from_ent_id and to_ent_id fields do not have the can_store capability then an error will be returned. If the Grade Code, Status Code and Expiry date in source inventory location and destination location does not match, the Grade Code, Status Code and Expiry Date may be updated based on the transfer option described above. Stored Procedure(s) Used sp_U_Item_Inv_TransAndUpdInv Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>storage_exec</object> <cmd>TransferAndUpdateInv</cmd> <msgtype>exec</msgtype> <validate>1</validate> <session_id>464</session_id> <user_id>XY</user_id> <from_ent_id>10</from_ent_id> <item_id>Aluminum-3-ST</item_id> <transfer_qty>7</transfer_qty> <transfer_option>2</transfer_option> <to_ent_id>20</to_ent_id> <to_item_id>Aluminum-3-ST</to_item_id> <lot_no>100</lot_no> <to_lot_no>200</to_lot_no> <from_grade_cd>3</from_grade_cd> <to_grade_cd>1</to_grade_cd> <from_status_cd>2<from_status_cd> <to_status_cd>5</to_status_cd> <transfer_qty_erp>0</transfer_qty_erp> </request>

GetShortages Method
Purpose To return a recordset containing a list of shortage items along with the shortage amount and its reorder quantity for each item. Syntax GetShortages(ent_id) Parameters Part Description

2004 CIMNET Inc

www.CimnetInc.com

249

ent_id Returns

Optional. By Value. A Variant (long) to identify the ent_id.

ADODB.recordset. Recordset columns are: item_id, item_desc, process_id, min_inv_level, shortage_amt and reorder_amt. Remarks This method is used to return a recordset that contains a list of items that have a quantity below the minimum stock level along with the shortage amount for each item and the reorder amount for each item. All items where the item.min_inv_level is not null and greater than zero, auto reorder is set to false (item.auto_reorder=0) and the shortage amount is greater than zero are included in the returned recordset. The shortage amount for an item is calculated as the greater of i) the difference between the overall minimum of that item (from item.min_inv_level) and the overall inventory of that item (total of item_inv.qty_left), or ii) the sum of the positive difference between the location specific minimum inventory levels (item_storage_exec_link.min_inv_level) and the inventory of that item stored at each such location. The shortage amount is further reduced by the current WIP for that item. The WIP is the total of (job.qty_at_start job.qty_prod) for any final job of any work order producing that item. The reorder amount for an item is calculated as the overall minimum reorder amount (item.min_reorder_amt) if the shortage amount is derived from term (i) above, or the largest reorder amount (item_storage_exec_link.reorder_amount) for an item with a shortage, if the shortage amount is derived from term (ii). If ent_id is supplied, then the items in the recordset are restricted to those manufactured by a process with a level permitting it to be instantiated (as per system attribute = 201). The recordset is further filtered if the item is not produced at the first operation for the supplied entity or any of its ancestor entities. Also, the recordset includes only the most preferred process for an item. If ent_id is not supplied, then NULL is returned in the process_id column. Stored Procedure(s) Used sp_SA_Storage_Exec_GetShrtages Access via Director.cls using GetSpecificRS() Yes. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>storage_exec</object> <msgtype>getspec</msgtype> <cmd>GetShortages</cmd> <ent_id></ent_id> </request>

GetInventory Method
Purpose To return a recordset containing a list of items from the inventory. Syntax GetInventory(ent_id, include_moveable_entities, last_edit_by, last_edit_at) Parameters

2004 CIMNET Inc

www.CimnetInc.com

250

Part ent_id

Description Required. By Value. A Variant (long) to identify the ent_id. Optional. By Value. A Variant (long) to identify whether to include all the storage entities or not. Defaults to 0. Optional. By Value. A Variant (string) to identify the user_id who has last changed this record. Defaults to Null. Optional. By Value. A Variant (datetime) to identify the date and time of the record which was last modified. Defaults to Null.

include_moveable_entities

last_edit_by

last_edit_at

Returns ADODB.recordset. Recordset columns are: All columns from item_inv table plus ent.ent_name, ent.description, item.item_desc, item_grade.item_grade_desc, item_grade.color as item_grade_color, item_state.item_status_desc, item_state_color as item_state_color, uom.description as uom_description, uom.abbreviation. Remarks If include_moveable_entities parameter is set to 0 (false), then the rows from the item_inv table for the matching supplied ent_id values are only returned. If include_moveable_entities parameter is set to 1 (true), a storage entity list is generated with the supplied ent_id and all its descendent entities. Ie, the storage_exec.storage_ent_id is recursed till each storage_exec record having no other storage_exec.ent_id records pointing to it as their storage_ent_id. The recursion is stopped when no further entities (ie storage_exec.storage_ent_id is null) are found or the storage_exec.storage_ent_id is pointing back to the previous entity in the storage entity list. The final inventory recordset includes only the entities that are generated by this storage entity list. If last_edit_by or last_edit_at parameters are supplied, then these filters are also applied to the returned recordset. Stored Procedure(s) Used sp_SA_Storage_Exec_GetInventry Access via Director.cls using GetSpecificRS() Yes. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>storage_exec</object> <msgtype>getspec</msgtype> <cmd>GetInventory</cmd> <ent_id>1212</ent_id> <include_moveable_entities></include_moveable_entities> <last_edit_by></last_edit_by> <last_edit_at></last_edit_at> </request>

2004 CIMNET Inc

www.CimnetInc.com

251

Item_Inv Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: qty_left, qty_left_erp, last_edit_comment If the following optional filter fields are included the filter test is as follows:: Date_in returns all rows where date_in >= parameter value Date_Out returns all rows where date_out >= parameter value Last_Edit_at returns all rows where last_edit_at >= parameter value Expiry_Date returns all rows where expiry_date >= parameter value The following columns are also included in the returned recordset: ent.ent_name, item.item_desc, item.uom_id as item_uom_id, item_grade.item_grade_desc, item_grade.color as grade_color, item_state.item_status_desc, item_state.color as state_color, item.num_decimals GetAllbyXML() The following columns are NOT available as filters: qty_prod, qty_prod_erp, last_edit_comment If the following optional filter fields are included the filter test is as follows:: Last_Edit_at returns all rows where last_edit_at >= parameter value GetByKey() This method also supports to fetch a single row using its effective primary key. Either row_id OR all of the following optional parameters must be supplied to fetch a single row: ent_id, item_id, lot_no No specific recordsets currently supported

GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

Item_Transfer Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS

The following fields are not permitted as optional filter parameters to increase performance: qty_txd, uom_id, from_qty_txd, from_uom_id, qty_txd_erp, grade_cd, status_cd, expiry_date, from_grade_cd, from_status_cd, from_expiry_date, comments, mod_id. If the transfer_time filter is included then all rows AT AND AFTER the specified filter datetime are included.

2004 CIMNET Inc

www.CimnetInc.com

252

The following columns are also included in the returned recordset: item.item_desc, ent.ent_name as from_ent_name (from_en_id), ent.ent_name as to_ent_name (to_ent_id)
GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported As for GetAll()

Item_Storage_Exec_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS

The following fields are NOT permitted as filter parameters: min_inv_level, min_reorder_amt, last_edit_comment, row_id The following columns are NOT allowed as optional filters are also included in the returned recordset: ent.ent_name

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

As for GetAll()

No specific recordsets currently supported

Transfer_List Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are NOT permitted as optional filter parameters: qty_to_pick, uom_id_pick, qty_to_store, uom_id_store, last_edit_comment www.CimnetInc.com

2004 CIMNET Inc

253

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

As for GetAll()

No specific recordsets currently supported

Data_Log_Grp Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: trigger_detail, last_edit_comment, mod_id. The following columns are also included in the returned recordset: ent.ent_name GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS Clone() SaveSample() GetEntGroups() COMMENTS To clone an existing Data Log Group To insert a new row into the data_log_16 or data_log_48 tables, using the current values stored in the data_log_value table as the sample values Get all data log groups configured for the specified entity and its parents No specific recordsets currently supported As for GetAll()

Clone Method
Purpose To clone an existing Data Log Group. Syntax Clone (session_id, cur_grp_id, new_grp_desc)
2004 CIMNET Inc

www.CimnetInc.com

254

Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made. Required. By Value. A long to identify the data log group to be cloned. Required. By Value. A string to specify the new groups description. This should uniquely distinguish the group.

cur_grp_id

new_grp_desc

Returns Long. >=0 if successful to represent the new rows database assigned identity value, else 1. Remarks All other dependent data will be cloned and can then be edited independently. Stored Procedure(s) Used sp_I_Data_Log_Grp_Clone Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>data_log_grp</object> <cmd>clone</cmd> <cur_grp_id>1</cur_grp_id > <new_grp_desc>Cloned Group</new_grp_desc> </request> A successful response would be as follows: <?xml version="1.0"?> <response> <result>0</result> <identity>2</identity> <mod_id>01 Jan 1900 00:14:20:010</mod_id> </response>

SaveSample Method
Purpose To insert a new row into the data_log_16 or data_log_48 tables, using the current values stored in the data_log_value table as the sample values. This facilitates using the Factory Connector to collect values from external servers and save them independently, and then trigger a new sample to be logged to the relevant data_log table. Syntax SaveSample (session_id, grp_id, ent_id, job_pos)
2004 CIMNET Inc

www.CimnetInc.com

255

Parameters Part session_id Description Required. By Value. A long to identify the client or Factory Connector session from which the request is being made. Required. By Value. A long to identify the data log group to be sampled. Optional. By Value. A long to identify the entity Optional. By Value. A long to identify the job position, if > 1 jobs are running on this entity

grp_id

ent_id job_pos

Returns Long. 0 if successful, else 1. Remarks All sample values to be logged must already be saved in the data_log_value table before calling this method. Stored Procedure(s) Used sp_I_Data_Log_Grp_SaveSample Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>data_log_grp</object> <msgtype>Exec</msgtype> <cmd>SaveSample</cmd> <session_id>111</session_id> <grp_id>1</grp_id> <ent_id>1211</ent_id> <job_pos>0</job_pos> </request>

GetEntGroups Method
Purpose Get all data log groups configured for the specified entity and its parents. Syntax GetEntGroups(ent_id) Parameters Part Description

2004 CIMNET Inc

www.CimnetInc.com

256

ent_id Returns

Required. By Value. A Variant (long) to identify the entity

ADODB.recordset: Columns are grp_id and grp_desc Remarks This method is used to get all the data log groups configured for a specific entity and its parent entities. From the given entity, it walks up thru all the parent entities and picks up the configured data log groups (grp_id and grp_desc). If none were configured for the specific entity and its parents, then it results in listing all data log groups Stored Procedure(s) Used sp_SA_Data_Log_Grp_GetEntGrps Access via Director.cls using GetSpecificRS() Yes. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>data_log_grp</object> <msgtype>GetSpec</msgtype> <cmd>GetEntGroups</cmd> <ent_id>1211</ent_id> </request>

CheckDataLogGrpValExists Method
Purpose To return true or false depending on whether any data is collected for a specific data log value in a data log group. Syntax CheckDataLogGrpValExists(grp_id, value_index, value_exists) Parameters Part grp_id Description Required. By Value. A Variant (long) to identify the data log group id. Required. By Value. A Variant (long) to identify the value_index. Required. By Ref. A Variant (long) returning 1 (true) or 0 (false).

value_index value_exists Returns Long. 0 if successful, else 1. Remarks

This method returns 1 (true) if any data is collected for a data log group at the specified value_index, or 0 (false) is returned if no data has been collected for the value index. This method first extracts the max_value from the data_log_grp table to determine which data_log_n table should be used to search
2004 CIMNET Inc

www.CimnetInc.com

257

for the data collection. After the data_log_n table is determined, this method checks for any non-null data exists in the data_log_n table for the specified grp_id and the value_index column. If such a value exists, then this method returns 1 (true) or else 0 (false) is returned. Stored Procedure(s) Used sp_SA_Data_Log_Grp_IsValExists Access via Director.cls using ExecuteXMLCmd() Yes. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>data_log_grp</object> <msgtype>exec</msgtype> <cmd>CheckDataLogGrpValExists</cmd> <grp_id>43</grp_id> <value_index>2</value_index> </request>

Data_Log_Value Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Not supported as there are no dependent fields Not supported as there are no dependent fields Stub only. No specific recordsets currently supported COMMENTS The following fields are not permitted as optional filter parameters: last_edit_comment, row_id As for GetAll()

Data_Log_16 and Data_Log_48 Classes


Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS

The following fields are not permitted as optional filter parameters to increase performance: All value fields, last_edit_comment, row_id
If the sample_time filter is included all rows AT AND AFTER the specified filter datetime are included The following additional columns are also included in the returned recordset: data_log_grp.grp_desc, wo.wo_desc, job.job_desc, job_step.step_desc,

2004 CIMNET Inc

www.CimnetInc.com

258

item.item_desc, shift.shift_desc GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported Data_Log_48 class does not support Value46 48 fields Data_Log_48 class does not support Value46 48 fields Data_Log_48 class does not support Value46 48 fields As for GetAll()

Res Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() mod_id is optional Stub only. No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: qty_avail, num_decimals, last_edit_comment, mod_id. The following columns are NOT available as filters: qty_avail, num_decimals, last_edit_comment, mod_id.

Res_Exc Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: qty_unavail, comments, last_edit_comment, mod_id, row_id If the following optional filter fields are included the filter test is as follows:: Start_time returns all rows where start_time >= parameter value End_time returns all rows where end_time <= parameter value GetAllbyXML() The following columns are NOT available as filters: qty_unavail, comments,

2004 CIMNET Inc

www.CimnetInc.com

259

mod_id. If the following optional filter fields are included the filter test is as follows:: Start_time returns all rows where start_time >= parameter value End_time returns all rows where end_time <= parameter value GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() mod_id is optional Stub only. No specific recordsets currently supported

Res_Oper_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: qty_reqd, last_edit_comment, mod_id, row_id. The following columns are also included in the returned recordset : res.res_desc, res.qty_avail, res.num_decimals GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported As for GetAll()

Res_Job_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: qty_reqd, last_edit_comment, mod_id, row_id. The following columns are also included in the returned recordset : res.res_desc,

2004 CIMNET Inc

www.CimnetInc.com

260

res.qty_avail, res.num_decimals GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() mod_id is optional Stub only. No specific recordsets currently supported As for GetAll()

DNC DLL Enhanced Methods


Folder Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: oper_desc, notes, last_edit_comment, mod_id. row_id The following columns are also included in the returned recordset: ent.ent_name, item.item_desc, GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS SetPreferredVer() Clone() To clone an existing Folder to a new folder in the database COMMENTS No specific recordsets currently supported As for GetAll()

SetPreferredVer Method
Purpose
2004 CIMNET Inc

www.CimnetInc.com

261

To set the preferred version flag for a given folder version, AND reset it for all other folders for the same item_id, oper_id and ent_id. Syntax SetPreferredVer (session_id, item_id, oper_id, ent_id, ver_id, mod_id) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made. Required. By Value. A string to identify the item_id Required. By Value. A string to identify the oper_id Required. By Value. A long to identify the entity. Required. By Value. A string to identify the ver_id Required. By Reference. A variant (string) to identify the last retrieved timestamp to allow for optimistic concurrency. Returns the new value after the update.

item_id oper_id ent_id ver_id mod_id

Returns Integer. 0 if successful, else -1 Remarks The first four input parameters identify a unique folder which will become the preferred version. All other folder versions for the same item_id, oper_id and ent_id will now become NOT preferred. Stored Procedure(s) Used sp_U_Folder_Set_Pref_Ver Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>folder</object> <cmd>SetPreferredVer</cmd> <item_id>xyz</item_id> <oper_id>20</oper_id> <ent_id>1</ent_id> <ver_id>1</ver_id> <mod_id>01 Jan 1900 00:00:02:717</mod_id> </request>

Clone Method
Purpose
2004 CIMNET Inc

www.CimnetInc.com

262

To clone an existing Folder to a new folder in the database Syntax Clone (session_id, existing_item_id, existing_oper_id, existing_ent_id, existing_ver_id, new_item_id, new_oper_id, new_ent_id, new_ver_id, new_oper_desc, new_notes, new_udf1, new_udf2, new_preferred_ver, new_design_hold, mod_id) Parameters Part session_id existing_item_id existing_oper_id existing_ent_id existing_ver_id new_item_id new_oper_id new_ent_id new_ver_id new_oper_desc new_notes new_udf1 new_udf2 new_preferred_ver new_design_hold mod_id Returns Long. 0 if successful, else 1.
2004 CIMNET Inc

Description Required. By Value. A variant (long) to identify the client session from which the request is being made. Required. By Value. A variant (string) to identify the item_id of the folder to be cloned Required. By Value. A variant (string) to identify the oper_id of the folder to be cloned Required. By Value. A variant (long) to identify the ent_id of the folder to be cloned Required. By Value. A variant (string) to identify the ver_id of the folder to be cloned Required. By Value. A variant (string) to identify the item_id for the new folder. Required. By Value. A variant (string) to identify the oper_id for the new folder Required. By Value. A variant (long) to identify the ent_id for the new folder Required. By Value. A variant (string) to identify the ver_id for the new folder Optional. By Value. A variant (string) to identify the oper_desc for the new folder Optional. By Value. A variant (string) to identify the notes for the new folder Optional. By Value. A variant (string) to identify the udf1 for the new folder Optional. By Value. A variant (string) to identify the udf2 for the new folder Optional. By Value. A variant (boolean) to identify the preferred_ver for the new folder Optional. By Value. A variant (boolean) to identify the design_hold for the new folder Optional. By Ref. A variant (string) returns the mod_id of the newly cloned folder data

www.CimnetInc.com

263

Remarks It also clones if any data exists in folder_file table. The folder clone method creates a new folder using the supplied information and then clones the files in the specified existing folder into the new folder. If preferred_ver is set to 1, then it checks for all the versions of new_item_id, new_oper_id and new_ent_id which has preferred_ver set. If any record has a preferred_ver set, then it sets it back to 0, and the newly cloned version will have the preferred version set to 1. If the optional preferred_ver is not passed in, then it pulls the value for preferred_ver from source row. If the source preferred_ver is true (=1), then it does as above described. If the newly created folder is the only folder revision for the item, operation, and entity, preferred_ver is set to 1 regardless of the passed in setting.

Stored Procedure(s) Used sp_I_Folder_Clone Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>folder</object> <msgtype>exec</msgtype> <cmd>clone</cmd> <session_id>111</session_id> <existing_item_id>bevcolacan </existing_item_id> <existing_oper_id>Op 10</existing_oper_id> <existing_ent_id>12</existing_ent_id> <existing_ver_id>1</existing_ver_id> <new_item_id>NewItemID</new_item_id> <new_oper_id>Op 20</new_oper_id> <new_ent_id>12</new_ent_id> <new_ver_id>NewVerID</new_ver_id> </request>

Folder_File Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS

The following fields are not permitted as optional filter parameters to increase performance: file_desc, file_size, last_edit_comment, mod_id, row_id
If the last_modified filter is included then all rows AT AND AFTER the specified filter datetime are included. The following columns are also included in the returned recordset: ent.ent_name, item.item_desc, user_name.user_desc, doc_type.download

2004 CIMNET Inc

www.CimnetInc.com

264

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

As for GetAll()

No specific recordsets currently supported

Folder_Item_Oper_Ent_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported COMMENTS The following fields are not permitted as optional filter parameters: last_edit_comment, row_id As for GetAll()

Folder_Distr Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters: last_edit_comment, row_id The following columns are also included in the returned recordset: item.item_desc, ent.ent_name GetAllbyXML() GetByKey() GetSpecificRS() Add() No specific recordsets currently supported As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

265

Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

Not supported as there are no dependent fields Not supported as there are no dependent fields

WO_File Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS

The following fields are not permitted as optional filter parameters to increase performance: file_desc, file_size, last_edit_comment, mod_id, row_id
If the last_modified filter is included then all rows AT AND AFTER the specified filter datetime are included. The following columns are also included in the returned recordset : user_name.user_desc

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

As for GetAll()

No specific recordsets currently supported

Item_File Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT permitted as filter parameters: last_edit_comment, row_id The following columns are also included in the returned recordset: item.item_desc, user_name.user_desc GetAllbyXML() GetByKey() GetSpecificRS() Add() No specific recordsets currently supported As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

266

Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

DNC_Exec Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT permitted as filter parameters: config, last_edit_comment The following columns are also included in the returned recordset: ent.ent_name, hub.hub_name, hub.hub_type GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS GetProtocols() COMMENTS No specific recordsets currently supported As for GetAll()

GetProtocols Method
Purpose To return the set of DNC hardware and software protocols supported. Software protocols are only included in the recordset if they are licensed. Syntax GetProtocols () Returns ADODB.recordset containing the following columns: protocol_name, file_no. Remarks The returned recordset contains all hardware protocols and only licensed software protocols. Stored Procedure(s) Used
2004 CIMNET Inc

www.CimnetInc.com

267

sp_SA_DNC_Protocol Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>dnc_exec</object> <msgtype>GetSpec</msgtype> <cmd>GetProtocols</cmd> </request>

Hub Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported COMMENTS All fields except last_edit_comment are supported as optional filter parameters As for GetAll()

Hub_Dev Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() No specific recordsets currently supported COMMENTS All fields except last_edit_at are permitted as optional filter parameters. As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

268

ExecuteXMLCmd() IsValid()

Defcon Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported COMMENTS The following fields are not permitted as optional filter parameters to increase performance: config. As for GetAll()

DNC_Log Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS All fields are supported as optional filter parameters If the the when_start filter is included all rows AT AND AFTER the specified datetime are included. If the the when_end filter is included all rows AT AND BEFORE the specified datetime are included. GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS EndLogEntry() COMMENTS No specific recordsets currently supported As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

269

EndLogEntry Method
Purpose End the DNC Log Entry. Syntax EndLogEntry (session_id, log_id, bytes) Parameters Part session_id Description Required. By Value. A Variant (long) to identify the session from which the call was made. Required. By Value. A Variant (long) to identify the dnc log_id Optional. By Value. A Variant (long) to identify the bytes

log_id bytes Returns Integer. 0 if successful, else -1 Remarks

Ends the DNC Log entry by setting the when_fin field to the current date and time value and sets success field to 1 for the corresponding log_id value passed in. If the optional bytes is passed in, then the dnc_log.bytes value will be updated with the passed in bytes value. Stored Procedure(s) Used sp_U_Dnc_Log_EndLogEntry Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>dnc_log</object> <cmd>EndLogEntry</cmd> <session_id>12111</session_id> <log_id>20</log_id> <bytes>100</bytes> </request>

UTIL DLL Enhanced Methods


Util_Exec Class
Summary of the methods supported by this class:
STANDARD METHODS
2004 CIMNET Inc

COMMENTS www.CimnetInc.com

270

GetAll()

The following columns are NOT available as filters: cur_reas_start, cur_raw_reas_cd, cur_log_id, target_util, current_util, jobstart_reas_cd, jobend_reas_cd, unkn_stop_reas_cd, shift_start_reas_cd, shift_end_reas_cd, last_edit_comment The following columns are also included in the returned recordset : ent.ent_name (ent_id), util_state.state_desc, util_state.color, util_reas.reas_desc, util_reas.reas_desc as jobstart_reas_desc (jobstart_reas_cd), util_reas.reas_desc as jobend_reas_desc (jobend_reas_cd), util_reas.reas_desc as shift_start_reas_desc (shift_start_reas_cd), util_reas.reas_desc as shift_end_reas_desc (shift_end_reas_cd), util_reas.reas_desc as unkn_stop_reas_desc (unkn_stop_reas_cd) , util_log.duration as cur_reas_duration (in hh:mm:ss format)

GetAllbyXML() GetByKey() GetSpecificRS()

As for GetAll()

Retrieval of the following specific recordsets are supported: GetAvailableReasons(). Parameters are: ent_id, raw_reas_cd.

Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS SetReason() SetRawReason() SetPendingReason() GetAvailableReasons() GetOldAvailableReasons() GetStatusInfoByUser() UpdateDurations() NewEvent() COMMENTS Manually change the reason code on an entity which may also change the state. Change the raw reason code on an entity from Factory Connector. Override the raw reason code on an entity by the user. Return the available final reasons for an entity, optionally filtered by the raw reason. Returns the possible set of final reasons for the OLD non_final reasons of the given entity Return the available utilization data for an entity. Update the durations of current rows in util_log. Not Supported

SetReason Method
Purpose To set the current reason code for a given entity. The reason code will also determine the utilization state of the entity and whether it is in uptime or downtime etc. Syntax SetReason (session_id, user_id, ent_id, new_reas_cd, new_reas_start, reas_pending, comments) Parameters
2004 CIMNET Inc

www.CimnetInc.com

271

Part session_id

Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string to identify the user. Required. By Value. A long to identify the entity. Required. By Value. A long to identify the new utilization reason on this entity. Optional. By Value. A variant (datetime) to specify the timestamp from which the new reason applies. Defaults to Now. Optional. By Value. A variant (boolean) to specify whether the new reason should be flagged as pending which allows easy identification should a final reason be entered subsequently. Defaults to No. Optional. By Value. A variant (string) to include a comment that provides more information for the new reason. Defaults to .

user_id ent_id new_reas_cd

new_reas_start

reas_pending

comments

Returns Integer. 0 if successful, else -1 Remarks The ent_id must be configured with the can_capture_util flag set to TRUE otherwise an error is returned. If the reas_cd has changed for the entity then the new reason is logged to the util_log table and the duration of the current event is updated. It also updates the util_exec table with the current state and reason for this entity. The util_log table also requires current state data for the entity such as the current shift and job running on it (if any). These values are obtained from the ent and job_exec tables. If the new_reas_start parameter is specified it must be after the previous event started, otherwise it will default to Now. (??) The new reas_cd will be used to determine the state of the entity which is in turn used to set the rt_flag and dt_flag values of the entry. The reas_pending flag is useful when the entered reas_cd is not final and requires operator confirmation or override (eg when the reas_cd is received directly from the I/O system). Stored Procedure(s) Used sp_U_Util_Exec_NewReason Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>util_exec</object>
2004 CIMNET Inc

www.CimnetInc.com

272

<cmd>SetReason</cmd> <ent_id>1</ent_id> <new_reas_cd>23</new_reas_cd> <new_reas_start></new_reas_start> <reas_pending>0</reas_pending> <comments></comments> </request>

SetRawReason Method
Purpose To set the current reason code for a given entity based on a Raw reas_cd received directly from the I/O system. This raw reas_cd will specify a default Final reas_cd and if so configured prompt the user with a list of possible Final reasons for the given Raw reason. Syntax SetRawReason (session_id, ent_id, raw_reas_cd, new_reas_start, comments) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A long to identify the entity. Required. By Value. A long to specify the new Raw reason. Optional. By Value. A variant (datetime) to specify the timestamp from which the new raw reason applies. Defaults to Now. Optional. By Value. A variant (string) to include a comment that provides more information for the new reason. Defaults to .

ent_id raw_reas_cd new_reas_start

comments

Returns Integer. 0 if successful, else -1 Remarks The ent_id must be configured with the can_capture_util flag set to TRUE otherwise an error is returned. Reads from the util_raw_reas table to get the default final reason for this raw reason and whether to prompt the user for a final reason or not. The method then calls the SetReason() method to apply this default final reas_cd. If the user must be prompted for finality then the reas_pending flag is set TRUE and the util_exec.reas_reqd flag is set to TRUE to allow the UI programs to prompt the user for the final reason. Stored Procedure(s) Used sp_U_Util_Exec_SetRawReason Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be
2004 CIMNET Inc

www.CimnetInc.com

273

formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>util_exec</object> <cmd>SetRawReason</cmd> <session_id>1234</session_id> <ent_id>1</ent_id> <raw_reas_cd>23</raw_reas_cd> <new_reas_start></new_reas_start> <comments></comments> </request>

SetPendingReason Method
Purpose To set the final reason code to replace certain pending reason for a given entity. Syntax SetPendingReason (session_id, user_id, ent_id, final_reas_cd, log_id, period_affected, old_reas_cd, comments) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string to identify the user. Required. By Value. A long to identify the entity. Required. By Value. A long to identify the Final reason code to replace the pending reasons on this entity. Optional. By Value. A variant (long) to identify the util_log row to override the non-final reason with the final reason Optional. By Value. A variant (long) to specify the number of minutes to go back in time in the util_log searching for pending reasons to replace. Defaults to 480 (ie 8 hours). Optional. By Value. A variant (long) to cause the search for pending reasons to be filtered for a specific non-final reason. Defaults to no filter (ie. All pending reasons). Optional. By Value. A variant (string) to include a comment that provides more information for the new final reason. Defaults to .

user_id ent_id final_reas_cd

log_id

period_affected

old_reas_cd

comments

Returns
2004 CIMNET Inc

www.CimnetInc.com

274

Integer. 0 if successful, else -1 Remarks The ent_id must be configured with the can_capture_util flag set to TRUE otherwise an error is returned. The log_id, period_affected and old_reas_cd optional parameters can be used to filter the search for pending reasons to replace. If the old_reas_cd filter is specified only matching reas_cd values with reas_pending = TRUE are updated. If all the filters are specified then all are applied (ie. they are ANDed) If log_id or period_affected are not supplied, then the latest non-final reson is overridden with the final reason. If either one of the value is supplied, then the rows matching with the criteria are overridden with the final reason. As in the SetReason() method the new reason is used to determine the state and runtime, downtime flag values and these fields are also updated in the affected rows. The reas_pending flag is now also set to FALSE for all updated rows. The duration and start times of each event are not affected. Also resets the reas_reqd flag in the util_exec table ONLY if final reason is overridden with the latest non-final reason Stored Procedure(s) Used sp_U_Util_Exec_SetPendingReas Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>util_exec</object> <cmd>SetPendingReason</cmd> <ent_id>1</ent_id> <final_reas_cd>23</final_reas_cd> <log_id></log_id> <period_affected></period_affected> <old_reas_cd></old_reas_cd> <comments></comments> </request>

GetAvailableReasons Method
Purpose To retrieve the set of possible final reason codes for a given entity. If the optional raw_reas_cd parameter is included then the final list is filtered to include only those final reasons that may override the given raw reason. Syntax GetAvailableReasons (ent_id, raw_reas_cd) Parameters Part Description 275

2004 CIMNET Inc

www.CimnetInc.com

ent_id raw_reas_cd

Required. By Value. A long to identify the entity. Optional. By Value. A variant (long) to filter the available list for the given raw reason code. Defaults to 1 (ie. any manually enterable reasons).

Returns ADODB.recordset containing columns for the following: reas_grp_id, reas_grp_desc, reas-cd, reasdesc, state_cd, state_desc, rt_flag, dt_flag and def_lab_cd. Remarks The ent_id must be configured with the can_capture_util flag set to TRUE otherwise an error is returned. The list will include all reasons applied to ancestors of the specified entity. Stored Procedure(s) Used sp_SA_Util_Exec_GetAvailReasns Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>util_exec</object> <cmd>GetAvailableReasons</cmd> <ent_id>1</ent_id> <raw_reas_cd>-1</raw_reas_cd> </request>

GetOldAvailableReasons Method
Purpose To retrieve a set of possible final reason codes for a given entity. The final reasons list is selected for the old non final reason which requires a possible final reason to be set which may override the current reason for the selected activity. Syntax GetOldAvailableReasons (ent_id, reas_cd) Parameters Part ent_id reas_cd Description Required. By Value. A Variant (long) to identify the entity. Required. By Value. A variant (long) to identify the current nonfinal reason

Returns ADODB.recordset containing columns for the following: reas_grp_id, reas_grp_desc, reas-cd, reas-desc
2004 CIMNET Inc

www.CimnetInc.com

276

Remarks The non-final reason may be old and it may still require a possible final reason. The list contains a set of possible final reasons for the old non-final reason. If the non-final reason is associated with multiple raw reasons, then all the raw_reasons are retrieved from the current non-final reason; and a set of final possible reasons are generated from this raw reason. Stored Procedure(s) Used sp_SA_Util_Exec_GetOldAvalReas Access via Director.cls using GetSpecificRS() Yes. <?xml version="1.0"?> <request> <object>util_exec</object> <cmd>GetOldAvailableReasons</cmd> <msgtype>getspec</msgtype> <ent_id>1</ent_id> <reas_cd>1101</reas_cd> </request>

UpdateDurations Method
Purpose To update the durations of current events for one or all entities that can capture utilization. Syntax UpdateDurations (session_id, ent_id) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made. Optional. By Value. A long to identify the entity. Defaults to null which will update all entities that can capture utilization.

ent_id

Returns Integer. 0 if successful, else -1 Remarks The ent_id must be configured with the can_capture_util flag set to TRUE otherwise an error is returned. The method first reads the last update time for each entity from the util_exec table (new DB required) and uses this to calculate the new duration for the current event which it then writes back to the util_log table. The util_exec table is then updated with the latest update time. If no row exists in the util_exec table for a given ent_id (Configurator should populate this ?) then we could automatically insert this row provided that the can_capture_util flag is set for the entity.
2004 CIMNET Inc

www.CimnetInc.com

277

Stored Procedure(s) Used sp_U_Util_Log_UpdateDurations Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>util_exec</object> <cmd>UpdateDurations</cmd> <ent_id></ent_id> </request>

IsRunning(ent_id) if flag to prevent job start ?

GetStatusInfoByUser Method
Purpose To return all current Utilization status information for all entities that a given user is currently logged into from a given session. Syntax GetStatusInfoByUser (session_id, user_id) Parameters Part session_id user_id Returns ADODB.recordset. Remarks The returned recordset includes entity specific data related to the entity itself and current Utilization status data and KPIs such as OEE etc, and many more which could be added for a specific application at runtime by enhancing the Stored Procedure. The entities which a current user is logged into is determined by the ent_logon table which is updated whenever an Operator user adds or removes an entity from his control within a session. Stored Procedure(s) Used sp_SA_Util_Exec_GetStatusInfoByUser Access via Director.cls using GetSpecificRS() Yes. The XML input parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>util_exec</object>
2004 CIMNET Inc

Description Required. By Value. A long to identify the users session Required. By Value. A string to identify the user

www.CimnetInc.com

278

<cmd>GetStatusInfoByUser</cmd> <session_id>123</session_id> <user_id>111</user_id> </request>

Util_State Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported COMMENTS All fields except last_edit_comment are permitted as optional filter parameters As for GetAll()

Util_Reas_Grp Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: display_seq, last_edit_comment As for GetAll()

Util_Reas Class
2004 CIMNET Inc

www.CimnetInc.com

279

Summary of the methods supported by this class:


STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: display_seq, last_edit_comment The following columns are also included in the returned recordset : util_reas_grp.reas_grp_desc, util_state.state_desc, labor_cat.lab_desc, GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported As for GetAll()

Util_Reas_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset : ent.ent_name, util_reas.reas_desc GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Not Supported as there are no dependent fields Not Supported as there are no dependent fields No specific recordsets currently supported As for GetAll()

Util_Raw_Reas Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id

2004 CIMNET Inc

www.CimnetInc.com

280

The following columns are also included in the returned recordset : ent.ent_name, util_raw_reas.def_reas_cd, util_reas.reas_desc as def_reas_desc (def_reas_cd) GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported As for GetAll()

Util_Log Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: duration, comments, last_edit_comment If the following optional filter fields are included the filter test is as follows:: Event_time returns all rows where event_time >= parameter value. The following columns are also included in the returned recordset : ent.ent_name, item.item_desc, shift.shift_desc, util_state.state_desc, util_state.color, util_reas.reas_desc, duration (in hh:mm:ss format) GetAllbyXML() The following columns are NOT available as filters: duration, comments, last_edit_comment. If the following optional filter fields are included the filter test is as follows: Event_time returns all rows where event_time >= parameter value GetByKey() GetSpecificRS() Retrieval of the following specific recordsets are supported: GetAllByPeriod(). Parameters are: ent_id, start_time, end_time. Add() Update() UpdateSpecific() Delete() DeleteAll() The following optional parameters are included to filter which rows are included in the Delete: event_time, ent_id. If the the event_time filter is included then all rows AT AND AFTER the specified datetime are deleted. The ent_id optional parameter allows only rows for the specified entity to be deleted if required. Not supported. Use the SetReason() and SetRawReason() methods of the util_exec class to add rows to this table.

2004 CIMNET Inc

www.CimnetInc.com

281

ExecuteXMLCmd() IsValid() SPECIFIC METHODS AdjustDuration() Split() GetAllByPeriod() COMMENTS

GetAllByPeriod Method
Purpose To retrieve a recordset from the Utilization log by specifying an entity and a time period as a filter. Syntax GetAllByPeriod (ent_id, start_time, end_time) Parameters Part ent_id start_time Description Required. By Value. A long to identify the entity. Optional. By Value. A variant (Datetime) to specify the start date and time of the period. Defaults to 24 hours ago. Optional. By Value. A variant (Datetime) to specify the end date and time of the period. Defaults to Now.

end_time

Returns ADODB,recordset containing the same columns as the GetAll() method, but filtered as specified. Remarks This method is very similar to the GetAll() method, except that this filter does the >= and < comparisons which cannot be achieved by the GetAll() filtering. If the last event returned overflows the specified end time then its duration will be reduced to match the specified end time. Stored Procedure(s) Used sp_SA_Util_Log_ByPeriod Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>util_log</object> <cmd>GetAllByPeriod</cmd> <ent_id>1</ent_id> <start_time>9/9/2001 7:00AM</start_time>
2004 CIMNET Inc

www.CimnetInc.com

282

<end_time>9/16/2001 11:00PM</end_time> </request>

Split Method
Purpose To split a given row in the Utilization log to allow editing of the Utilization history after the fact. Syntax Split (session_id, user_id, ent_id, event_time, new_duration, wo_id, oper_id, seq_no, step_no, item_id, shift_id, shift_start, reas_cd, reas_pending, comments) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string to identify the user. Required. By Value. A long to identify the entity. Required. By Value. A datetime to specify which event is to be split. This must exactly match with an existing row in the util_log table. Required. By Value. A long to specify the new duration of the current event in seconds. Must be less than the current duration. Optional. By Value. A variant (string) to specify the wo_id for the new split row. Defaults to value in original row. Optional. By Value. A variant (string) to specify the oper_id for the new split row. Defaults to value in original row. Optional. By Value. A variant (long) to specify the seq_no for the new split row. Defaults to value in original row. Optional. By Value. A variant (long) to specify the step_no for the new split row. Defaults to value in original row. Optional. By Value. A variant (string) to specify the item_id for the new split row. Defaults to value in original row. Optional. By Value. A variant (long) to specify the shift_id for the new split row. Defaults to value in original row. Optional. By Value. A variant (datetime) to specify the shift_start time for the new split row. Defaults to value in original row.

user_id ent_id event_time

new_duration

wo_id

oper_id

seq_no

step_no

item_id

shift_id

shift_start

2004 CIMNET Inc

www.CimnetInc.com

283

reas_cd

Optional. By Value. A variant (long) to specify the reas_cd for the new split row. Defaults to value in original row. Optional. By Value. A variant (boolean) to specify the reas_pending flag for the new split row. Defaults to value in original row. Optional. By Value. A variant (string) to specify the comments value for the new split row. Defaults to value in original row.

reas_pending

comments

Returns Integer. 0 if successful, else -1 Remarks The duration of the original row will be reduced to new_duration value specified. The duration of the new split row will be set to the difference between the original duration and the new_duration values. The event_time of the new split row will be set to the original event_time + the new_duration value. This will split the original row into 2 rows and maintain the integrity of the start times and durations of each event. If the new_duration is not less than the current duration then an error will be returned. Similarly if the original row cannot be identified from the ent_id and event_time specified. If the reas_cd of the split row is different then the method will read the appropriate state_cd value from the database and write it to the new split row. The method will then read the appropriate rt_flag and dt_flag values for this state_cd from the database and write them to the new split row. If the reas_cd value is unchanged the original values for state_cd, rt_flag and dt_flag will simply be copied to the split row. At least one of the optional parameters should have changed, otherwise there would be no point in doing the split. The Split() method can be applied many times if required. However, remember to refresh from the database after each split as the source data for subsequent splits will have changed. See Also: AdjustDuration() method which allows the duration of a single event to be modified and which then adjusts the duration and start time of the next event accordingly. Stored Procedure(s) Used sp_U_Util_Log_Split Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>util_log</object> <msgtype>exec</msgtype> <cmd>Split</cmd> <session_id>1234</session_id> <ent_id>1</ent_id> <event_time>9/9/2001 7:00AM</event_time> <new_duration>245</new_duration> <wo_id></wo_id>
2004 CIMNET Inc

www.CimnetInc.com

284

<oper_id></oper_id> <seq_no></seq_no> <step_no></step_no> <item_id></item_id> <shift_id></shift_id> <shift_start></shift_start> <reas_cd>244</reas_cd> <reas_pending></reas_pending> <comments></comments> </request>

AdjustDuration Method
Purpose To adjust the duration of a given row in the Utilization log and cascade this to the subsequent row(s) to ensure integrity of the event_time and duration values over a period of time. Syntax AdjustDuration (session_id, ent_id, event_time, new_duration) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call was made. Required. By Value. A long to identify the entity. Required. By Value. A datetime to specify which event is to be split. This must exactlt match an existing row in the util_log table. Required. By Value. A long to specify the new duration of the current event in seconds. May be less than or greater than the current duration.

ent_id event_time

new_duration

Returns Integer. 0 if successful, else -1 Remarks If the original row cannot be identified from the ent_id and event_time specified then an error will be returned. If the new_duration is less than the existing duration then the event_time of the single next event will be brought forward and its duration increased accordingly. If the new_duration is greater than the existing duration then the event_time of the next event will be set back and its duration reduced accordingly. If the new_duration for the row being edited is large enough to completely replace the subsequent row(s) then they will be deleted to maintain the integrity of the duration and event_start values over a period of time. See Also: Split() method which allows a single row to be split into 2 rows.
2004 CIMNET Inc

www.CimnetInc.com

285

Stored Procedure(s) Used sp_U_Util_Log_AdjustDuration Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>util_log</object> <cmd>AdjustDuration</cmd> <msgtype>exec</msgtype> <ent_id>1</ent_id> <event_time>9/9/2001 7:00AM</event_time> <new_duration>355</new_duration> </request>

2004 CIMNET Inc

www.CimnetInc.com

286

LABOR DLL Enhanced Methods


Labor_Exec Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: cur_raw_reas_cd, def_raw_reas_cd, lab_cd_reqd, last_edit_comment The following columns are also included in the returned recordset : ent.ent_name, labor_cat.lab_desc, labor_dept.dept_desc, GetAllbyXML() GetByKey() GetSpecificRS() Retrieval of the following specific recordsets are supported: GetAllByPeriod(). Parameters are: ent_id, start_time, end_time. Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS GetAvailableLabCodes() AddLabor() SetLabData() UpdateDuration() GetStatusInfoByUser() SetRawReason() NewEvent() Not Supported COMMENTS As for GetAll()

GetAvailableLabCodes Method
Purpose To retrieve the set of possible final labor codes for a given entity. If the optional raw_reas_cd parameter is included then the final list is filtered to include only those final labor codes that may result from the given raw reason. Syntax GetAvailableLabCodes (ent_id, raw_reas_cd) 287

2004 CIMNET Inc

www.CimnetInc.com

Parameters Part ent_id raw_reas_cd Description Required. By Value. A long to identify the entity. Optional. By Value. A variant (long) to filter the available labor code list for the given raw reason code. Defaults to 1 (ie. all labor codes independent of a raw reason code).

Returns ADODB.recordset containing columns for the following: lab_cd, lab_desc. Remarks The ent_id must be configured with the can_capture_labor flag set to TRUE otherwise an error is returned. When labor codes are configured and linked to entities and raw reason codes, a raw_reas_cd = -1 is used to identify all labor codes that are independent of a raw reason code. If this method returns an empty recordset and you have defined labor codes, then this is the first place to look. Stored Procedure(s) Used sp_SA_Labor_Exec_GetAvLabCds Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>labor_exec</object> <cmd>GetAvailableLabCodes</cmd> <ent_id>1</ent_id> <raw_reas_cd>-1</raw_reas_cd> </request>

AddLabor Method
Purpose To manually enter that a quantity of labor has been used on a given entity. Syntax AddLabor ( session_id, ent_id, user_id, lab_cd, duration, dept_id, pct_to_apply, event_time, wo_id, oper_id, seq_no, step_no, item_id, lot_no, shift_id, shift_start, comments) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made.

2004 CIMNET Inc

www.CimnetInc.com

288

ent_id user_id lab_cd duration

Required. By Value. A long to identify the entity. Required. By Value. A string to identify the user. Required. By Value. A string to specify the labor code Required. By Value. A long to specify the duration in seconds of labor used. Optional. By Value. A variant (string) to specify the dept_id for which the labor was performed. Defaults to default department for this user. Optional. By Value. A variant (double) to specify the percentage split of labor for this transaction if the lab_split flag is TRUE. Defaults to 100%. Optional. By Value. A variant (date) to specify the transaction entry time. Defaults to Now. Optional. By Value. A variant (string) to specify the wo_id on which the labor was performed. Defaults to current value on this entity. Optional. By Value. A variant (string) to specify the oper_id on which the labor was performed. Defaults to current value on this entity. Optional. By Value. A variant (long) to specify the seq_no on which the labor was performed. Defaults to current value on this entity. Optional. By Value. A variant (long) to specify the step_no on which the labor was performed. Defaults to current value on this entity. Optional. By Value. A variant (string) to specify the item_id on which the labor was performed. Defaults to current item being produced on this entity. Optional. By Value. A variant (string) to specify the lot_no on which the labor was performed. Defaults to current lot being produced on this entity. Optional. By Value. A variant (long) to specify the shift_id during which the labor was performed. Defaults to current shift running on this entity. Optional. By Value. A variant (datetime) to specify the shift_start time for the shift during which the labor was performed. Defaults to

dept_id

pct_to_apply

event_time

wo_id

oper_id

seq_no

step_no

item_id

lot_no

shift_id

shift_start

2004 CIMNET Inc

www.CimnetInc.com

289

current shifts start time running on this entity. comments Optional. By Value. A variant (string) to add comments to this transaction. Defaults to .

Returns Integer. 0 if successful, else -1 Remarks The ent_id must be configured with the can_capture_labor flag set to TRUE otherwise an error is returned. This method inserts a new row into the labor_usage table. The defaults are assigned as defined in the table above only if <oper_id> tag is missing in the xmlrequest. This triggers, wo_id, oper_id, seq_no, step_no, item_id and lot_no to be assigned with entitys defaults. If <oper_id> tag has some value, then all the other values are written per the xml request. There is no validation done to check that a user is entering more time than may have passed since his last entry. Should we include some type of validation here ? If the dept_id parameter is not specified then the def_dept_id for the specified user_id is retrieved from the user_name table. If this value is null an error is returned, otherwise it is used for the labor transaction. It is not necessary to call this method if the user logs in and out of Operator as it is automatically called in that case (provided the Labor Capture module is licensed). This method is thus only used externally to add additional labor to that captured automatically by Operator. Stored Procedure(s) Used sp_I_Labor_Exec_AddLabor Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>labor_exec</object> <cmd>AddLabor</cmd> <ent_id>1</ent_id> <user_id>111</user_id> <lab_cd>32</lab_cd> <duration>2366</duration> <dept_id></dept_id> <pct_to_apply></pct_to_apply> <event_time></event_time> <wo_id></wo_id> <oper_id></oper_id> <seq_no></seq_no> <step_no></step_no> <item_id></item_id> <lot_no></lot_no> <shift_id></shift_id>
www.CimnetInc.com

2004 CIMNET Inc

290

<shift_start></shift_start> <comments></comments> </request>

SetLabData Method
Purpose To change the current labor code and / or dept_id and / or percentage labor to apply to a specified active labor collection event for a given entity. Syntax SetLabData ( session_id, ent_id, user_id, step_no, lot_no, lab_cd, dept_id, pct_to_apply, comments) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A long to identify the entity. Required. By Value. A string to identify the user performing the labor. Optional. By Value. A variant (long) to specify the step_no on which this labor is being performed. Used to identify the labor event IF the labor is being logged to a step / lot. Optional. By Value. A variant (string) to specify the lot_no on which this labor is being performed. Used to identify the labor event IF the labor is being logged to a step / lot. Optional. By Value. A variant (string) to specify a new labor code for this labor event. Defaults to existing value. Optional. By Value. A variant (string) to specify a new dept_id (cost center) to which this labor is attributed. Defaults to existing value. Optional. By Value. A variant (double) to specify a new percentage of labor for this event. Defaults to existing value. Optional. By Value. A variant (string) to add comments to this labor event. Defaults to existing value.

ent_id user_id

step_no

lot_no

lab_cd

dept_id

pct_to_apply

comments

Returns Integer. 0 if successful, else -1 Remarks


2004 CIMNET Inc

www.CimnetInc.com

291

This method closes off existing active row(s) in the labor_usage table that satisfy the filter criteria and then creates new labor events for them with the new values. The step_no and lot_no optional parameters are included as filters to select which rows are affected IF they are included, otherwise they are not used to filter the active row(s) that are updated. Either the lab_cd or the dept_id or the pct_to_apply parameters or any combination of them should be included, otherwise there is no point in calling this method. Also update the ent_logon table for this session, user and entity. Stored Procedure(s) Used SP_U_Labor_Exec_NewLabor Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>labor_exec</object> <cmd>AddLabor</cmd> <session_id>1248</session_id> <ent_id>1</ent_id> <user_id>111</user_id> <step_no></step_no> <lot_no></lot_no> <lab_cd>32</lab_cd> <dept_id></dept_id> <pct_to_apply></pct_to_apply> <comments></comments> </request>

UpdateDuration Method
Purpose To update the current durations of any active labor events specified by optional filters. All these labor events are left as active. Syntax UpdateDuration (session_id, log_id, event_time) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Optional. By Value. A variant (long) to specify a single labor event to have its duration updated. Defaults to Null which means that ALL active labor events are updated.

log_id

2004 CIMNET Inc

www.CimnetInc.com

292

event_time

Optional. By Value. A variant (datetime) to specify the end time for current events. Used only if exact synchronization is required. Defaults to Now.

Returns Integer. 0 if successful, else -1 Remarks This method is typically called by the background service once a minute to keep active labor durations as up to date as possible. Stored Procedure(s) Used SP_U_Labor_Exec_UpdLabDuration Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>labor_exec</object> <cmd>UpdateDuration</cmd> <log_id></log_id> <event_time></event_time> </request>

GetStatusInfoByUser Method
Purpose To return all current Labor status information for all entities that a given user is currently logged into from a given session. Syntax GetStatusInfoByUser (session_id, user_id) Parameters Part session_id user_id Returns ADODB.recordset. Remarks The returned recordset includes entity specific data related to the entity itself and current Labor status data, and many more which could be added for a specific application at runtime by enhancing the Stored Procedure. The entities which a current user is logged into is determined by the ent_logon table which is updated whenever an Operator user adds or removes an entity from his control within a session.
2004 CIMNET Inc

Description Required. By Value. A long to identify the users session Required. By Value. A string to identify the user

www.CimnetInc.com

293

Stored Procedure(s) Used sp_SA_Labor_Exec_GetStatusInfoByUser Access via Director.cls using GetSpecificRS() Yes. The XML input parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>labor_exec</object> <cmd>GetStatusInfoByUser</cmd> <session_id>123</session_id> <user_id>111</user_id> </request>

SetRawReason Method
Purpose To set the current labor reason code for a given entity based on a Raw reas_cd received directly from the I/O system. This raw reas_cd will specify a default labor_cd for ALL users currently logged onto this entity. Syntax SetRawReason (session_id, ent_id, raw_reas_cd, new_reas_start, comments) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A long to identify the entity. Required. By Value. A long to specify the new Raw reason. Optional. By Value. A variant (datetime) to specify the timestamp from which the new raw reason applies. Defaults to Now. Optional. By Value. A variant (string) to include a comment that provides more information for the new reason. Defaults to .

ent_id raw_reas_cd new_reas_start

comments

Returns Integer. 0 if successful, else -1 Remarks The ent_id must have the can_capture_labor capability (determined by a row existing in the labor_exec table for this entity) otherwise an error is returned. Reads from the labor_raw_reas table to get the default labor code for this raw reason. The method then calls the SetLabData() method to apply this default lab_cd.
2004 CIMNET Inc

www.CimnetInc.com

294

Stored Procedure(s) Used sp_U_Labor_Exec_SetRawReason Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>labor_exec</object> <cmd>SetRawReason</cmd> <ent_id>1</ent_id> <raw_reas_cd>23</raw_reas_cd> <new_reas_start></new_reas_start> <comments></comments> </request>

Labor_Cat Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id As for GetAll()

Labor_Dept Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update()
2004 CIMNET Inc

COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id As for GetAll()

No specific recordsets currently supported

www.CimnetInc.com

295

UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

Labor_Reas_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset : ent.ent_name, labor_cat.lab_desc GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Not supported as there are no dependent fields Not supported as there are no dependent fields No specific recordsets currently supported As for GetAll()

Labor_Raw_Reas Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following columns are also included in the returned recordset: labor_cat.lab_desc, ent.ent_name GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd()
2004 CIMNET Inc

As for GetAll()

No specific recordsets currently supported

www.CimnetInc.com

296

IsValid()

Labor_Usage Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: pct_to_apply, duration, comments, last_edit_comment, mod_id. If the following optional filter fields are included the filter test is as follows: Labor_start returns all rows where labor_start >= parameter value. Shift_start returns all rows where shift_start >= parameter value. The following columns are also included in the returned recordset : user_name.user_desc, ent.ent_name, item.item_desc, labor_cat.lab_desc, labor_cat.color, shift.shift_desc, labor_usage.duration (in hh:mm:ss format) GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported Not supported. Use the LogonEnt() methods of the labor_exec class to add rows to this table. As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

297

CERT DLL Enhanced Methods


Cert_Type Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: signoff_notes, num_signoffs_reqd, reqd_exp_to_renew, comments_reqd, last_edit_comment, row_id As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

Cert_User_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following additional columns are also included in the returned recordset: user_name.user_desc (user_id) GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

298

Cert_Item_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following additional columns are also included in the returned recordset: item.item_desc (item_id), cert_type.max_level (cert_name) GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported As for GetAll()

Cert_Oper_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id The following additional columns are also included in the returned recordset: process.process_desc (process_id), oper.oper_desc (oper_id), cert_type.max_level (cert_name), cert_type.cert_audit (cert_name) GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported As for GetAll()

Cert_Oper_Step_Link Class
Summary of the methods supported by this class:
STANDARD METHODS
2004 CIMNET Inc

COMMENTS www.CimnetInc.com

299

GetAll()

The following columns are NOT available as filters: last_edit_comment, row_id The following additional columns are included in the returned recordset: cert_type.max_level (cert_name), cert_type.cert_audit (cert_name)

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

As for GetAll()

No specific recordsets currently supported

Cert_Attr_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id As for GetAll()

Cert_Audit_Log Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id. If the following optional filter fields are included the filter test is as follows: Sign_off returns all rows where sign_off >= parameter value. The following additional columns are also included in the returned recordset: user_name.user_desc (user_id) GetAllbyXML()
2004 CIMNET Inc

As for GetAll() www.CimnetInc.com

300

GetByKey()

This method also supports to fetch a single row using its effective primary key. Either row_id OR all of the following optional parameters must be supplied to fetch a single row: wo_id, oper_id, seq_no, step_no, lot_no, prod_log_id, cons_log_id, cert_name, user_id

GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Not supported. Use the CertSignoff() methods of the job_exec class to add rows to this table.

2004 CIMNET Inc

www.CimnetInc.com

301

CUST DLL Enhanced Methods


Cust Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: address1, address2, phone, fax, email, last_edit_comment, mod_id, row_id As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS GetAllByFilter

No specific recordsets currently supported

COMMENTS Returns a recordset of customers and sales orders filtered by the users current filter settings

GetAllByFilter Method
Purpose Returns a recordset of customers and sales orders filtered by the users current filter settings. Syntax GetAllByFilter(user_id) Parameters Part user_id Description Required. By Value. A Variant (string) to identify the user running Supervisor.

Returns ADODB.recordset. The columns are cust_id, cust_name, and po_id. Remarks
2004 CIMNET Inc

www.CimnetInc.com

302

This method must first get the users filter information from the ui_config table. Then it must use the filter information to build a query to get the indicated records. Stored Procedure(s) Used sp_SA_Cust_GetAllByFilter Access via Director.cls using GetSpecificRS() Yes. The XML input parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>cust</object> <cmd>GetAllByFilter</cmd> <user_id>User</user_id> </request>

Cust_Contact Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: phone, fax, email, last_edit_comment, mod_id, row_id The following additional columns are also included in the returned recordset: cust.cust_name GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported As for GetAll()

SO Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS

The following fields are not permitted as optional filter parameters to increase performance: notes, mod_id, row_id.
If the the date_received filter is included all rows AT AND AFTER the specified datetime are included.

2004 CIMNET Inc

www.CimnetInc.com

303

The following columns are also included in the returned recordset : cust.cust_name GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported As for GetAll()

So_Line Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS

The following fields are not permitted as optional filter parameters to increase performance: quantity, min_qty, max_qty, line_price, last_edit_comment, mod_id, row_id
If the the reqd_by filter is included all rows AT AND AFTER the specified datetime are included. The following columns are also included in the returned recordset : item.item_desc, item.num_decimals, cust.cust_name

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS GetNextSoLineNo GetAllByFilter

As for GetAll()

No specific recordsets currently supported

COMMENTS Returns the next available sales order line no Returns a recordset of line items filtered by the users current filter settings

GetNextSoLineNo Method
Purpose
2004 CIMNET Inc

www.CimnetInc.com

304

Returns the next available line number for a sales order. Syntax GetNextSoLineNo (cust_id, po_id) Parameters Part cust_id Description Required. By Value. A Variant (string) to identify the customer to which the item is being shipped Required. By Value. A Variant (string) to identify the sales order being shipped.

po_id

Returns Long. Throws an exception if an error occurs. Remarks This method checks all the shipment_lot records for the line item and adds up the quantity shipped. Stored Procedure(s) Used sp_SA_So_Line_GetNextSOLineNo Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>po_line</object> <cmd>GetNextSoLineNo</cmd> <msgtype>exec</msgtype> <cust_id>Customer</cust_id> <po_id>PO</po_id> </request>

GetAllByFilter Method
Purpose Returns a recordset of line items filtered by the users current filter settings. Syntax GetAllByFilter(user_id, cust_id) Parameters Part user_id Description Required. By Value. A Variant (string) to identify the user running

2004 CIMNET Inc

www.CimnetInc.com

305

Supervisor. cust_id Required. By Value. A Variant (string) to identify the customer whose line items should be returned Required. By Value. A Variant (string) to identify the purchase order id

po_id

Returns ADODB.recordset. The columns are po_line_no, item_id, and item_desc. Remarks This method must first get the users filter information from the ui_config table. Then it must use the filter information to build a query to get the indicated records. Stored Procedure(s) Used sp_SA_PO_Line_GetAllByFilter Access via Director.cls using GetSpecificRS() Yes. The XML input parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>po</object> <cmd>GetAllByFilter</cmd> <msgtype>exec</msgtype> <user_id>User</user_id> <cust_id>Cust</cust_id> <po_id>121</po_id> </request>

So_Wo_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters: last_edit_comment, row_id. The following columns are also included in the returned recordset : cust.cust_name. GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete()
2004 CIMNET Inc

As for GetAll()

No specific recordsets currently supported

Not supported as there are no dependent fields Not supported as there are no dependent fields

www.CimnetInc.com

306

DeleteAll() ExecuteXMLCmd() IsValid()

Shipment Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS

The following fields are not permitted as optional filter parameters to increase performance: last_edit_comment, mod_id, row_id.
If the the ship_date filter is included all rows AT AND AFTER the specified datetime are included. The following columns are also included in the returned recordset : cust.cust_name, so_line.item_id, item.item_desc, item.num_decimals, total_to_ship (sum of so_line.quantity), total_qty_shipped (sum of shipment_lot.qty_shipped)

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

As for GetAll()

No specific recordsets currently supported

Shipment_Lot Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS

The following fields are not permitted as optional filter parameters to increase performance: qty_shipped, last_edit_comment, mod_id, row_id.
If the ship_date filter is included all rows AT AND AFTER the specified datetime are included. The following columns are also included in the returned recordset : cust.cust_name

GetAllbyXML() GetByKey() GetSpecificRS() Add()

As for GetAll()

No specific recordsets currently supported

2004 CIMNET Inc

www.CimnetInc.com

307

Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS GetQtyShipped() GetLotNos() GetMaxToShip() Ship() COMMENTS Returns the sum of quantity shipped for the customer on a selected sales order and the sales order line being shipped Returns a recordset of available lot nos Returns the maximum amount or number of the item that can be shipped for a sales order line Update shipment_lot for the total qty shipped and reduces inventory accordingly

GetQtyShipped Method
Purpose Returns the sum of quantity shipped for the customer on a selected sales order and sales order line being shipped. Syntax GetQtyShipped (cust_id, po_id, so_line_no) Parameters Part cust_id Description Required. By Value. A Variant (string) to identify the customer to which the item is being shipped Required. By Value. A Variant (string) to identify the sales order being shipped. Required. By Value. A Variant (long) to identify the sales order line being shipped.

po_id

so_line_no

Returns Variant (Double). Throws an exception if an error occurs. Remarks This method checks all the shipment_lot records for the line item and adds up the quantity shipped. Stored Procedure(s) Used sp_SA_Shipment_Lot_GetQtyShipd Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows:
2004 CIMNET Inc

www.CimnetInc.com

308

<?xml version="1.0"?> <request> <object>shipment_lot</object> <cmd>GetQtyShipped</cmd> <msgtype>exec</msgtype> <cust_id>Customer</cust_id> <po_id>PO</po_id> <so_line_no>1</so_line_no> </request>

GetLotNos Method
Purpose Returns a recordset of all available lot numbers. Syntax GetLotNos (item_id, cust_id, po_id, so_line_no) Parameters Part item_id Description Required. By Value. A Variant (string) to identify the item being shipped. Required. By Value. A Variant (string) to identify the customer to which the item is being shipped Required. By Value. A Variant (string) to identify the sales order being shipped. Required. By Value. A Variant (long) to identify the sales order line being shipped.

cust_id

po_id

so_line_no

Returns ADODB.recordset. The only column is lot_no. Remarks This method builds a recordset of lot numbers that are available for shipping. Stored Procedure(s) Used sp_SA_Shipment_Lot_GetLotNos Access via Director.cls using GetSpecificRS() Yes. The XML input parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>shipment_lot</object> <cmd>GetLotNumbers</cmd>
2004 CIMNET Inc

www.CimnetInc.com

309

<msgtype>exec</msgtype> <item_id>Item</item_id> <cust_id>Customer</cust_id> <po_id>PO</po_id> <so_line_no>1</so_line_no> </request>

GetMaxToShip Method
Purpose Returns the maximum amount or number of the item that can be shipped for a sales order line. Syntax GetMaxToShip (item_id, cust_id, po_id, so_line_no, ship_date, lot_no) Parameters Part item_id Description Required. By Value. A Variant (string) to identify the item being shipped. Required. By Value. A Variant (string) to identify the customer to which the item is being shipped Required. By Value. A Variant (string) to identify the sales order being shipped. Required. By Value. A Variant (long) to identify the sales order line being shipped. Required. By Value. A Variant (datetime) to identify the shipment. Required. By Value. A Variant (string) to identify the lot being shipped.

cust_id

po_id

so_line_no

ship_date lot_no

Returns Double. Throws an exception if an error occurs. Returns 1 if there is no restriction to the number that can be shipped. Remarks This method needs to check to see if the sales order line is tied to a work order. If it is, then the amount or number is restricted by the amount or number of items in the item_prod table that have not yet been shipped. If the sales order line is not tied to a work order and inventory is licensed, then the amount or number the amount or number of items in inventory. If the sales order line is not tied to a work order and inventory is not licensed, then the amount or number is not restricted. Stored Procedure(s) Used sp_SA_Shipment_Lot_GetMaxToShp Access via Director.cls using ExecuteXMLCmd()

2004 CIMNET Inc

www.CimnetInc.com

310

Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>shipment_lot</object> <cmd>GetLotNumbers</cmd> <msgtype>exec</msgtype> <item_id>Item</item_id> <cust_id>Customer</cust_id> <po_id>PO</po_id> <so_line_no>1</so_line_no> <ship_date>1</ship_date> <lot_no>lot 1</lot_no> </request>

Ship Method
Purpose
Record the total qty shipped and update the quantities in inventory accordingly

Syntax Ship(session_id, shipment_details, mod_id) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A Variant (string) containing an XML string listing the shipping details Optional. By Ref. A Variant (string) to identify the row in shipment_lot table.

shipment_details

mod_id

Returns Long 0 if the shipment is done, or 1 if the shipment cannot be done Remarks The shipment_details XML string will have the format as defined below. This inserts a new row in shipment_lot table for the total qty_shipped to the customer for the cust_id, po_id, po_line_no, ship_date and lot_no. Then it calls ReduceInv() method to reduce the item from inventory which is shipped. If an item is shipped from multiple storage locations, then the item in inventory is also reduced from multiple storage locations. Stored Procedure(s) Used sp_I_Shipment_Lot and ReduceInv() method Access via Director.cls using GetSpecificRS() Yes. The XML input parameter must be formatted to include the required method parameters as
2004 CIMNET Inc

www.CimnetInc.com

311

follows: <request> <object>shipment_lot</object> <cmd>ship</cmd> <msgtype>exec</msgtype> <session_id>21323</session_id> <cust_id>CIMK.OB</cust_id> <po_id>Order 2</po_id> <so_line_no>1</so_line_no> <ship_date>2003-08-07 09:46:09</ship_date> <qty_shipped>258</qty_shipped> <lot_no>lot1</lot_no> <item_id>bevcanend</item_id> <user_id>cimuser</user_id> <item_inv> <ent_id>1221</ent_id> <qty_ship>57</qty_ship> <grade_cd>4</grade_cd> <status_cd>6</status_cd> </item_inv> <item_inv> <ent_id>4245</ent_id> <qty_ship>173</qty_ship> <grade_cd>2</grade_cd> <status_cd>3</status_cd> </item_inv> <item_inv> <ent_id>7932</ent_id> <qty_ship>28</qty_ship> <grade_cd>5</grade_cd> <status_cd>5</status_cd> </item_inv> </request>

Vendor_Item_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS

The following fields are not permitted as optional filter parameters to increase performance: price, last_edit_comment, row_id.
Lead_time returns all rows where lead_time <= parameter value As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS()

No specific recordsets currently supported

2004 CIMNET Inc

www.CimnetInc.com

312

Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

PO Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS

The following fields are not permitted as optional filter parameters to increase performance: notes, last_edit_comment, row_id.
Date_Issued returns all rows where date_issued >= parameter value As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

No specific recordsets currently supported

Po_Line Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS

The following fields are not permitted as optional filter parameters to increase performance: quantity, min_qty, max_qty, line_price, last_edit_comment, row_id. Reqd_by returns all rows where reqd_by<= parameter value

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update()


2004 CIMNET Inc

As for GetAll()

No specific recordsets currently supported

www.CimnetInc.com

313

UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

Receipt Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS

The following fields are not permitted as optional filter parameters to increase performance: last_edit_comment, row_id. Date_Rcvd returns all rows where date_rcvd >= parameter value

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

As for GetAll()

No specific recordsets currently supported

Receipt_Lot Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS

The following fields are not permitted as optional filter parameters to increase performance: quantity, last_edit_comment, row_id. Date_Rcvd returns all rows where date_rcvd >= parameter value

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update()


2004 CIMNET Inc

As for GetAll()

No specific recordsets currently supported

www.CimnetInc.com

314

UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

DX DLL Enhanced Methods


Dx_Sched Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: trigger_detail, data_detail, format_detail, transport_detail, post_update_detail, post_action_detail, last_activity, last_result, runtime_script, last_edit_comment, row_id As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() ImportXMLData() SPECIFIC METHODS SetDataType() RunQuery() Clone() TestQuery() GetImportFieldMappings()

Stub only. No specific recordsets currently supported

COMMENTS

Not Implemented yet

SetDataType Method
Purpose To set the datatype of a specified data exchange schedule. Ensures that relevant rows are included in the dx_field table for this data type. Will delete all existing rows for this sched_id in case user is changing the sched_type. Mainly used for Import schedules as export schedules typically do not use data in the dx_field table.
2004 CIMNET Inc

www.CimnetInc.com

315

Syntax SetDataType (session_id, sched_id, sched_type) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string identifying the schedule. Required. By Value. A long specifying the new data type. Valid values are as in the previously defined data_type enumeration list

sched_id sched_type

Returns A long = 0 if successful. Throws an exception with an appropriate description if unsuccessful. Remarks If the schedule is an import type then first deletes any rows in the dx_field table for the schedule. Then inserts new rows including the default and mandatory field types based on the data type. The client software can then retrieve from the dx_field table and configure which fields are / are not included in this specific schedule. If the schedule is an export type then deletes any rows in the dx_field table for the schedule as export schedules typically do not require field data specified in this detail ? Also updates the dx_sched table with the new datatype. Stored Procedure(s) Used sp_U_Dx_Sched_SetDataType Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>dx_sched</object> <msgtype>exec</msgtype> <cmd>SetDataType</cmd> <session_id>156</session_id> <sched_id>dx1</sched_id> <sched_type>0</sched_type> </request> The XML response will be formatted as follows if the call is successful: <?xml version="1.0"?> <response> <result>0</result> </response> The XML response will be formatted as follows if the call is unsuccessful: <?xml version="1.0"?> <response>
2004 CIMNET Inc

www.CimnetInc.com

316

<result>-1</result> <error> <desc>sched_id does not exist</desc> </error> </response>

RunQuery Method
Purpose To execute a predefined query passing relevant runtime parameters and return an appropriate recordset. Syntax RunQuery (session_id, query_id, parameters) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A long to identify the existing query as defined in the dx_query table. Optional. By Value. A variant (string) containing XML formatted runtime parameter values to apply to the query.

query_id

parameters

Returns ADODB.recordset. Remarks The required query parameters are read from the dx_query_param table and the runtime values are extracted from the parameters argument. The query is then executed using these parameters and the resultset returned. The caller does NOT need to know the query type it is transparent to the caller whether it is an SQL query, a Stored Procedure or another method call on the middleware. Stored Procedure(s) Used N/A Access via Director.cls using GetSpecificRS() Yes. The XML input parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>dx_sched</object> <msgtype>GetSpec</msgtype> <cmd>RunQuery</cmd> <query_id>123</query_id>
2004 CIMNET Inc

www.CimnetInc.com

317

<parameters></parameters> </request>

Clone Method (Not Implemented yet)


Purpose To clone an existing data exchanger schedule. Syntax Clone (session_id, sched_id, new_sched_id) Parameters Part session_id Description Required. By Value. A long to identify the session from which the call is being made. Required. By Value. A string identifying the schedule to be cloned. Required. By Value. A string to identify the new schedule

sched_id new_sched_id Returns

A boolean = True if successful, else False. Remarks All data in the dx_sched table is cloned with the exception of the last_status_* fileds. Also the new schedule is initially disabled as in most cases it will need to be edited before being explicitly enabled. All data in the dx_field table is cloned. No data in the dx_log table or any other dx_*** tables is cloned. Stored Procedure(s) Used sp_I_Dx_Sched_Clone Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>dx_sched</object> <msgtype>exec</msgtype> <cmd>Clone</cmd> <dx_sched> <sched_id>dx1</sched_id> <new_sched_id>dx2</new_sched_id> </dx_sched> </request> The XML response will be formatted as follows if the call is successful: <?xml version="1.0"?> <response> <result>0</result> </response>
2004 CIMNET Inc

www.CimnetInc.com

318

The XML response will be formatted as follows if the call is unsuccessful: <?xml version="1.0"?> <response> <result>-1</result> <error> <desc>sched_id does not exist</desc> </error> </response>

TestQuery Method
Purpose To execute a predefined query passing relevant runtime parameters and return an appropriate recordset. Usd to validate a query before saving it. Syntax TestQuery (XMLRequest) Parameters Part XMLRequest Returns ADODB.recordset. Remarks The XML formatted command must be structured as follows <query_type> SQL or SP <sql> Include SQL statement if <cmd> = SQL <sp> Include Stored Procedure name if <cmd> = SP <sp_parameters> Include Stored Procedure parameter details if <cmd> = SP <name> parameter name, eg ent_id Each name element may have the following attributes: datatype Data type for parameter according to ADO Datatype enums, eg long = 20, varchar = 200, boolean = 11, datetime = 133, double = 5 direction Parameter direction based on ADO ParameterDirection enums, eg input = 1 size Number of bytes or characters reserved for the parameter: 4 for longs, max string length for varchars, 1 for Booleans, 8 for datetimes. value Value to be applied for this parameter represented as a string. (Not required for output parameters) Include a <name> element for all SP parameters in the correct sequence </sp_parameters> Stored Procedure(s) Used N/A
2004 CIMNET Inc

Description Required. By Value. An XML formatted string

www.CimnetInc.com

319

Access via Director.cls using ExecuteXMLCmd() No Access via Director.cls using GetSpecificRS() Yes. The XML input parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>dx_sched</object> <cmd>TestQuery</cmd> <msgtype>getspec</msgtype> <test_query> <query_type>SQL</query_type> <sql>select * from ent where ent_id = 1211</sql> </test_query> </request> <?xml version="1.0"?> <request> <object>dx_sched</object> <cmd>TestQuery</cmd> <msgtype>getspec</msgtype> <test_query> <query_type>SP</query_type> <sp>CustomSPName</sp> <sp_parameters>

<parameter name=ent_id datatype=20 direction=1 size=4 value=123/> <parameter name=tree_icon datatype=200 direction=1 size=254 value=new.ico/>
</sp_parameters> </test_query> </request>

GetImportFieldMappings Method
Purpose To retrieve a recordset for a schedule with its fields and its equivalent mapping id. Syntax GetImportFieldMappings (sched_id) Parameters Part
2004 CIMNET Inc

Description
www.CimnetInc.com

320

sched_id Returns

Required. By Value. A variant (string) to identify the sched_id

ADODB.Recordset containing columns for the following: sched_id, field_name, included, mandatory, display_seq, default_value, field_index, mapping_id, external_id, internal_id Remarks The list includes all the fields for this schedule with the field names, mapping id, and its equivalent mapping fields. Stored Procedure(s) Used sp_SA_Dx_Map_Imp_GetImportMaps Access via Director.cls using ExecuteXMLCmd() No Access via Director.cls using GetSpecificRS() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>dx_sched </object> <msgtype>getspec</msgtype> <cmd> GetImportFieldMappings</cmd> <sched_id> SchedThurs1 </sched_id> </request>

Dx_Field Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: default_value, format_detail, formula, last_edit_comment, row_id As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

321

Dx_Map_Imp Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS GetDistinctMappings() COMMENTS No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id As for GetAll()

GetDistinctMappings Method
Purpose Get distinct Import Mapping IDs. Syntax GetDistinctMappings () Returns ADODB.Recordset. Remarks Gets distinct mapping ids from dx_map_imp table Stored Procedure(s) Used sp_S_Dx_Map_Imp_GetDistMaps Access via Director.cls using GetSpecificRS() Yes, Returns recordset in XML format. The XMLCmd parameter must be formatted to include the user_id parameter as follows: <?xml version="1.0"?> <request> <object>dx_map_imp</object>
2004 CIMNET Inc

www.CimnetInc.com

322

<msgtype>GetSpec</msgtype> <cmd>GetDistinctMappings</cmd> </request>

Dx_Map_Exp Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS GetDistinctMappings() COMMENTS No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: last_edit_comment, row_id As for GetAll()

GetDistinctMappings Method
Purpose Get distinct Export Mapping IDs. Syntax GetDistinctMappings () Returns ADODB.Recordset. Remarks Gets distinct mapping ids from dx_map_exp table Stored Procedure(s) Used sp_S_Dx_Map_Exp_GetDistMaps Access via Director.cls using GetSpecificRS() Yes, Returns recordset in XML format. The XMLCmd parameter must be formatted to include the
2004 CIMNET Inc

www.CimnetInc.com

323

user_id parameter as follows: <?xml version="1.0"?> <request> <object>dx_map_exp</object> <msgtype>GetSpec</msgtype> <cmd>GetDistinctMappings</cmd> </request>

Dx_Query Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS Clone() COMMENTS Used to clone a query. Stub only yet to be implemented Stub only. No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: query_detail, last_edit_comment, row_id As for GetAll()

Dx_Query_Param Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: direction, param_type, param_size, def_value, last_edit_comment, row_id As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete()


2004 CIMNET Inc

Stub only. No specific recordsets currently supported

www.CimnetInc.com

324

DeleteAll() ExecuteXMLCmd() IsValid()

Dx_Queue Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() Stub only. No specific recordsets currently supported COMMENTS The following fields are not permitted as optional filter parameters to increase performance: details, row_id As for GetAll()

Dx_Log Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: triggered_by, rows_success, rows_error, comments, error_desc. If the following optional filter fields are included the filter test is as follows: logged_at returns all rows where logged_at >= parameter value GetAllbyXML() The following columns are NOT available as filters: triggered_by, rows_success, rows_error, comments, error_desc. If the following optional filter fields are included the filter test is as follows: logged_at returns all rows where logged_at >= parameter value GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() No specific recordsets currently supported

2004 CIMNET Inc

www.CimnetInc.com

325

ExecuteXMLCmd() IsValid()

2004 CIMNET Inc

www.CimnetInc.com

326

FC DLL Enhanced Methods


FC_Namesp_Node Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS Clone() COMMENTS To clone a namespace node and all of its children. Exposed tags are not cloned. No specific recordsets currently supported COMMENTS The following columns are NOT available as filters: ent_id, bom_pos, attr_id, grp_id, value_index, other_id, spare1 4, last_edit_comment As for GetAll()

Clone Method
Purpose To clone a namespace node and all of its children. Exposed tags are not cloned. Syntax Clone (session_id, node_id, from_node_id) Parameters Part session_id Description Required. By Value. A variant (long) to identify the session from which the call is being made. Required. By Value. A variant (long) to identify the destination node under which the cloned nodes are to be inserted. Required. By Value. A variant (long) to identify the node FROM which the cloned nodes are to be read.

node_id

from_node_id

Returns
2004 CIMNET Inc

www.CimnetInc.com

327

A long = 0 on success or 1 if an error occurred. Remarks Only level 1 nodes may be cloned. The children nodes which are cloned are filtered if the destination nodes entity does not have the same capabilities as the entity for the source node. Stored Procedure(s) Used sp_I_FC_Namesp_Node_Clone Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>fc_namesp_node</object> <msgtype>exec</msgtype> <cmd>Clone</cmd> <session_id>1234</session_id> <node_id>112</node_id> <from_node_id>113</from_node_id> </request>

FC_Namesp_Tag Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns are NOT available as filters: run_script_on_write, run_script_on_read, poll_for_reads, poll_interval, script, max_value, deadband, scaling_factor, last_value, last_edit_comment As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() SPECIFIC METHODS GetChangesAndReset()

No specific recordsets currently supported

COMMENTS Return all changed tags for a given FC EXE instance, and then reset the changed flags.

GetChangesAndReset Method

2004 CIMNET Inc

www.CimnetInc.com

328

Purpose To retrieve a recordset of all tag values that have been changed internally by Factelligence and not yet written to the OPC Server, and then reset the changed flags. Syntax GetChangesAndReset (fc_id) Parameters Part fc_id Description Required. By Value. A variant (int32) to filter the namespace tags to be returned to those from the the specified Factory Connector instance (fc_id).

Returns A recordset containing the following columns from the fc_namesp_tag table: tag_id, last_value. Remarks Only tags with changed values are included in the recordset. This is effectively the queue of changes to be written to any shop floor devices. After the retrieve the new_value field will be set to False by the stored procedure to indicate that the new values for these tags have been handled. Stored Procedure(s) Used sp_SA_Fc_Namesp_Tag_GetChnges Access via Director.cls using ExecuteXMLCmd() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>fc_namesp_tag</object> <msgtype>getspec</msgtype> <cmd>GetChangesAndReset</cmd> <fc_id>1</fc_id> </request>

FC_Bridge Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following columns ARE available as filters: tag_id, enabled, status, ext_driver, spare1 4, last_edit_by, last_edit_at. The following columns are also included in the returned recordset: fc_namesp_node.node_desc, fc_namesp_node.node_level, fc_namesp_node.parent_node_id, fc_namesp_node.node_level1- 4, fc_namesp_tag.tag_desc, fc_namesp_tag.data_type, fc_namesp_tag.readable, fc_namesp_tag.writable, fc_namesp_tag.max_value, fc_namesp_tag.deadband, fc_namesp_tag.scaling_factor GetAllbyXML() As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

329

GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported

Form DLL Enhanced Methods


Form Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() ExecuteXMLCmd() IsValid() No specific recordsets currently supported COMMENTS The following fields are not permitted as optional filter parameters to increase performance: content_file, form_properties, last_edit_comment, row_id As for GetAll()

Script Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: script, last_edit_comment. The following columns are also included in the returned recordset : form_script_link.form_name, GetAllbyXML() GetByKey() GetSpecificRS()
2004 CIMNET Inc

As for GetAll()

No specific recordsets currently supported www.CimnetInc.com

330

Add() Update() UpdateSpecific() Delete() ExecuteXMLCmd() IsValid() SPECIFIC METHODS DeleteByName() UpdateByName() SaveFormScript COMMENTS Deletes a Script identified by its Script_Name, Script_Type and Context Updates a script identified by its Script_Name, Script_Type and Context Inserts or Updates a script for the specified form

DeleteByName Method
Purpose Deletes a Script identified by its script_name, script_type and context instead of its script_id. If the optional form_name parameter is included then the specified script is only deleted if it is linked to the specified form. Syntax DeleteByName (session_id, script_name, script_type, context, form_name) Parameters Part session_id script_name script_type context Description Required. By Value. A variant (long) to identify the session Required. By Value. A variant (string) to identify the script. Required. By Value. A variant (long) to identify the script_type Required. By Value. A variant (long) to identify the context of the script Optional. By Value. A variant (string) to specify the optional form_name for which this script is to be deleted

form_name

Returns Long. 0 if successful, else 1. Remarks If the optional form_name parameter is included then then only the specified script that is linked to this form is deleted from the script table, and the link row is deleted from the form_script_link table. This is included as there may be many scripts with the same name, type and context linked to different forms. Stored Procedure(s) Used None.
2004 CIMNET Inc

www.CimnetInc.com

331

Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>script</object> <msgtype>exec</ msgtype> <cmd>DeleteByName</cmd> <session_id>1234</session_id> <script_name>emp_insert</script_name> <script_type>1</script_type> <context>0</context> <form_name></form_name> </request>

UpdateByName Method
Purpose Updates a Script identified by its script_name, script_type and context instead of its script_id. If the optional form_name parameter is included then the specified script is only updated if it is linked to the specified form. Syntax UpdateByName (session_id, script_name, context, script_type, form_name, script, spare1, spare2, spare3, spare4) Parameters Part session_id script_name context script_type form_name Description Required. By Value. A variant (long) to identify the session. Required. By Value. A string to identify the script. Required. By Value. A long to identify the context of the script Required. By Value. A long to identify the script_type Optional. By Value. A variant (string) to identify the optional form_name for which this script is to be updated Optional. By Value. A variant (string) to identify the script Optional. By Value. A variant (string) to identify spare1 Optional. By Value. A variant (string) to identify spare2 Optional. By Value. A variant (string) to identify spare3

script spare1 spare2 spare3

2004 CIMNET Inc

www.CimnetInc.com

332

spare4

Optional. By Value. A variant (string) to identify spare4

Returns Long. 0 if successful, else 1. Remarks This method is designed to update 1 or more dependent fields for a specified script. , Any of the script, spare1, spare2, spare3 and spare4 fields may be updated. If the optional form_name parameter is included then then only the specified script that is linked to this form is updated in the script table. This is included as there may be many scripts with the same name, type and context linked to different forms. Stored Procedure(s) Used None. Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>script</object> <msgtype>exec</ msgtype> <cmd>UpdateByName</cmd> <session_id>1234</session_id> <script_name>emp_insert</script_name> <context>0</context> <script_type>1</script_type> <form_name></form_name> <script></script> <spare1></spare1> <spare2></spare2> <spare3></spare3> <spare4></spare4> </request>

SaveFormScript Method
Purpose Inserts or Updates a script for the specified form. Syntax SaveFormScript ( session_id, form_name, script_name, context, script_type, script, spare1, spare2, spare3, spare4, script_id) Parameters

2004 CIMNET Inc

www.CimnetInc.com

333

Part session_id form_name

Description Required. By Value. A variant (long) to identify the session Required. By Value. A string to identify the form for which the script is being saved. Required. By Value. A string to identify the script. Required. By Value. A long to identify the context of the script Required. By Value. A long to identify the script_type Required. By Value. A variant (string) containing the script Optional. By Value. A variant (string) to identify spare1 Optional. By Value. A variant (string) to identify spare2 Optional. By Value. A variant (string) to identify spare3 Optional. By Value. A variant (string) to identify spare4 Optional. By Ref. A variant (long) to return the script_id for this script to the caller.

script_name context script_type script spare1 spare2 spare3 spare4 script_id

Returns Long. 0 if successful, else 1. Remarks If the specified script for this form already exists in the database then it is updated. If it does not exist then the script is inserted into the script table and a row is inserted in the form_script_link table to link the new script with the specified form. The context should always = 0 as this script applies to a form (will remove as a parameter in next interface change). The script_type must be = 0 for Event Handler scripts or = 1 for General scripts. Stored Procedure(s) Used sp_I_Form_Script Access via Director.cls using ExecuteXMLCmd() Yes. The response will be an XML formatted 0 for success, else 1. The XMLCmd parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>script</object> <msgtype>exec</ msgtype > <cmd>SaveFormScript</cmd> <session_id>1234</session_id>
2004 CIMNET Inc

www.CimnetInc.com

334

<form_name>testform</form_name> <script_name>emp_insert</script_name> <context>0</context> <script_type>1</script_type> <script>Update emp set desg = xx</script> <spare1></spare1> <spare2></spare2> <spare3></spare3> <spare4></spare4> </request>

Form_Script_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported COMMENTS The following fields are not permitted as optional filter parameters to increase performance: last_edit_comment, row_id As for GetAll()

SPC DLL Enhanced Methods


SPC_Char Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: meas_desc, assoc_file_type, note_ok, recalc, cost, ind_lots, keyboard, last_edit_comment The following columns are included in the returned recordset : data_log_grp.grp_desc GetAllbyXML() GetByKey()
2004 CIMNET Inc

As for GetAll()

www.CimnetInc.com

335

GetSpecificRS() Add() Update() UpdateSpecific() Delete() ExecuteXMLCmd() IsValid()

No specific recordsets currently supported

SPC_Item_Char_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: lvl,uvl, lcl, ucl, lsl, usl, lrl, url, target_v, target_rs, units, decimals, prefill, last_edit_comment. The following columns are included in the returned recordset : spc_char.char_name, spc_char.variable GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported As for GetAll()

SPC_Char_Oper_Link Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: sequence, grp_seq, last_edit_comment. The following columns are also included in the returned recordset : spc_char.char_name, spc_char.ver_id. GetAllbyXML() GetByKey() GetSpecificRS() Add() Update()
2004 CIMNET Inc

As for GetAll()

No specific recordsets currently supported

www.CimnetInc.com

336

UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

SPC_Char_Job Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters to increase performance: lvl,uvl, lcl, ucl, lsl, usl, lrl, url, target_v, target_rs, units, decimals, prefill, meas_desc, assoc_file_type, note_ok, recalc, cost, ind_lots, keyboard, sequence, grp_seq, last_prod, last_edit_comment As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

No specific recordsets currently supported

SPC_Event Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() No specific recordsets currently supported COMMENTS The following fields are not permitted as optional filter parameters to increase performance: notes, last_edit_comment As for GetAll()

2004 CIMNET Inc

www.CimnetInc.com

337

IsValid()

SPC_Sample Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid() No specific recordsets currently supported COMMENTS All columns except last_edit_comment are available as filters As for GetAll()

SPC_Stats Class
Summary of the methods supported by this class:
STANDARD METHODS GetAll() COMMENTS The following fields are not permitted as optional filter parameters: x_bar, x_dbar, r_bar, s_bar, sigma, e_sigma, min_valu, max_valu, x_1, x_99, z_lsl, z_usl, pos_actual As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

No specific recordsets currently supported

Gage_Config Class
Summary of the methods supported by this class:
STANDARD METHODS
2004 CIMNET Inc

COMMENTS www.CimnetInc.com

338

GetAll()

The following fields are NOT permitted as optional filter parameters: com_port, baud_rate, parity, data_bits, stop_bits, channels, init_string, init_resp, request_string, request_resp, footsw_prompt, fs_mode, string_length, data_start, data_end, ch_start, ch_end, first_ch, gage_resp_timing, last_edit_comment, row_id As for GetAll()

GetAllbyXML() GetByKey() GetSpecificRS() Add() Update() UpdateSpecific() Delete() DeleteAll() ExecuteXMLCmd() IsValid()

No specific recordsets currently supported

2004 CIMNET Inc

www.CimnetInc.com

339

The Director Class


The purpose of this class is as follows: Provide access to middleware from clients who only need a single COM object reference that is Simple, Stable and Robust Provide access to middleware from clients who use HTTP as the transport layer. Most method calls to this class are delegated to the appropriate Data Access class SetUserConnStr(connstr) to set the DB connection string for the user making this function call to the value specified Summary of the methods supported by this class:
STANDARD METHODS GenericXMLRequest() COMMENTS Generic access to any command or request for data. Used by Web Server for HTTP access or generic access via DCOM. Delegates as follows based on the <msgtype> tag in the XML request: GetAll: delegates to GetRSasXML() GetSpec: delegates to GetSpecificRSasXML() GetBySQL: delegates to GetRSbySQLasXML() Exec: delegates to ExecuteXMLCmd() GetShaped: delegates to GetShapedRSbySQLasXML() RunQuery: delegates to RunQueryasXML() ExecBatch (new): creates an DirTrans object and delegates to its ExecuteBatchXMLCmds() method. GetRSasXML() GetRSbyXML() GetSpecificRSasXML() GetSpecificRS() GetRSbySQLasXML() Calls GetRSbyXML() to return a RS then converts it to XML based on the <schema> tag in the XML request. Creates an object based on the <object> tag in the XML request and calls the objects GetAllbyXML() method to return a RS. Calls GetSpecificRS() to return a RS then converts it to XML based on the <schema> tag in the XML request. Creates an object based on the <object> tag in the XML request and calls the objects GetSpecificRS() method to return a RS. Calls GetRSbySQL() to return a RS then converts it to XML based on the <schema> tag in the XML request. (new interface in V1.5 only include XML string as parameter which contains schema and rowname options instead): Extracts the SQL query included in the <sql> tag in the XML request and directly accesses the database with this SQL query to return a RS. (This results in reduced performance as the SQL is not precompiled into a Stored Procedure, and the client needs knowledge of the database) Calls GetShapedRSbySQL() to return a shaped or hierarchical RS then converts it to XML based on the <schema> tag in the XML request. Extracts the SQL query included in the <sql> tag in the XML request and directly accesses the database with this SQL query to return a shaped or hierarchical RS. Extracts the Connect String and SQL query included in the <sql> tag in the XML request and directly accesses the database specified in the connect string with this SQL query to return a RS. (This results in reduced www.CimnetInc.com

GetRSbySQL()

GetShapedRSbySQLasXML() GetShapedRSbySQL()

GetRSFromExtDB()

2004 CIMNET Inc

340

performance as the SQL is not precompiled into a Stored Procedure, and the client needs knowledge of the database) GetRSFromExtDBasXML() RunQueryasXML() Calls GetRSFromExtDB() to return a RS then converts it to XML based on the <schema> tag in the XML request. Calls RunQuery() to return a RS based on a preconfigured Factelligence query and then converts it to XML based on the <schema> tag in the XML request. Extracts the SQL query included in the <sql> tag in the XML request and directly accesses the database with this SQL query to return a shaped or hierarchical RS. Creates an object based on the <object> tag in the XML request and calls the objects ExecuteXMLCmd() method to handle the command and return an XML formatted response.

RunQuery()

ExecuteXMLCmd()

Trap when dealing with XML strings


XML is case sensitive which makes it difficult to search for XML nodes when the case of the node names is not known. For this reason we have forced all the searches for field names etc in our XML schema to be in lower case. In most cases the node text or 'data' can be in any case as once the code has found a node it can quite easily convert its contents as required. Eg. the following XML substrings are valid: <object>Ent</object> and <cmd>Add</cmd> as the node contents can be in any case but the node names must be in lower case. There is a difference between including the xml tags for an optional parameter with no value in the tag, and excluding the tag altogether. If the optional xml tag is not included at all then it will result in the variant value of Missing or Empty. If the tag is included but no value is specified then the value will be set to Null. This is necessary as in some cases (eg. UpdateSpecific) we may wish to set a particular to null instead of ignoring the optional parameter.

Method Delegation Hierarchy

2004 CIMNET Inc

www.CimnetInc.com

341

GenericXMLRequest() is typically accessed when HTTP is used as the transport and all requests are XMLHTTPRequests. The client has no knowledge of the Director class or its methods and the GenericXMLRequest() method is the gateway to all functionality. All XML Requests must include the <msgtype> tag to indicate which of the Level 2 methods to delegate to. The 2nd column methods are typically accessed by GenericXMLRequest() or when DCOM is used as the transport as the client usually has a reference to the Director class and can call the appropriate column 2 methods directly. All XML Requests received at this level must include the <object> tag to indicate which of the specific objects to instantiate for the delegation. The 3rd
2004 CIMNET Inc

www.CimnetInc.com

342

column methods recordsets to be returned as recordset objects or as XML format to facilitate HTTP and DCOM access where it is common to return recordset objects without converting them to XML. Individual class requests or commands typically require the <cmd> tag to identify which object level method to invoke to fulfill the request, assuming the request requires this. Note there are some requests that do not require an object level method to be invoked. Note: When passing the original XML request to delegated objects it is advisable to pass the original XML string instead of removing unnecessary tags such as the <msgtype> tag. This saves processing for the small overhead of passing slightly bigger strings around, but it also means that the original request is always available in its entirety. Most of this is hidden from the end user by our client side layers which make it transparent to other client side software layers. It is only really of importance to people who will be writing or extending our client side layers. GenericXMLRequest Method Purpose To provide a single method interface to handle all XML based functionality. Used specifically to handle all XMLHTTPRequests from the Web server (via IFWeb). This delegates to ExecuteXMLCmd(), GetRSasXML(), GetSpecificRSasXML() or GetRSbySQLasXML() depending on the <msgtype> tag. Syntax GenericXMLRequest (xmlRequest string) Parameters The XML formatted command must be structured as follows: <msgtype> mandatory (valid values are currently: 'Exec', 'GetAll', 'GetSpec' and 'GetbySQL') <object> <cmd> <schema> Returns For commands it returns an XML string format returning the status / error description in the following format <result> <identity> 0 for success, -1 for failure - always included Identity value only included if success on Identity table inserts error description - only included if unsuccessful mandatory name of class / table (omit if msgtype = 'GetbySQL') mandatory for commands (Add, Update, Delete and other class specific commands) optional XML schema for retrieves (element or attribute (default))

Other parameters depend on the XML Request / Command as detailed in their relevant sections.

<error><desc>

For requests for a recordset it returns an XML string formatted according to the <schema> tag. Remarks Any commands or requests supported by any Director class methods will be delegated by this method
2004 CIMNET Inc

www.CimnetInc.com

343

provided the <msgtype> tag is specified and the remaining XML defines the other parameters required by the method to be invoked. The existing XML access methods are still available and there may be a small performance gain by calling them directly (instead of calling via GenericXMLRequest) when using DCOM as the transport. If you wish to convert XML data back into ADO recordsets at the client you must use the default attribute based schema (eg by omitting the <schema> tag or setting it to . This will ensure that ADO can reconstruct all properties and data for the recordset at the client. Stored Procedure(s) Used Various. Examples See Generic methods section for examples ExecuteXMLCmd Method Purpose To execute a class specific command (typically Add, Update, Delete or UpdateSpecific, but could also be any custom method for the class) received in XML format. Delegates to the ExecuteXMLCmd() method of the object as specified in the <object> tag Syntax ExecuteXMLCmd (xmlCmd) Parameters The XML formatted command must be structured as follows: <object> <cmd> <validate> <classname> Returns String in XML format returning the status / error description in the following format <result> <identity> 0 for success, -1 for failure - always included Identity value only included if success on Identity table inserts error description - only included if unsuccessful mandatory name of class / table mandatory command (Add, Update, Delete and other class specific cmds) optional validate flag (default = 1) mandatory class / table name for Adds, Updates and Deletes field names optional for some methods

<fieldname_x>

<error><desc> Remarks

This method reduces dependencies on COM interfaces by maintaining a simple, consistent interface even if the parameters are changed in the future. It is useful for remote commands received via HTTP, which are usually handled by the intermediate Director class. This method only allows single rows to be Added, Updated or Deleted for each call on the method. See the ImportXMLData() method for importing multiple rows of data in a single transaction.
2004 CIMNET Inc

www.CimnetInc.com

344

The Add command must include all the relevant tables fields, except for the Identity field in such tables. The Update command tries to update ALL dependent fields so they MUST all be included as fields in the XML string. If the field value is not included the method may overwrite the database with incorrect data (eg. null) or return a database error if the field has a non-null constraint. The UpdateSpecific() method will only try to update the fields included as parameters. The primary key fields must be included and at least one dependent field (and obviously the mod_id timestamp field if there is one) The Delete command only needs to include the fields that make up the primary key of the table and the timestamp field if there is one. Custom methods are accessed by passing the required parameters as defined for the specific custom method on the object. Stored Procedure(s) Used Various. Examples See Generic methods section for examples

GetRSbyXML Method
Purpose To retrieve a recordset AS an ADODB.recordset object containing ALL fields for the specified class / table from the database, optionally filtered by certain fields passed as parameters. The object / class and all input parameters are encoded in an XML string. Syntax GetRSasXML (xmlRequest string) Parameters The XML formatted request must be structured as follows: <object> <filter> mandatory name of class / table optional Filters for the recordset (default = no filter) optional field value(s) for filter (default = all rows) Optional Max no of rows to return (default = all) (Not implemented yet) Optional Skip number of rows (default = 0) (Not implemented yet)

<fieldname_x> <maxrows> <skiprows> Returns

ADODB.Recordset containing the optionally filtered resultset. The recordset will be disconnected from the database and will be Read Only, Forward Only. The recordsets field names will correspond to the tables column names as defined by the database. Note: As these Stored Procedures may be changed in the future to include additional data or change the order of returned columns, it is best practice to refer to the recordsets fields by name instead of by index when writing client side code to access the fields. Remarks This method delegates to the GetAllByXML() method of the specified object / class. This method reduces dependencies on COM interfaces by maintaining a simple, consistent interface
2004 CIMNET Inc

www.CimnetInc.com

345

even if the parameters are changed in the future. It is useful for remote requests received via HTTP, which are usually handled by the intermediate Director class which then converts the returned recordset into XML format as well. See GetAll() Remarks for other comments that apply to the recordset returned by this method. Also See the GetRSasXML() method which converts this recordset to an XML string before returning it.

GetRSasXML Method
Purpose To retrieve a recordset AS an XML string containing ALL fields for the specified class / table from the database, optionally filtered by certain fields passed as parameters. The object / class and all input parameters are encoded in an XML string. Syntax GetRSasXML (xmlRequest string) Parameters The XML formatted request must be structured as follows: <object> <schema> <filter> Returns XML string representing the optionally filtered resultset. The XML element / field names will correspond to the tables column names as defined by the database. Remarks This method delegates to the GetAllByXML() method of the specified object / class. This method reduces dependencies on COM interfaces by maintaining a simple, consistent interface even if the parameters are changed in the future. It is useful for remote requests received via HTTP, which are usually handled by the intermediate Director class which then converts the returned recordset into XML format as well. See GetAll() Remarks for other comments that apply to the recordset returned by this method. Also See the GetRSbyXML() method which returns the data as an ADODB.recordset object without converting it to an XML string. In cases were the client computers are on the same network as the COM+ server and where they can accommodate the Microsoft ADO libraries you may achieve significant performance gains by returning the data as a recordset object (via DCOM) instead of in XML format. Example This request invokes the GetAll() method of the grp_ent_link class and filters the returned recordset by the specified grp_id. <?xml version="1.0"?> <request> <object>grp_priv_link</object>
2004 CIMNET Inc

mandatory name of class / table optional XML schema for retrieves (element or attribute (default)) optional Filters for the recordset (default = no filter) optional field value(s) for filter (default = all rows)

<fieldname_x>

www.CimnetInc.com

346

<msgtype>getall</msgtype> <schema></schema> <filter> <grp_id>77</grp_id> <priv_id></priv_id> </filter> </request>

GetSpecificRS Method
Purpose To retrieve a specific recordset AS an ADODB.recordset object. This is useful only where a custom method has been implemented in the relevant class that returns a specifc recordset. The object / class and all input parameters are encoded in an XML string. Syntax GetSpecificRS (xmlRequest string) Parameters The XML formatted request must be structured as follows: <object> <cmd> Returns ADODB.Recordset containing the specific recordset. The recordset will be disconnected from the database and will be Read Only, Forward Only. The recordsets field names will correspond to the tables column names as defined by the database. Note: As these Stored Procedures may be changed in the future to include additional data or change the order of returned columns, it is best practice to refer to the recordsets fields by name instead of by index when writing client side code to access the fields. Remarks This method delegates to the GetSpecificRS() method in the relevant class if it is implemented. This requires the method that retrieves the specific RS to be specified in the <cmd> tag of the XML Request. Also See the GetSpecificRSasXML() method which converts this recordset to an XML string before returning it. Example This request invokes the GetUserAccessByEnt() method of the grp_ent_link class and pass ent_id = 1 as a parameter. <?xml version="1.0"?> <request> <object>grp_ent_link</object> <msgtype>getspec</msgtype>
2004 CIMNET Inc

mandatory name of class / table mandatory command (Usually the name of the Specific method to be invoked)

Other parameters depend on the Specific method to be invoked.

www.CimnetInc.com

347

<schema></schema> <cmd>GetUserAccessByEnt</cmd> <ent_id>1</ent_id> </request>

GetSpecificRSasXML Method
Purpose To retrieve a specific recordset in XMLformat. This is useful only where a custom method has been implemented in the relevant class that returns a specific recordset. Delegates to GetSpecificRS() and then converts the recordset to XML in the specified schema. The object / class and all input parameters are encoded in an XML string. Syntax GetSpecificRSasXML (xmlRequest string) Parameters The XML formatted request must be structured as follows: <object> <cmd> <schema> Returns XML formatted recordset containing the specific data requested. Remarks This method delegates to the GetSpecificRS() and then converts the recordset it returns into the specified XML format. This requires the method that retrieves the specific RS to be specified in the <cmd> tag of the XML Request. Also See the GetSpecificRS() method which returns the data as a recordset object. mandatory name of class / table mandatory command (Usually the name of the Specific method to be invoked) optional XML schema for retrieves (element or attribute (default))

Other parameters depend on the Specific method to be invoked.

GetRSbySQL Method
Purpose To retrieve a recordset AS an ADODB.recordset object by specifying the SQL for the retrieve statement. Syntax GetRSbySQL (strSQL string) Parameters The strSQL parameter must be a valid SQL retrieve statement for the IF database. Returns

2004 CIMNET Inc

www.CimnetInc.com

348

ADODB.Recordset containing the resultset. The recordset will be disconnected from the database and will be Static with a BatchOptimistic lock. The recordsets field names will correspond to the tables column names as defined by the database unless the SQL statement includes AS clauses to rename some or all of the columns. Remarks You should use this method only when there is no standard method that can return the same recordset by calling a Stored Procedure as there may be a significant performance hit by submitting an SQL statement instead of using a Stored Procedure. In addition, use of this method builds some dependencies on the database from the client application which is not desirable in n-tier applications. However, in practice it is useful to have a catch all mechanism to use as a last resort.

GetRSbySQLasXML Method
Purpose To retrieve a recordset in XML format by specifying the SQL for the retrieve statement. Syntax GetRSbySQLasXML (xmlRequest string) Parameters The xmlRequest string must be an XML formatted string as detailed in the example below. It must contain the SQL retrieval statement in the <sql> tag. The <schema> tag defaults to attribute (ie. the ADO standard XML representation), the other option being element. The <rowname> tag is used as the parent XML element to separate multiple rows of data. It defaults to "rowdata". Returns XML string containing the resultset. Remarks Delegates to GetRSbySQL() so the same comments apply to this method. Example <?xml version="1.0"?> <request> <msgtype>GetBySQL</msgtype> <sql>Select * from item_prod</sql> <schema></schema> <rowname>item_prod</rowname> </request>

GetShapedRSbySQL Method
Purpose To retrieve a recordset AS an shaped ADODB.recordset object by specifying the SQL for the retrieve statement. Syntax
2004 CIMNET Inc

www.CimnetInc.com

349

GetShapedRSbySQL (strSQL string) Parameters The strSQL parameter must be a valid SQL retrieve statement for the IF database. Returns ADODB.Recordset containing the shaped resultset. The recordset will be disconnected from the database and will be Static with a BatchOptimistic lock. The recordsets field names will correspond to the tables column names as defined by the database unless the SQL statement includes AS clauses to rename some or all of the columns. Remarks You should use this method only when there is no standard method that can return the same recordset by calling a Stored Procedure as there may be a significant performance hit by submitting an SQL statement instead of using a Stored Procedure. In addition, use of this method builds some dependencies on the database from the client application which is not desirable in n-tier applications. However, in practice it is useful to have a catch all mechanism to use as a last resort.

GetShapedRSbySQLasXML Method
Purpose To retrieve a shaped recordset in XML format by specifying the SQL for the retrieve statement. Syntax GetShapedRSbySQLasXML (xmlRequest string) Parameters The xmlRequest string must be an XML formatted string as detailed in the example below. It must contain the SQL retrieval statement in the <sql> tag. The <schema> tag defaults to attribute (ie. the ADO standard XML representation), the other option being element. The <rowname> tag is used as the parent XML element to separate multiple rows of data. It defaults to "rowdata". Returns XML string containing the resultset. Remarks Delegates to GetShapedRSbySQL() so the same comments apply to this method. Example <?xml version="1.0"?> <request> <msgtype>GetShapedRSBySQLasXML</msgtype> <sql>Select * from item_prod</sql> <schema></schema> <rowname>item_prod</rowname> </request>

GetRSFromExtDB Method
2004 CIMNET Inc

www.CimnetInc.com

350

Purpose To retrieve a recordset from an external database Syntax GetRSFromExtDB (connect_string, sql_query) Parameters Part connect_string sql_query Returns ADODB.Recordset. Remarks A connection is established to an external database using the valid connect string specified. If optional SQL Query is passed, then the query is executed in the external database and the resultset is returned. Stored Procedure(s) Used N/a Access via Director.cls using ExecuteXMLCmd() No Access via Director.cls using GetSpecificRS() Yes. The XML request must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>dx_sched </object> <msgtype>getspec</msgtype> <cmd> GetRSFromExtDB </cmd> <connect_string> PROVIDER=SQLOLEDB;SERVER=TSTSRVR;UID=sa;PWD=;DATABASE=TESTDB </connect_string> <sql_query>select * from ent</sql_query> </request> Description Required. By Value. A variant (string) to identify a valid connect string to connect to the database Optional. By Value. A variant (string) to specify the select sql to be executed on the database

GetRSFromExtDBasXML Method
Purpose To retrieve a recordset in XML format by specifying the connect string and SQL for the retrieve statement.
2004 CIMNET Inc

www.CimnetInc.com

351

Syntax GetRSFromExtDBasXML (xmlRequest string) Parameters The xmlRequest string must be an XML formatted string as detailed in the example below. It must contain the SQL retrieval statement in the <sql query> tag and connection string to the external database in <connect_string> tag. The <schema> tag defaults to attribute (ie. the ADO standard XML representation), the other option being element. The <rowname> tag is used as the parent XML element to separate multiple rows of data. It defaults to "rowdata". Returns XML string containing the resultset. Remarks Delegates to GetRSFromExtDB() so the same comments apply to this method. Example <?xml version="1.0"?> <request> <msgtype>GetRSFromExtDBasXML</msgtype> <connect_string> PROVIDER=SQLOLEDB;SERVER=TSTSRVR;UID=sa;PWD=;DATABASE=TESTDB </connect_string> <sql>Select * from item_prod</sql> <schema></schema> <rowname>item_prod</rowname> </request>

RunQuery Method
Purpose To retrieve a recordset using a predefined query saved in the Factelligence database (dx_query table). Syntax RunQuery (xmlRequest string) Parameters The XML request should be formatted as follows:
<?xml version="1.0"?> <request> <session_id>1234</session_id> <query_id>1</query_id> <parameters> <parameter name="param1" value="val1" /> <parameter name="param2" value="val2" /> </parameters> </request>

Returns

2004 CIMNET Inc

www.CimnetInc.com

352

ADODB.Recordset containing the resultset. The recordset will be disconnected from the database and will be Static with a BatchOptimistic lock. The recordsets field names will correspond to the tables column names as defined by the database unless the query renames some or all of the columns. Remarks The predefined query may be predefined SQL, a call to a Stored Procedure, or a call to an existing middleware method that returns a recordset. This method is used by Supply Chain Connector and Manager to retrieve data. Dynamic parameters may be included in the format shown in the example. Note that it is your responsibility to pass the correct type, number and sequence of parameters as is required by the specific query. This call currently delegates to dx_sched.RunQuery() but this functionality will be moved to the Director class in future.

RunQueryasXML Method
Purpose To retrieve a shaped recordset in XML format by specifying the predefined query to run. Delegates to RunQuery() to retrieve the specified recordset. Syntax RunQueryasXML (xmlRequest string) Parameters The xmlRequest string must be an XML formatted string as detailed in the example below. The <schema> tag defaults to attribute (ie. the ADO standard XML representation), the other option being element. The <rowname> tag is used as the parent XML element to separate multiple rows of data and is used only if the schema option is element. (It defaults to "rowdata"). The XML request should be formatted as follows:
<?xml version="1.0"?> <request> <msgtype>Query</msgtype> <schema></schema> <rowname></rowname> <session_id>1234</session_id> <query_id>1</query_id> <parameters> <parameter name="param1" value="val1" /> <parameter name="param2" value="val2" /> </parameters> </request>

Returns XML string containing the resultset. Remarks Delegates to GetShapedRSbySQL() so the same comments apply to this method.

GetRSbySP / GetRSbySPasXML Method (Not implemented yet stub only)

2004 CIMNET Inc

www.CimnetInc.com

353

Purpose To execute a predefined sql or sp passing relevant runtime parameters and return an appropriate recordset. Syntax GetRSbySP (XMLCmd) Parameters Part XMLCmd Returns ADODB.recordset. Remarks The XML formatted command must be structured as follows <sp> Include Stored Procedure name if <cmd> = SP <sp_parameters> Include Stored Procedure parameter details if <cmd> = SP <name> parameter name, eg ent_id Each name element may have the following attributes: datatype Data type for parameter according to ADO Datatype enums, eg long = 20, varchar = 200, boolean = 11, datetime = 133, double = 5 direction Parameter direction based on ADO ParameterDirection enums, eg input = 1 size Number of bytes or characters reserved for the parameter: 4 for longs, max string length for varchars, 1 for Booleans, 8 for datetimes. value Value to be applied for this parameter represented as a string. (Not required for output parameters) Include a <name> element for all SP parameters in the correct sequence </sp_parameters> Stored Procedure(s) Used N/A Access via Director.cls Yes. The XML input parameter must be formatted to include the required method parameters as follows: <?xml version="1.0"?> <request> <object>director</object> <cmd>GetRS</cmd> <msgtype>exec</msgtype> <test_query> <query_type>SQL</query_type> <sql>select * from ent where ent_id = 1211</sql> </test_query>
2004 CIMNET Inc

Description Required. By Value. An XML formatted string

www.CimnetInc.com

354

</request> <?xml version="1.0"?> <request> <object>director</object> <cmd>GetRS</cmd> <msgtype>getspec</msgtype> <test_query> <query_type>SP</query_type> <sp>CustomSPName</sp> <sp_parameters> <parameter name=ent_id datatype=20 direction=1 size=4 value=123/> name=tree_icon datatype=200 direction=1 size=254 value=new.ico/> </sp_parameters> </test_query> </request>

<parameter

GetClientNTUser Method
Purpose Returns ComputerName\UserID of the original client caller IF running under COM+. Syntax GetClientNTUser () Parameters None Returns String Remarks Returns the original NT callers user_id. This is useful to know as Database Connection strings etc may be overridden for certain users. Also See SetUserConnStr() method

SetUserConnStr Method
Purpose Saves a new Database Connection string for the current user (ie. The user that made this method call) to the IF.INI file (maybe in registry later ?). This will override the global connection string setting IF the AllowMultiDBConn=1 flag is set in the IF.INI file. Syntax SetUserConnStr (ConnStr) Parameters

2004 CIMNET Inc

www.CimnetInc.com

355

Part ConnStr

Description Required. By Value. A string to identify the database connection string to be saved for this user.

Returns Integer. 0 if successful, else -1 Remarks Note there is significant overhead in using the AllowMultiDBConn option as every method call on the middle tier results in a check to see if the default database connection string must be overridden or not. Wherever possible try to set up a different COM+ application for each separate database that you may be deploying, and use a global connection string without the AllowMultiDBConn option.

DirectorTrans Class
(Renamed this class as it complements Director but just provides a parent database transaction.) Summary of the methods supported by this class:
STANDARD METHODS ExecuteXMLCmd() COMMENTS Delegated to by Director. ExecuteXMLCmd() when the <object> tag = Custom or DirectorTrans. Used to execute a custom SQL or Stored procedure that affects the database and so needs to be executed within a database transaction. Returns an XML formatted response. Stub Only. (Not implemented yet). To execute a batch of XML formatted commands for any combination of classes or tables within a single parent transaction.

ExecuteBatchXMLCmds()

ExecuteXMLCmd Method Purpose To execute a custom SQL command or a set of SQL commands or Stored Procedure in the Factelligence database. This is typically used for custom functionality that updates the database and so requires a database transaction. The SQL command is specified in XML format as described below and may take the form of a specific SQL statement or a Stored Procedure call with specified parameters. Syntax ExecuteXMLCmd (xmlCmd) Parameters The XML formatted command must be structured as follows: <object> <msgtype> <cmd> Custom Exec SQL or SP

<sql> Include SQL statement if <cmd> = SQL <sp> Include Stored Procedure name if <cmd> = SP <sp_parameters> Include Stored Procedure parameter details if <cmd> = SP
2004 CIMNET Inc

www.CimnetInc.com

356

<name>

parameter name, eg ent_id

Each name element may have the following attributes: datatype Data type for parameter according to ADO Datatype enums, eg long = 20, varchar = 200, boolean = 11, datetime = 133, double = direction Parameter direction based on ADO ParameterDirection enums, eg input = 1, output = 2, inputoutput = 3 size Number of bytes or characters reserved for the parameter: 4 for longs, max string length for varchars, 1 for Booleans, 8 for datetimes. value Value to be applied for this parameter represented as a string. (Not required for output parameters) Include a <name> element for all SP parameters in the correct sequence </sp_parameters> Returns String in XML format returning the result, number of rows affected, data for any output parameters and any error details as specified below. <?xml version="1.0"?> <response> <result>-1</result> <rows_affected>0</rows_affected>

0 for success, -1 for failure Number of rows affected by transaction (Note successful transactions executed by SPs may return 0 rows affected even on success eg. when its 1 st SQL command affects 0 rows) <output param name>xyz</output param name> For any output parameters if executed successfully. <error> Only included if result = -1 <desc>Command not handled</desc> <number>445</number> Included if available <source>Custom.custom</desc> Included if relevant </error> </response> The error details may be generated when throwing an error from the stored procedure or by the standard VB error handler. Remarks This method is accessible via the standard GenericXMLRequest() and ExecuteXMLCmd() methods in the Director class. The <object> element containing the value Custom will cause the execution of the method to be delegated to this method in this class. This method allows integrators or end users to use the Factelligence infrastructure to access custom stored procedures or execute SQL statements that update the database. The command is executed within the scope of a database transaction. A set of sql statements can be executed at a single parent transaction. An attribute must_find can be set to true for the <sql> element to force the transaction to find the matching row for updates. If this property is set and if any row is not found in the database for updates, then it raises an error and rolls back all the transaction in the transaction list.
2004 CIMNET Inc

www.CimnetInc.com

357

If a stored procedure is executed, and if the stored procedure returns some value using Return statement, then the return_value parameter must be supplied as the first parameter in the sp parameter list. Examples <?xml version="1.0"?> <request> <object>custom</object> <msgtype>Exec</msgtype> <cmd>sql</cmd> <session_id>111</session_id> <sql>Update ent SET x = y Where ent_id = 122</sql> <sql must_find = 1>Update ent Set ent_name = test ent Where ent_id = 1221</sql> <sql>Insert into ent_attr (ent_id, attr_id, attr_value) values (123, 1001, test)</sql> <sql>Delete from ent_attr Where ent_id = 123 and attr_id = 1001</sql> </request> <?xml version="1.0"?> <request> <object>custom</object> <msgtype>Exec</msgtype> <cmd>sql</cmd> <session_id>111</session_id> <sp>CustomSPName</sp> <sp_parameters> <parameter name =return_value datatype = 3 direction=4> <parameter name=ent_id datatype=20 direction=1 size=4 value=123/> <parameter name=tree_icon datatype=200 direction=1 size=254 value=new.ico/> </sp_parameters> </request>

ExecuteBatchXMLCmds Method
Purpose To execute a batch of XML formatted commands for any combination of middleware classes / methods within a single parent transaction. If any single command fails the entire transaction will be aborted. Syntax ExecuteBatchXMLCmds (xmlCommand) Parameters The XML formatted command must be structured as follows: <transaction> literal tag to mark start of transaction literal tag to mark start of one action on one class ..Contents are exact XML format for a single XML command
2004 CIMNET Inc

<request>

www.CimnetInc.com

358

</request> <request> </request> </transaction> Returns

literal tag to mark end of one action on one class additional request(s) within the same transaction

..Contents are exact XML format for a single XML command literal tag to mark end of transaction

String in XML format returning the status / error description in the following format <result> 0 for success, -1 for failure - always included

<error><desc> error description - only included if transaction unsuccessful <identity> included only if entire transaction successful for each Identity table insert (as many as there are) For eg: <?xml version="1.0"?> <response> <result>0</result> -- stating all transactions are successfully executed <add> -- result from the first command <result>0</result> <identity>1895</identity> </add> <add> -- result from the second command <result>0</result> <identity>1896</identity> </add> <GetAuditEnabled> -- result from the third command <result>0</result> <audit_enabled>1</audit_enabled> </GetAuditEnabled> <GetDisplaySeq> -- result from the fourth command <result>0</result> <display_seq>5</display_seq> </GetDisplaySeq> <ChangeSpecValue> -- result from the fifth command <result>0</result> </ChangeSpecValue> </response> If error; for eg., <?xml version="1.0"?> <response> <result>-1</result> <error> <desc>GenericXMLRequest Error - FIBR20.Director.ExecBatchXMLCmds Error. FIBR20.Custom.ExecuteBatchXMLCmds Error. An error occurred in Ent.Add. Violation of UNIQUE KEY constraint 'IX_ent'. Cannot insert duplicate key
2004 CIMNET Inc

www.CimnetInc.com

359

in object 'ent'. </desc> </error> </response> Remarks While this method is exposed via the the DirectorTrans class, it is implemented by dividing up the transaction into individual requests and passing each along to the appropriate ExecuteXMLCmd methods in the normal data access classes. It acts like a series of calls to ExecuteXMLCmd in the Director class, the only difference being that they are all executed within a single database transaction. This means that every request must contain all the XML data required for its command, even if this means that certain parameters such as session_id are repeated for each contained request. Stored Procedure(s) Used None directly, but the various commands may end up invoking any defined stored procedures. Example This command will insert 2 new entities, checks whether audit trail is enabled on job_spec, gets the next display seq for a given job and finally changes the spec value for a running job in an entity <?xml version="1.0"?> <transaction> <object>custom</object> <cmd>ExecuteBatchXMLCmds</cmd> <msgtype>execbatch</msgtype> <request> <object>ent</object> <cmd>add</cmd> <msgtype>exec</msgtype> <ent> <session_id>12312</session_id> <ent_name>Machine3</ent_name> <description>Machine3</description> <hourly_cost>1</hourly_cost> <can_sched_jobs>0</can_sched_jobs> <can_log_data>1</can_log_data> </ent> </request> <request> <object>ent</object> <cmd>add</cmd> <msgtype>exec</msgtype> <ent> <session_id>12312</session_id> <ent_name>Machine4</ent_name> <description>Machine4</description>
2004 CIMNET Inc

www.CimnetInc.com

360

<hourly_cost>1</hourly_cost> <can_sched_jobs>0</can_sched_jobs> <can_log_data>1</can_log_data> </ent> </request> <request> <object>job_spec</object> <cmd>GetAuditEnabled</cmd> <msgtype>exec</msgtype> <session_id>25071</session_id> </request> <request> <object>job</object> <cmd>GetDisplaySeq</cmd> <msgtype>exec</msgtype> <session_id>25071</session_id> <wo_id>AJR2</wo_id> <oper_id></oper_id> </request> <request> <object>job_exec</object> <cmd>ChangeSpecValue</cmd> <msgtype>exec</msgtype> <session_id>12312</session_id> <user_id>raghu</user_id> <ent_id>1212</ent_id> <spec_id>Actual Speed</spec_id> <new_spec_value>275</new_spec_value> <update_template>0</update_template> </request> </transaction>

Other Issues
Data Types
This document defines all Data Types in VB format. The mappings to SQL Server 2000, Oracle and C++ (?) Data Types are defined in the following table. Long = 32 bit integer which corresponds to integer in SQL Server 2000 and Oracle (?)

Error Handling
The Business Rules Layer throws exceptions back to the client when it encounters errors that it cannot handle itself. These exceptions contain an error number and an associated error
2004 CIMNET Inc

www.CimnetInc.com

361

description as defined in the table below. ' Constants for error numbers Public Const errRowNotFound = 10001 Public Const errXMLData = 10002 Public Const errUserHook = 10003 Public Const errXMLFormat = 10004 Public Const errXMLBadCmd = 10005 Public Const errInvalidData = 10006 Public Const errInsertFail = 10007 Public Const errAuthent = 10008 ' Constants for error descriptions - make language specific later Public Const errRowNotFoundDesc = "The specified row was not found in the database" Public Const errRowNotFoundOrModifiedDesc = "The specified row was not found in the database, or it has been modified by someone else since you retrieved it" Public Const errXMLDataNoFieldsDesc = "No field data included in XML string" Public Const errXMLDataNoRowsDesc = "No row elements defined with required name" Public Const errUserHookPreExecDesc = "User Hook Error: " Public Const errXMLBadCmdDesc = "Unsupported Command : " Public Const errXMLFormatDesc = "XML Format Error : " Public Const errInsetFailDesc = "The row was not added to the database" Note that errors may also be generated by COM / DCOM. These are usually generated before our Business Rules objects are accessed. For all XML access to the middleware the exceptions are converted to XML responses before being retirned to the client. The format of XML responses to commands is as follows: <?xml version="1.0"?> <response> <result>-1</result> <identity>123</identity> <mod_id>01 Jan 1900 00:14:20:010</mod_id> <error> <desc>Command not handled - ADDG</desc> <number>445</number> Included if <source>Attr.Add</desc> Included if </error> </response>

Included when adding to Identity table Included if changed mod_id field Only included if result <> 0 available relevant

2004 CIMNET Inc

www.CimnetInc.com

362

You might also like