445
Factelligence Middleware User Manual V2.1 2004 CIMNET Inc www.CimnetInc.com 1

FactelligenceMiddleware

Embed Size (px)

Citation preview

Page 1: FactelligenceMiddleware

Factelligence

Middleware

User Manual

V2.1

Last updated on December 6, 2004

2004 CIMNET Inc www.CimnetInc.com 1

Page 2: FactelligenceMiddleware

Introduction...........................................................................................................................12

Pre-requisites for Access to the Middleware............................................................................13

Session and Login Handling......................................................................................................13

Standard Data Access Methods................................................................................15Add Method..............................................................................................................................15Update Method..........................................................................................................................16UpdateSpecific Method.............................................................................................................17Delete Method...........................................................................................................................18DeleteAll Method......................................................................................................................18GetAll Method..........................................................................................................................19GetByKey Method....................................................................................................................20GetAllbyXML Method..............................................................................................................21GetSpecificRS Method..............................................................................................................22ExecuteXMLCmd Method........................................................................................................23IsValid Method.........................................................................................................................25

Core DLL Enhanced Methods...................................................................................27

Session Class................................................................................................................................27StartSession Method.................................................................................................................28StartBGSession Method............................................................................................................30EndSession Method...................................................................................................................32LogIn Method............................................................................................................................33RefreshHeartbeat Method.........................................................................................................35SwitchUser Method...................................................................................................................36LogOnEnt Method.....................................................................................................................37LogOnEntList Method..............................................................................................................39SaveEntList Method..................................................................................................................41LogOff Method.........................................................................................................................42KillStaleSessions Method.........................................................................................................44GetSpecificRS Method..............................................................................................................45GetModulesLicensed Method...................................................................................................46SwitchSession Method..............................................................................................................47DoMinutelyTasks Method........................................................................................................49DoAutoShiftChanges Method...................................................................................................50DoHourlyTasks Method............................................................................................................50DoDailyTasks Method..............................................................................................................51GetServerTime Method.............................................................................................................52SetMwDbUser Method..............................................................................................................52GetVerInfo Method...................................................................................................................53ValidPw Method.......................................................................................................................54

Ent Class......................................................................................................................................55GetAll_TopLevel Method.........................................................................................................56

2004 CIMNET Inc www.CimnetInc.com 2

Page 3: FactelligenceMiddleware

Add Method..............................................................................................................................57Delete Method...........................................................................................................................59StartShift Method......................................................................................................................60GetStatusInfo Method...............................................................................................................61GetStatusInfoByUser Method...................................................................................................62Clone Method............................................................................................................................62RefreshShiftSched Method.......................................................................................................65DoAutoShiftChanges Method...................................................................................................67GetShiftSched Method..............................................................................................................68GetAvailShiftTime Method......................................................................................................69GetAvailEndTime Method........................................................................................................69GetRefreshedShiftSched Method..............................................................................................70

Ent_Link Class............................................................................................................................72

Attr Class.....................................................................................................................................72

Attr_Set Class..............................................................................................................................73

Ent_Attr Class.............................................................................................................................73

System_Attr Class.......................................................................................................................74

System_Attr_Grp Class..............................................................................................................74

Language_Grp Class..................................................................................................................74

Language Class...........................................................................................................................75NextFreeLangID Method..........................................................................................................75Clone Method............................................................................................................................76DeleteByLang Method..............................................................................................................76

Error_Log Class..........................................................................................................................77

Audit_Trail Class........................................................................................................................77

Grp_Name Class.........................................................................................................................78

User_Name Class.........................................................................................................................78AddOrUpdate Method...............................................................................................................79ChangePassword Method..........................................................................................................80

User_Grp_Link Class.................................................................................................................81

Priv Class.....................................................................................................................................82

Grp_Priv_Link Class..................................................................................................................82GetPrivilegesByUser Method...................................................................................................83GetUsersByPrivilege Method...................................................................................................83GetPriv Method.........................................................................................................................84

Grp_Ent_Link Class...................................................................................................................85CanAccess Method....................................................................................................................86GetEntAccessByUser Method...................................................................................................86GetUserAccessByEnt Method...................................................................................................87

2004 CIMNET Inc www.CimnetInc.com 3

Page 4: FactelligenceMiddleware

GetGrpAccessByEnt Method....................................................................................................88

Shift Class....................................................................................................................................89

Shift_Sched Class........................................................................................................................89

Shift_Exc Class............................................................................................................................90GetExceptions Method..............................................................................................................90

Shift_To_Go Class......................................................................................................................91

Message Class..............................................................................................................................91

Mail_Grp Class...........................................................................................................................92

Mail_Grp_Member Class...........................................................................................................92

Emailatt Class.............................................................................................................................93

Pred_Msg Class...........................................................................................................................93

UI_Config Class..........................................................................................................................94SaveSectionParams Method......................................................................................................94

UI_Config_Default Class............................................................................................................95SaveSectionParams Method......................................................................................................96

UI_Button Class..........................................................................................................................97

UI_Button_Set Class...................................................................................................................97

Mgr_Data_Config Class.............................................................................................................98

Graphic Class..............................................................................................................................98UpdateImage Method................................................................................................................99

Tool Class...................................................................................................................................100

Doc_Type Class.........................................................................................................................100

File_Type Class.........................................................................................................................101

File_Desc Class..........................................................................................................................101

Dir Class.....................................................................................................................................102Add Method............................................................................................................................102Delete Method.........................................................................................................................103ChangeSeq Method.................................................................................................................104ReSeq Method.........................................................................................................................104

Prod DLL Enhanced Methods.................................................................................106

Item_State Class........................................................................................................................106

Item_Grade Class......................................................................................................................106

Item_Class Class.......................................................................................................................106

Item_Class_Attr Class..............................................................................................................107

2004 CIMNET Inc www.CimnetInc.com 4

Page 5: FactelligenceMiddleware

Item Class..................................................................................................................................107

Item_Attr Class.........................................................................................................................108

Uom Class..................................................................................................................................108

Uom_Conv Class.......................................................................................................................109

Item_Reas_Grp Class...............................................................................................................109

Item_Reas_Grp_Class_Link Class..........................................................................................110

Item_Reas_Grp_Ent_Link Class.............................................................................................110GetReasons Method................................................................................................................110

Item_Reas Class........................................................................................................................111

Job_Exec Class..........................................................................................................................112GetQueue Method...................................................................................................................114StartJob Method......................................................................................................................115EndJob Method.......................................................................................................................117PauseJob Method....................................................................................................................119SplitJob Method......................................................................................................................121CloneJob Method....................................................................................................................123CreateWOfromProcess Method...............................................................................................125CloneWO Method...................................................................................................................127SetCurLotData Method...........................................................................................................129AddProd Method.....................................................................................................................131AddProdPostExec Method......................................................................................................134AddCons Method....................................................................................................................136AddConsPostExec Method.....................................................................................................139RejectProd Method..................................................................................................................141VerifyProcess Method.............................................................................................................143StartStep Method.....................................................................................................................144StopStep Method.....................................................................................................................145UpdateStepData Method.........................................................................................................147StepLogin Method...................................................................................................................148StepLogout Method.................................................................................................................150CertStartAllowed Method.......................................................................................................151CertSignoffAllowed Method...................................................................................................152CertSignoffReqd Method........................................................................................................154CertSignoffDone Method........................................................................................................154CertSignoff Method................................................................................................................156DownloadSpecs Method..........................................................................................................158SetActualSpecValue Method..................................................................................................159SetUIScreenTagValues Method..............................................................................................160SetAttr Method........................................................................................................................163ChangeWOPriority Method....................................................................................................164ChangeWOReqFinishTime Method........................................................................................165ChangeWOQtys Method.........................................................................................................166

2004 CIMNET Inc www.CimnetInc.com 5

Page 6: FactelligenceMiddleware

StartNextJobViaFC Method....................................................................................................167ChangeSpecValue Method......................................................................................................168GetSchedulableEntities Method..............................................................................................170GetReqdCertSignoffs Method.................................................................................................171GetStepBOMData Method......................................................................................................172LogJobEvent Method..............................................................................................................173GetJobBOMStepQuantities Method.......................................................................................175ChangeSpecValues Method....................................................................................................176UpdateTemplateSpecValues Method......................................................................................178GetRunnableEntities Method..................................................................................................180GetSchedulableEntity Method................................................................................................180GetSchedulableParents Method..............................................................................................181GetJobQueue Method..............................................................................................................182StartDataEntryJob Method......................................................................................................182AddConsDirect Method..........................................................................................................184

Job_Event Class........................................................................................................................187

Job_Sched_Exec Class..............................................................................................................187ApplySchedule Method...........................................................................................................188RefreshTempShiftExc Method................................................................................................191DropTempShiftExc Method....................................................................................................192CreateWOAltInfo Method.......................................................................................................193CreateWOJobs Method...........................................................................................................193DropWOAltInfo Method.........................................................................................................193

Job_State Class.........................................................................................................................193

WO Class...................................................................................................................................194

Wo_Attr Class...........................................................................................................................194

Job Class....................................................................................................................................195GetCanLogDataCapability Method.........................................................................................195GetDisplaySeq Method...........................................................................................................196GetNextSeqNo Method...........................................................................................................197

Job_Attr Class...........................................................................................................................198

Job_Route Class........................................................................................................................199GetJobPath Method.................................................................................................................199GetJobRoute Method..............................................................................................................200

Item_Prod Class........................................................................................................................201Split Method............................................................................................................................201

Process_Class Class..................................................................................................................204

Process Class..............................................................................................................................205Clone Method..........................................................................................................................206CheckIn Method......................................................................................................................207CheckOut Method...................................................................................................................208

2004 CIMNET Inc www.CimnetInc.com 6

Page 7: FactelligenceMiddleware

GetNextVerId Method.............................................................................................................209GetItemProdAtOper Method...................................................................................................209GetProducedItems Method......................................................................................................210

Process_Attr Class....................................................................................................................211

Item_Process_Link Class.........................................................................................................212GetNextItemPref Method........................................................................................................212

Oper Class..................................................................................................................................213

Oper_Attr Class........................................................................................................................213

Oper_Ent_Link Class...............................................................................................................214GetCanLogDataCapability Method.........................................................................................215

Oper_Ent_Route Class.............................................................................................................216

Oper_Ent_Item_Link Class.....................................................................................................216

OEE_Exec Class........................................................................................................................216

TPM_Stat Class.........................................................................................................................217

Lot_Attr Class...........................................................................................................................217

EnProd DLL Enhanced Methods..........................................................................219

BOM_Ver Class.........................................................................................................................219Clone Method..........................................................................................................................219Copy Method...........................................................................................................................220

BOM_Item Class.......................................................................................................................222

BOM_Item_Oper_Link Class..................................................................................................222ChangeProducedItem Method.................................................................................................223GetBomOperInfo Method.......................................................................................................224

Job_BOM Class.........................................................................................................................225GetJobBomData Method.........................................................................................................226

Item_Cons Class........................................................................................................................227Split Method............................................................................................................................227

Item_Subst Class.......................................................................................................................230

Bom_Item_Subst Class.............................................................................................................231

Job_Bom_Subst Class...............................................................................................................231

Oper_Step_Grp Class...............................................................................................................232

Oper_Step Class........................................................................................................................232

Oper_Step_File Class................................................................................................................233

Oper_Step_Ent_Exc Class.......................................................................................................233

BOM_Item_Oper_Step_Link Class........................................................................................233

2004 CIMNET Inc www.CimnetInc.com 7

Page 8: FactelligenceMiddleware

GetBomOperStepInfo Method................................................................................................234

Job_Step_Grp Class..................................................................................................................235

Job_Step Class...........................................................................................................................235

Job_Step_File Class..................................................................................................................236

Job_BOM_Step Class...............................................................................................................236

Job_Step_Data Class................................................................................................................237

Spec Class..................................................................................................................................237

Oper_Spec_Ver Class...............................................................................................................238

Oper_Ent_Spec Class...............................................................................................................238GetSpecs Method....................................................................................................................239GetItemEntSpecs Method.......................................................................................................240

BOM_Item_Oper_Spec Class..................................................................................................241GetSpecs Method....................................................................................................................241

Job_Spec Class..........................................................................................................................243GetJobSpecs Method...............................................................................................................243

Storage_Exec Class...................................................................................................................244AddInv Method.......................................................................................................................245ReduceInv Method..................................................................................................................247Transfer Method......................................................................................................................248Split Method............................................................................................................................250TransferAndUpdateInv............................................................................................................251GetShortages Method..............................................................................................................254GetInventory Method..............................................................................................................255

Item_Inv Class...........................................................................................................................256

Item_Transfer Class.................................................................................................................257

Item_Storage_Exec_Link Class...............................................................................................258

Transfer_List Class...................................................................................................................258

Data_Log_Grp Class.................................................................................................................258Clone Method..........................................................................................................................259SaveSample Method................................................................................................................260GetEntGroups Method............................................................................................................261CheckDataLogGrpValExists Method......................................................................................262

Data_Log_Value Class..............................................................................................................263

Data_Log_16 and Data_Log_48 Classes.................................................................................263

Res Class....................................................................................................................................264

Res_Exc Class............................................................................................................................264

Res_Oper_Link Class...............................................................................................................265

2004 CIMNET Inc www.CimnetInc.com 8

Page 9: FactelligenceMiddleware

Res_Job_Link Class..................................................................................................................265

DNC DLL Enhanced Methods................................................................................266

Folder Class...............................................................................................................................266SetPreferredVer Method.........................................................................................................266Clone Method..........................................................................................................................267

Folder_File Class.......................................................................................................................269

Folder_Item_Oper_Ent_Link Class........................................................................................270

Folder_Distr Class....................................................................................................................270

WO_File Class...........................................................................................................................271

Item_File Class..........................................................................................................................271

DNC_Exec Class........................................................................................................................272GetProtocols Method..............................................................................................................272

Hub Class...................................................................................................................................273

Hub_Dev Class..........................................................................................................................273

Defcon Class..............................................................................................................................274

DNC_Log Class.........................................................................................................................274EndLogEntry Method..............................................................................................................275

UTIL DLL Enhanced Methods...............................................................................275

Util_Exec Class..........................................................................................................................276SetReason Method..................................................................................................................276SetRawReason Method...........................................................................................................278SetPendingReason Method.....................................................................................................279GetAvailableReasons Method.................................................................................................280GetOldAvailableReasons Method...........................................................................................281UpdateDurations Method........................................................................................................282GetStatusInfoByUser Method.................................................................................................283

Util_State Class.........................................................................................................................284

Util_Reas_Grp Class.................................................................................................................284

Util_Reas Class..........................................................................................................................285

Util_Reas_Link Class...............................................................................................................285

Util_Raw_Reas Class................................................................................................................286

Util_Log Class...........................................................................................................................286GetAllByPeriod Method.........................................................................................................287Split Method............................................................................................................................288AdjustDuration Method..........................................................................................................290

LABOR DLL Enhanced Methods.........................................................................292

2004 CIMNET Inc www.CimnetInc.com 9

Page 10: FactelligenceMiddleware

Labor_Exec Class......................................................................................................................292GetAvailableLabCodes Method..............................................................................................292AddLabor Method...................................................................................................................293SetLabData Method.................................................................................................................296UpdateDuration Method..........................................................................................................297GetStatusInfoByUser Method.................................................................................................298SetRawReason Method...........................................................................................................299

Labor_Cat Class........................................................................................................................300

Labor_Dept Class......................................................................................................................300

Labor_Reas_Link Class...........................................................................................................301

Labor_Raw_Reas Class............................................................................................................301

Labor_Usage Class....................................................................................................................302

CERT DLL Enhanced Methods.............................................................................303

Cert_Type Class........................................................................................................................303

Cert_User_Link Class...............................................................................................................303

Cert_Item_Link Class...............................................................................................................304

Cert_Oper_Link Class..............................................................................................................304

Cert_Oper_Step_Link Class....................................................................................................304

Cert_Attr_Link Class...............................................................................................................305

Cert_Audit_Log Class..............................................................................................................305

CUST DLL Enhanced Methods..............................................................................307

Cust Class..................................................................................................................................307GetAllByFilter Method...........................................................................................................307

Cust_Contact Class...................................................................................................................308

SO Class.....................................................................................................................................308

So_Line Class............................................................................................................................309GetNextSoLineNo Method......................................................................................................309GetAllByFilter Method...........................................................................................................310

So_Wo_Link Class....................................................................................................................311

Shipment Class..........................................................................................................................312

Shipment_Lot Class..................................................................................................................312GetQtyShipped Method..........................................................................................................313GetLotNos Method..................................................................................................................314GetMaxToShip Method...........................................................................................................315Ship Method............................................................................................................................316

Vendor_Item_Link Class.........................................................................................................317

2004 CIMNET Inc www.CimnetInc.com 10

Page 11: FactelligenceMiddleware

PO Class.....................................................................................................................................318

Po_Line Class............................................................................................................................318

Receipt Class..............................................................................................................................319

Receipt_Lot Class......................................................................................................................319

DX DLL Enhanced Methods....................................................................................320

Dx_Sched Class.........................................................................................................................320SetDataType Method...............................................................................................................321RunQuery Method...................................................................................................................322Clone Method (Not Implemented yet)....................................................................................323TestQuery Method...................................................................................................................324GetImportFieldMappings Method..........................................................................................326

Dx_Field Class...........................................................................................................................326

Dx_Map_Imp Class...................................................................................................................327GetDistinctMappings Method.................................................................................................327

Dx_Map_Exp Class...................................................................................................................328GetDistinctMappings Method.................................................................................................328

Dx_Query Class.........................................................................................................................329

Dx_Query_Param Class...........................................................................................................330

Dx_Queue Class........................................................................................................................330

Dx_Log Class.............................................................................................................................330

FC DLL Enhanced Methods.....................................................................................332

FC_Namesp_Node Class...........................................................................................................332Clone Method..........................................................................................................................332

FC_Namesp_Tag Class.............................................................................................................333GetChangesAndReset Method................................................................................................333

FC_Bridge Class........................................................................................................................334

Form DLL Enhanced Methods...............................................................................335

Form Class.................................................................................................................................335

Script Class................................................................................................................................335DeleteByName Method...........................................................................................................336UpdateByName Method..........................................................................................................337SaveFormScript Method.........................................................................................................338

Form_Script_Link Class..........................................................................................................340

SPC DLL Enhanced Methods..................................................................................340

SPC_Char Class........................................................................................................................340

2004 CIMNET Inc www.CimnetInc.com 11

Page 12: FactelligenceMiddleware

SPC_Item_Char_Link Class....................................................................................................341

SPC_Char_Oper_Link Class...................................................................................................341

SPC_Char_Job Class................................................................................................................342

SPC_Event Class.......................................................................................................................342

SPC_Sample Class....................................................................................................................343

SPC_Stats Class........................................................................................................................343

Gage_Config Class....................................................................................................................344

The Director Class...........................................................................................................345

Trap when dealing with XML strings.....................................................................................346

Method Delegation Hierarchy..................................................................................................346GenericXMLRequest Method.....................................................................................................348ExecuteXMLCmd Method.........................................................................................................349GetRSbyXML Method............................................................................................................350GetRSasXML Method.............................................................................................................351GetSpecificRS Method............................................................................................................352GetSpecificRSasXML Method................................................................................................353GetRSbySQL Method.............................................................................................................353GetRSbySQLasXML Method.................................................................................................354GetShapedRSbySQL Method..................................................................................................354GetShapedRSbySQLasXML Method......................................................................................355GetRSFromExtDB Method.....................................................................................................356GetRSFromExtDBasXML Method.........................................................................................357RunQuery Method...................................................................................................................357RunQueryasXML Method.......................................................................................................358GetRSbySP / GetRSbySPasXML Method (Not implemented yet – stub only)....................359GetClientNTUser Method.......................................................................................................360SetUserConnStr Method.........................................................................................................360

DirectorTrans Class..................................................................................................................361ExecuteXMLCmd Method.........................................................................................................361ExecuteBatchXMLCmds Method...........................................................................................363

Other Issues..........................................................................................................................366

Data Types.................................................................................................................................367

Error Handling.........................................................................................................................367

Introduction

2004 CIMNET Inc www.CimnetInc.com 12

Page 13: FactelligenceMiddleware

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.

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 Microsoft’s Active Server Pages (ASP)

The session ID’s 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

2004 CIMNET Inc www.CimnetInc.com 13

Page 14: FactelligenceMiddleware

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.

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 user’s 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 window’s user ID’s 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

Page 15: FactelligenceMiddleware

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 DLL’s).

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 Description

Session_id Required. By Value. A long to identify the session (and thus

the user) making the call.

Primary Key

Fields

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.

Non-nullable

Dependent Fields

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.

Nullable

Dependent Fields

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.

PerformValidation 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.

Returns

2004 CIMNET Inc www.CimnetInc.com 15

Page 16: FactelligenceMiddleware

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 Description

Session_id Required. By Value. A long to identify the session (and thus

the user) making the call.

Primary Key

Fields

Required. By Value. A Variant mapping to the relevant table /

column data type.

Non-nullable

Dependent Fields

Required. By Value. A Variant mapping to the relevant table /

column data type.

Nullable

Dependent Fields

Required. By Value. A Variant mapping to the relevant table /

column data type.

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.

2004 CIMNET Inc www.CimnetInc.com 16

Page 17: FactelligenceMiddleware

Remarks

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 Description

Session_id Required. By Value. A long to identify the session (and thus

the user) making the call.

Primary Key

FieldsRequired. By Value. A Variant mapping to the relevant table /

column data type.

Dependent Fields Optional. By Value. A Variant mapping to the relevant table /

column data type.

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

2004 CIMNET Inc www.CimnetInc.com 17

Page 18: FactelligenceMiddleware

significantly less than the standard Update() method, so only use this method when you cannot update all dependent fields in the table.

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 Description

Session_id Required. By Value. A long to identify the session (and thus

the user) making the call.

Primary Key

FieldsRequired. By Value. A Variant mapping to the relevant table /

column data type.

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

2004 CIMNET Inc www.CimnetInc.com 18

Page 19: FactelligenceMiddleware

DeleteAll (Partial List of all primary key fields only)

Parameters

Part Description

Session_id Required. By Value. A long to identify the session (and thus

the user) making the call.

Primary Key

Fields

Optional. By Value. A Variant mapping to the relevant table /

column data type.

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 Description

Primary Key

Fields

Optional. By Value. A Variant mapping to the relevant table /

column data type by which to filter the returned data

Dependent Fields Optional. By Value. A Variant mapping to the relevant table /

column data type by which to filter the returned data.

Returns

2004 CIMNET Inc www.CimnetInc.com 19

Page 20: FactelligenceMiddleware

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 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 recordset’s 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 recordset’s 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 AND’s 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 Description

Primary Key

Fields

Required. By Value. Data type of the relevant table / column

data type to identify the row for which we want to retrieve

data.

2004 CIMNET Inc www.CimnetInc.com 20

Page 21: FactelligenceMiddleware

Dependent Fields 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.

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> mandatory name of class / table

<filter> optional Filters for the recordset (default = no filter)

<fieldname_x> optional field value(s) for filter (default = all rows)

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 recordset’s 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 recordset’s fields by name instead of by index when writing client side code to access the fields.

Remarks

2004 CIMNET Inc www.CimnetInc.com 21

Page 22: FactelligenceMiddleware

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.

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 Description

cmd Required. By Value. A string which is class dependent –

usually the name of the custom method to use

XMLRequest Required. By Value. Dependent on the specific method to be

invoked. Details defined in each Custom method’s reference.

Returns

2004 CIMNET Inc www.CimnetInc.com 22

Page 23: FactelligenceMiddleware

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 recordset’s 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 recordset’s 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.

Stored Procedure(s) Used

Usually sp_SA_xxxxxx where xxxxxx is the class name and some way of identifying the SP’s 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 class’s 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> mandatory name of class / table

<cmd> mandatory command (Add, Update, Delete and other class specific cmds)

<validate> optional validate flag (default = 1)

<classname> mandatory class / table name

<fieldname_x> field names – optional for some methods

Returns

String in XML format returning the status / error description in the following format

2004 CIMNET Inc www.CimnetInc.com 23

Page 24: FactelligenceMiddleware

<result> 0 for success, -1 for failure - always included

<identity> Identity value – only included if success on Identity table inserts

<error><desc> error description - only included if unsuccessful

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.

The Add command must include all the relevant table’s 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>

2004 CIMNET Inc www.CimnetInc.com 24

Page 25: FactelligenceMiddleware

<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>

<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

2004 CIMNET Inc www.CimnetInc.com 25

Page 26: FactelligenceMiddleware

Part Description

Primary Key

Fields

Optional. By Value. A Variant mapping to the relevant table /

column data type.

Dependent Fields Optional. By Value. A Variant mapping to the relevant table /

column data type.

Returns

Boolean. True if all validation tests pass, otherwise returns False

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

Page 27: FactelligenceMiddleware

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 COMMENTS

GetAll() Not Supported.

GetAllbyXML() Not Supported.

GetByKey() Not Supported.

GetSpecificRS() 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() Not Supported. Use StartSession() method to achieve this

Update() Not Supported.

UpdateSpecific() Not Supported.

Delete() Not Supported.

DeleteAll() Not Supported.

ExecuteXMLCmd()

IsValid() Not Supported.

SPECIFIC METHODS COMMENTS

StartSession() Starts a session for a specified client type

StartBGSession() Starts a session for a specified background executable type

EndSession() End a current session

Login() Log a user in to a session

LogonEnt() Log an Operator on to an entity

LogonEntList() Log an Operator on to a list of entities

SaveEntList() Save a list of entities for future login in a single method call

Logoff() Log a user off a session

2004 CIMNET Inc www.CimnetInc.com 27

Page 28: FactelligenceMiddleware

GetServerTime() Returns the current date and time on the server

GetModulesLicensed() Returns the number of client executables of each type licensed, and also which functional modules are licensed

SwitchUser() Switch the active user on the current session

SwitchSession() Switch the active session for the current user

RefreshHeartbeat() To keep a current session alive

ValidPw() Cheks to see whether the user’s password is valid or not

GetUserByPw() Return a user given the password - Make private ?

DoDailyTasks() Called by Factelligence service to perform background tasks that need to be done once a day.

DoHourlyTasks() Called by Factelligence service to perform background tasks that need to be done once an hour.

DoMinutelyTasks() Called by Factelligence service to perform background tasks that need to be done once a minute.

KillStaleSessions() Automatically end sessions that have not been refreshed for a period of time.

SetMwDbUser() 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.

GetVerInfo() To return database and version information to client applications for display and possible validation checks

UpdateClientEvents() Stub only – for future use.

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 Description

client_type 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.

client_address Optional. By Value. A variant (string) specifying the client’s

callback address for event notifications from the middleware.

2004 CIMNET Inc www.CimnetInc.com 28

Page 29: FactelligenceMiddleware

(for future implementation)

reqd_events 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)

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.

database 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.

dbversion Optional. By Reference. A variant (string) specifying the

version of the database. From DB_Status.db_version.

spversion Optional. By Reference. A variant (string) specifying the

version of the stored procedures. From DB_Status.sp_version.

defdataversion 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.

dbmsname Optional. By Reference. A variant (string) specifying the dbms

name.

dbmsversion Optional. By Reference. A variant (string) specifying the dbms

version

provider Optional. By Reference. A variant (string) specifies the name of

the connection 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.

2004 CIMNET Inc www.CimnetInc.com 29

Page 30: FactelligenceMiddleware

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()

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.

2004 CIMNET Inc www.CimnetInc.com 30

Page 31: FactelligenceMiddleware

Syntax

StartBGSession (client_type, client_address, reqd_events)

Parameters

Part Description

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.

client_address Optional. By Value. A variant (string) specifying the client’s

callback address for event notifications from the middleware. (for

future implementation)

reqd_events 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)

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"?>

2004 CIMNET Inc www.CimnetInc.com 31

Page 32: FactelligenceMiddleware

<request>

<object>session</object>

<msgtype>exec</msgtype>

<cmd>StartBGSession</cmd>

<client_type>53</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>

</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 Description

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

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

2004 CIMNET Inc www.CimnetInc.com 32

Page 33: FactelligenceMiddleware

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>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 Description

session_id Required. By Value. A long identifying the session which must

already have been created.

user_id 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.

user_pw Required. By Value. A string specifying the password for the given

user that will be compared to the encrypted password stored in the

2004 CIMNET Inc www.CimnetInc.com 33

Page 34: FactelligenceMiddleware

database.

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 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>

2004 CIMNET Inc www.CimnetInc.com 34

Page 35: FactelligenceMiddleware

<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.

Syntax

RefreshHeartbeat (session_id)

Parameters

Part Description

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

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>

2004 CIMNET Inc www.CimnetInc.com 35

Page 36: FactelligenceMiddleware

<error>

<desc>Specified Session does not exist</desc>

</error>

</response>

SwitchUser Method

Purpose

To change the active user of a session.

Syntax

SwitchUser (session_id, user_id, user_pw)

Parameters

Part Description

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

user_id 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.

user_pw 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.

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

2004 CIMNET Inc www.CimnetInc.com 36

Page 37: FactelligenceMiddleware

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>

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 Description

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

user_id Required. By Value. A string identifying the user_id to be

logged on.

ent_id Required. By Value. A long to specify which entity is being

logged onto.

cur_lab_cd Optional. By Value. A variant (string) to specify the labor code

to be used for this entry. Defaults to null which means that

2004 CIMNET Inc www.CimnetInc.com 37

Page 38: FactelligenceMiddleware

labor data is not collected.

cur_dept_id 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.

pct_lab_to_apply 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.

logon_time 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.

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>

2004 CIMNET Inc www.CimnetInc.com 38

Page 39: FactelligenceMiddleware

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>

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 Description

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

user_id Required. By Value. A string identifying the user_id to be logged on.

list_id 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.

ent_list 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.

Returns

An XML string detailing success or failure and which entities have been successfully logged into.

Remarks

2004 CIMNET Inc www.CimnetInc.com 39

Page 40: FactelligenceMiddleware

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.

An appropriate error description is returned if the call fails.

Stored Procedure(s) Used

sp_I_Ent_Logon_FromSavedList if from a saved listsp_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"/>

2004 CIMNET Inc www.CimnetInc.com 40

Page 41: FactelligenceMiddleware

<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"?>

<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 user’s default or last saved entity list.

Syntax

SaveEntList (session_id, user_id, list_id)

Parameters

Part Description

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

user_id Required. By Value. A string identifying the user_id currently logged

onto at least one entity.

list_id 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.

Returns

2004 CIMNET Inc www.CimnetInc.com 41

Page 42: FactelligenceMiddleware

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>

<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

2004 CIMNET Inc www.CimnetInc.com 42

Page 43: FactelligenceMiddleware

Part Description

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

user_id Required. By Value. A string identifying the user_id to be logged on.

ent_id 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.

logoff_time 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.

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.

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>

2004 CIMNET Inc www.CimnetInc.com 43

Page 44: FactelligenceMiddleware

<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)

Parameters

Part Description

min_limit 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:

2004 CIMNET Inc www.CimnetInc.com 44

Page 45: FactelligenceMiddleware

<?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 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 Description

cmd Required. By Value. A string containing the name of the

custom method to use – ie. GetSessions, GetEntLogons or

GetEntLogonList

XMLRequest Required. By Value. Dependent on the specific method to be

invoked.

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 recordset’s field names will correspond to the table’s 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

2004 CIMNET Inc www.CimnetInc.com 45

Page 46: FactelligenceMiddleware

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>

<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

2004 CIMNET Inc www.CimnetInc.com 46

Page 47: FactelligenceMiddleware

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>

<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)

2004 CIMNET Inc www.CimnetInc.com 47

Page 48: FactelligenceMiddleware

Parameters

Part Description

new_session_id Required. By Value. A long to identify the session TO WHICH

the user wants to switch.

user_id 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.

user_pw 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)

Returns

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

Remarks

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>

2004 CIMNET Inc www.CimnetInc.com 48

Page 49: FactelligenceMiddleware

<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

To process background tasks that need to be performed every minute.

Syntax

DoMinutelyTasks (session_id)

Parameters

Part Description

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

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()

2004 CIMNET Inc www.CimnetInc.com 49

Page 50: FactelligenceMiddleware

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>

DoAutoShiftChanges Method

Purpose

Performs an automatic shift change every minute.

Syntax

DoAutoShiftChanges(session_id)

Parameters

Part Description

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

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 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

2004 CIMNET Inc www.CimnetInc.com 50

Page 51: FactelligenceMiddleware

Part Description

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

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>

DoDailyTasks Method

Purpose

To process background tasks that need to be performed every day.

Syntax

DoDailyTasks (session_id)

Parameters

Part Description

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

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

2004 CIMNET Inc www.CimnetInc.com 51

Page 52: FactelligenceMiddleware

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>

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

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

2004 CIMNET Inc www.CimnetInc.com 52

Page 53: FactelligenceMiddleware

Part Description

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

Returns

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>

GetVerInfo Method

Purpose

To return database and version information to client applications for display and possible validation checks.

Syntax

GetVerInfo (session_id)

Parameters

Part Description

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

Returns

An XML formatted string containing this information in the following format:

<?xml version="1.0"?>

<response>

2004 CIMNET Inc www.CimnetInc.com 53

Page 54: FactelligenceMiddleware

<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>

</request>

ValidPw Method

Purpose

To check whether the supplied user and password is valid

Syntax

ValidPw (user_id, user_pw)

Parameters

Part Description

user_id Required. By Value. A string to identify the user id

user_pw Required. By Value. A string to identify the user’s password

Returns

2004 CIMNET Inc www.CimnetInc.com 54

Page 55: FactelligenceMiddleware

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>

Ent Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

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()

2004 CIMNET Inc www.CimnetInc.com 55

Page 56: FactelligenceMiddleware

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

StartShift() To start a new shift on a given entity and all its descendants that inherit the same schedule.

DoAutoShiftChanges() To do automatic shift changes in the background.

DoPastShiftChanges() To do automatic shift changes in the background for shifts that may have been missed as the background service was not running.

Clone() To clone an entity and all its dependent data.

GetAll_TopLevel() To return all top level entities as defined by the physical hierarchy.

GetStatusInfo() 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).

GetStatusInfoByUser() 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).

RefreshShiftSched () 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.

GetRefreshedShiftSched () Returns a recordset with all the shifts between specified time limits after applying the exceptions.

GetShiftSched () 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.

GetAvailShiftTime() Returns the number of hours of schedule shift time (counting non null shifts only) for a given entity between 2 specified dates.

GetAvailEndTime() (not implemented yet). To calculate the datetime a specified number of active hours after a specified current time, taking into account only active shift 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.

2004 CIMNET Inc www.CimnetInc.com 56

Page 57: FactelligenceMiddleware

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 Description

session_id Required. By Value. A long to identify the session from

which the call was made.

ent_name Required. By Value. A string (max 80 chars) containing

this entity’s name.

description Optional. By Value. A string (max 80 chars) containing a

description of this entity.

parent_ent_id Optional. By Value. An integer defining the hierarchy level

of this entity’s parent. Null for root entities.

hourly_cost Optional. By Value. A float defining the cost of running

this entity per hour.

can_sched_jobs Required. By Value. A flag (1 = Yes) defining whether this

entity can have Jobs scheduled to it

can_run_jobs Required. By Value. A flag (1 = Yes) defining whether this

entity can run Jobs or not.

2004 CIMNET Inc www.CimnetInc.com 57

Page 58: FactelligenceMiddleware

can_capture_util Required. By Value. A flag (1 = Yes) defining whether this

entity can capture Utilization data or not

can_capture_labor Required. By Value. A flag (1 = Yes) defining whether this

entity can capture Labor data or not

can_do_dnc Required. By Value. A flag (1 = Yes) defining whether this

entity can do DNC control or not

can_track_oee Required. By Value. A flag (1 = Yes) defining whether this

entity can track Overall Equipment Effectiveness (OEE)

or not.

can_sched_shifts Required. By Value. A flag (1 = Yes) defining whether this

entity allows shift scheduling or not

can_store Required. By Value. A flag (1 = Yes) defining whether this

entity can maintain inventory / storage data or not

can_log_data Required. By Value. A flag (1 = Yes) defining whether this

entity can log specific process data or not.

can_ship Required. By Value. A flag (1 = Yes) defining whether

shipments can be made from this entity or not.

can_receive Required. By Value. A flag (1 = Yes) defining whether

materials can be received by this entity or not.

cur_shift_id Optional. By Value. Current shift_id running on this entity.

cur_shift_start_time Optional. By Value. Datetime that the current shift started

on this entity.

last_domain_change Optional. By Value. Datetime that the last domain change

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.

flow_diag_img 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

identical_job_execs Optional. By Value. An integer defining the number of

identical positions that can run independent jobs on this

entity.

spare1 Optional. By Value. A variant (string) to include optional

2004 CIMNET Inc www.CimnetInc.com 58

Page 59: FactelligenceMiddleware

spare fields for this row. Defaults to Null.

spare2 Optional. By Value. A variant (string) to include optional

spare fields for this row. Defaults to Null.

spare3 Optional. By Value. A variant (string) to include optional

spare 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.

last_edit_comment Optional. By Value. A variant (string) to define why this

record is required

last_edit_at Optional. By Ref. A variant (datetime) returns the date

and time of the creation of the current record

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.

Syntax

Delete (session_id, ent_id)

Parameters

Part Description

session_id Required. By Value. A long to identify the session from which the call

was made.

ent_id Required. By Value. A long to identify the entity to be deleted.

Returns

Boolean. True if delete was successful, else false.

Remarks

2004 CIMNET Inc www.CimnetInc.com 59

Page 60: FactelligenceMiddleware

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 Description

session_id Required. By Value. A long to identify the session from

which the call was made.

ent_id Required. By Value. A long to identify the entity on which

to change shift.

shift_id Required. By Value. A long to identify the shift_id to start

on this entity.

Returns

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

Remarks

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 entity’s 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 child’s 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

2004 CIMNET Inc www.CimnetInc.com 60

Page 61: FactelligenceMiddleware

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 Description

ent_id Required. By Value. A long to identify the entity for which status

data is required.

child_levels 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.

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 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:

2004 CIMNET Inc www.CimnetInc.com 61

Page 62: FactelligenceMiddleware

<?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 Description

session_id Required. By Value. A long to identify the user’s session

user_id Required. By Value. A string to identify the user

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()

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>

2004 CIMNET Inc www.CimnetInc.com 62

Page 63: FactelligenceMiddleware

</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 Description

session_id Required. By Value. A long to identify the session from

which the call was made.

existing_ent_id Required. By Value. A long identifying the existing entity

to be cloned.

ent_name Required. By Value. A string (max 80 chars) containing

this entity’s name.

ent_level 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.

description Optional. By Value. A variant (string) (max 80 chars)

containing a description of this entity. Defaults to value of

existing entity.

parent_ent_id Optional. By Value. An variant (long) defining the the new

entity’s parent. Null for root entities. Defaults to all rows

where the existing entity is a child.

hourly_cost Optional. By Value. A variant (double) defining the cost of

running this entity per hour. Defaults to value of existing

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.

can_run_jobs Optional. By Value. A variant (boolean) (1 = Yes) defining

whether this entity can run Jobs or not. Defaults to value

2004 CIMNET Inc www.CimnetInc.com 63

Page 64: FactelligenceMiddleware

of existing entity.

can_capture_util Optional. By Value. A variant (boolean) (1 = Yes) defining

whether this entity can capture Utilization data or not.

Defaults to value of existing entity.

can_capture_labor Optional. By Value. A variant (boolean) (1 = Yes) defining

whether this entity can capture Labor data or not. Defaults

to value of existing entity.

can_do_dnc Optional. By Value. A variant (boolean) (1 = Yes) defining

whether this entity can do DNC control or not. Defaults to

value of existing entity.

can_track_oee 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.

can_sched_shifts Optional. By Value. A variant (boolean) (1 = Yes) defining

whether this entity allows shift scheduling or not. Defaults

to value of existing entity.

can_store 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.

can_log_data 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.

can_ship Required. By Value. A flag (1 = Yes) defining whether

shipments can be made from this entity or not.

can_receive Required. By Value. A flag (1 = Yes) defining whether

materials can be received by this entity or not.

cur_shift_id Optional. By Value. Current shift_id as a variant (long)

running on this entity. Defaults to value of existing entity.

cur_shift_start_time Optional. By Value. A variant (Datetime) that the current

shift started on this entity. Defaults to value of existing

entity.

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.

tree_icon Optional. By Value. A variant (string) defining a path and

filename to be used as an image (BMP or GIF file) for this

2004 CIMNET Inc www.CimnetInc.com 64

Page 65: FactelligenceMiddleware

entity in the hierarchy treeviews. Defaults to value of

existing entity.

last_edit_comment Optional. By Value. A variant (string) to define why record

was changed

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.

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.

2004 CIMNET Inc www.CimnetInc.com 65

Page 66: FactelligenceMiddleware

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 Description

session_id Required. By Value. A long to identify the session from which the

call was made.

days_ahead Optional. By Value. A variant (long) specifying the number of days

into the future to prepare the consolidated schedule for. Defaults to

7 days.

ent_id 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.

shift_sched 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.

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 was passed as a parameter: ie. the method processes the schedules for all entities that ‘can_sched_shifts’.

2004 CIMNET Inc www.CimnetInc.com 66

Page 67: FactelligenceMiddleware

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 Description

session_id Required. By Value. A long to identify the session from which the

call was made.

ent_id 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.

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 have shift schedules defined.

2004 CIMNET Inc www.CimnetInc.com 67

Page 68: FactelligenceMiddleware

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 Description

ent_id 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’.

start_date Optional. By Value. A variant (datetime) identifying the start of the

required period. Defaults to current datetime.

end_date Optional. By Value. A variant (datetime) identifying the end of the

required period. Defaults to return data for one week after the start

date.

Returns

ADODB.recordset. Columns are ent_id, start_time, end_time, shift_id, break1_start…break3_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

2004 CIMNET Inc www.CimnetInc.com 68

Page 69: FactelligenceMiddleware

Access via Director.cls using GetSpecificRS() or GetSpecificRSasXML()

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 Description

ent_id Required. By Value. A long to identify the entity on which

to check the scheduled shift time.

start_date Required. By Value. A datetime to identify the start of the

time period.

end_date Required. By Value. A datetime to identify the end of the

time period.

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>

2004 CIMNET Inc www.CimnetInc.com 69

Page 70: FactelligenceMiddleware

<object>ent</object>

<cmd>GetAvailShiftTime</cmd>

<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 Description

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

ent_id 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.

num_hours Required. By Value. A double to specify the number of hours of ‘work’ time to look ahead.

start_time Optional. By Value. A variant (datetime) to specify the start datetime. Defaults to Now.

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"?>

2004 CIMNET Inc www.CimnetInc.com 70

Page 71: FactelligenceMiddleware

<request>

<object>ent</object>

<msgtype>Exec</msgtype>

<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 Description

session_id Required. By Value. A long to identify the session from which the

call was made.

ent_id 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.

start_date Required. By Value. A varaiant (datetime) identifying the start of the

required period.

days_ahead Optional. By Value. A variant (long) specifying the number of days

into the future to prepare the consolidated schedule for. Defaults to

7 days.

name 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.

Returns

ADODB.recordset. Columns are ent_id, start_time, end_time, shift_id, break1_start, …, break3_end

Remarks

2004 CIMNET Inc www.CimnetInc.com 71

Page 72: FactelligenceMiddleware

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’.

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 COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update() Not supported as there are no dependent fields

UpdateSpecific() Not supported as there are no dependent fields

Delete()

DeleteAll()

2004 CIMNET Inc www.CimnetInc.com 72

Page 73: FactelligenceMiddleware

ExecuteXMLCmd()

IsValid()

Attr Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() All columns except last_edit_comment are available as filters

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Attr_Set Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update() Not supported as there are no dependent fields

UpdateSpecific() Not supported as there are no dependent fields

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Ent_Attr Class

2004 CIMNET Inc www.CimnetInc.com 73

Page 74: FactelligenceMiddleware

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

System_Attr Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following columns are NOT available as filters to increase performance: attr_desc, attr_seq, attr_constraints, last_edit_comment

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

System_Attr_Grp Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() All columns are available as filters.

2004 CIMNET Inc www.CimnetInc.com 74

Page 75: FactelligenceMiddleware

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Language_Grp Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() All columns are available as filters.

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Language Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

2004 CIMNET Inc www.CimnetInc.com 75

Page 76: FactelligenceMiddleware

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

NextFreeLangId()

Clone()

DeleteByLang()

NextFreeLangID Method

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 Description

session_id Required. By Value. A long to identify the session from which

the call was made.

new_lang_id Required. By Value. A long to identify the new language.

cloned_lang_id Required. By Value. A long to identify the existing language to

2004 CIMNET Inc www.CimnetInc.com 76

Page 77: FactelligenceMiddleware

be cloned

new_lang_desc Required. By Value. A string to describe the new language. The

language description is saved as string = 1 for each language.

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

Purpose

To delete all strings for a given language from the database.

Syntax

DeleteByLang (session_id, lang_id)

Parameters

Part Description

session_id Required. By Value. A long to identify the session from which the call

was made.

lang_id Required. By Value. A long to identify the language to be deleted.

Returns

Boolean. True if delete was successful, else false.

Remarks

Any users that had this language as their default language are now assigned the system’s default language.

Stored Procedure(s) Used

sp_D_Language_By_Lang.

Error_Log Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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:

2004 CIMNET Inc www.CimnetInc.com 77

Page 78: FactelligenceMiddleware

logged_at: returns all rows where logged_at >= parameter value

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Audit_Trail Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following columns are NOT available as filters to increase performance: delete_detail.

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add() Not supported as this data is added automatically

Update() Not supported as this data is not editable

UpdateSpecific() Not supported as this data is not editable

Delete() Not supported as this data is not deletable

DeleteAll() Not supported as this data is not deletable

ExecuteXMLCmd() Only provides access to supported commands

IsValid() Not supported.

Grp_Name Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() All columns except last_edit_comment are available as filters

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add() 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

2004 CIMNET Inc www.CimnetInc.com 78

Page 79: FactelligenceMiddleware

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() This method also deletes all rows in the grp_ent_link and grp_priv_link tables for this group.

DeleteAll()

ExecuteXMLCmd()

IsValid()

User_Name Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following columns are NOT available as filters: encrypt_pw, email_address, 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() As for GetAll().

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update() Does not support updating of a user’s password – use specific ChangePassword() method for this.

UpdateSpecific() Does not support updating of a user’s password – use specific ChangePassword() method for this.

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

AddorUpdate() 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.

2004 CIMNET Inc www.CimnetInc.com 79

Page 80: FactelligenceMiddleware

Does not support updating of a user’s password – use specific ChangePassword() method for this.

ChangePassword() Allows changing of a user’s password, but must include current password as well for authentication.

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

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>

2004 CIMNET Inc www.CimnetInc.com 80

Page 81: FactelligenceMiddleware

<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

session_Id Required. By Value. A variant (long) to identify the client session from which the request is being made.

user_id Required. By Value. A variant (string) to identify the user changing the password.

password Required. By Value. A variant (string) to validate the user changing the password.

target_user_id Required. By Value. A variant (string) to identify the user for whom the password is being changed.

new_password Required. By Value. A variant (string) to hold the new password for the user.

Returns

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>

2004 CIMNET Inc www.CimnetInc.com 81

Page 82: FactelligenceMiddleware

<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 COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update() Not supported as there are no dependent fields

UpdateSpecific() Not supported as there are no dependent fields

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Priv Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() All columns are available as filters.

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Not supported

Add() Not supported

Update() Not supported

UpdateSpecific() Not supported

Delete() Not supported

DeleteAll() Not supported

2004 CIMNET Inc www.CimnetInc.com 82

Page 83: FactelligenceMiddleware

ExecuteXMLCmd() Not supported

IsValid() Not supported

Grp_Priv_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

GetPrivilegesByUser()

GetUsersByPrivilege()

GetPriv()

GetPrivilegesByUser Method

Purpose

To return all defined privilege access levels for a given user.

Syntax

GetPrivilegesByUser (user_id)

Parameters

Part Description

user_id 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.

2004 CIMNET Inc www.CimnetInc.com 83

Page 84: FactelligenceMiddleware

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 user’s access levels for a given privilege.

Syntax

GetUsersByPrivilege (priv_id)

Parameters

Part Description

priv_id Required. By Value. An integer identifying the priv_id for whom user’s

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>

2004 CIMNET Inc www.CimnetInc.com 84

Page 85: FactelligenceMiddleware

</request>

GetPriv Method

Purpose

To return a specific privilege access levels for a given user.

Syntax

GetPriv (user_id, priv_id)

Parameters

Part Description

user_id Required. By Value. A string identifying the user_id for whom

privileges are required.

priv_id Required. By Value. A long to identify the privilege for which an

access level is required.

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

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 COMMENTS

GetAll() 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,

2004 CIMNET Inc www.CimnetInc.com 85

Page 86: FactelligenceMiddleware

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update() 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 COMMENTS

CanAccess()

GetEntAccessByUser()

GetEntAccessByGrp()

GetUserAccessByEnt()

GetGrpAccessByEnt()

CanAccess Method

Purpose

To find out whether a given user group has access rights to a given entity.

Syntax

CanAccess (grp_id, ent_id)

Parameters

Part Description

grp_id Required. By Value. A long to identify the group / entity combination

to be updated.

ent_id Required. By Value. A long to identify the group / entity combination

to be updated.

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.

2004 CIMNET Inc www.CimnetInc.com 86

Page 87: FactelligenceMiddleware

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 Description

user_id Required. By Value. A string identifying the user_id for whom entity

access privileges are required.

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>

2004 CIMNET Inc www.CimnetInc.com 87

Page 88: FactelligenceMiddleware

<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 Description

ent_id Required. By Value. A long identifying the entity for which all user’s

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.

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.

2004 CIMNET Inc www.CimnetInc.com 88

Page 89: FactelligenceMiddleware

Syntax

GetGrpAccessByEnt (ent_id)

Parameters

Part Description

ent_id Required. By Value. A long identifying the entity for which all group’s

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>

<ent_id>2</ent_id>

</request>

Shift Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() All columns except last_edit_comment are available as filters

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

2004 CIMNET Inc www.CimnetInc.com 89

Page 90: FactelligenceMiddleware

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Shift_Sched Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Shift_Exc Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific() mod_id is optional

Delete()

2004 CIMNET Inc www.CimnetInc.com 90

Page 91: FactelligenceMiddleware

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

GetExceptions() 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 Description

start_time Required. By Value. A Variant (date) to the start of the period.

end_time Required. By Value. A Variant (date) to identify end of the

period.

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"?>

<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

2004 CIMNET Inc www.CimnetInc.com 91

Page 92: FactelligenceMiddleware

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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.

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update() Not supported

UpdateSpecific() Not supported

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Message Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to increase performance: Message, last_edit_comment, row_idIf 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Mail_Grp Class

Summary of the methods supported by this class:

2004 CIMNET Inc www.CimnetInc.com 92

Page 93: FactelligenceMiddleware

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Mail_Grp_Member Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Emailatt Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

2004 CIMNET Inc www.CimnetInc.com 93

Page 94: FactelligenceMiddleware

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Pred_Msg Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to increase performance: recipients, message, last_edit_comment

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

ExecuteXMLCmd()

IsValid()

UI_Config Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

2004 CIMNET Inc www.CimnetInc.com 94

Page 95: FactelligenceMiddleware

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

SaveSectionParams()

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 Description

xmlRequest 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><desc> error description - only included if unsuccessful

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 don’t need to keep track of whether each parameters already exists or not.

Stored Procedure(s) Used

sp_D_ui_config – to delete existing section datasp_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:

<?xml version="1.0"?>

<request>

<object>ui_config</object>

2004 CIMNET Inc www.CimnetInc.com 95

Page 96: FactelligenceMiddleware

<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 COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

SaveSectionParams()

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 96

Page 97: FactelligenceMiddleware

Part Description

xmlRequest 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><desc> error description - only included if unsuccessful

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 don’t 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 COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to increase performance: tooltip, def_enabled_img, def_disabled_img,

2004 CIMNET Inc www.CimnetInc.com 97

Page 98: FactelligenceMiddleware

param_desc, config_help, dest_option, last_edit_comment

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add() Not supported – populated with predefined data

Update() Not supported – populated with predefined data

UpdateSpecific() Not supported – populated with predefined data

Delete() Not supported – populated with predefined data

DeleteAll() Not supported – populated with predefined data

ExecuteXMLCmd() Not supported – populated with predefined data

IsValid() Not supported – populated with predefined data

UI_Button_Set Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() All fields are supported as optional filter parametersThe 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add() Not supported – populated with predefined data

Update() Not supported – populated with predefined data

UpdateSpecific() Not supported – populated with predefined data

Delete() Not supported – populated with predefined data

DeleteAll() Not supported – populated with predefined data

ExecuteXMLCmd() Not supported – populated with predefined data

IsValid() Not supported – populated with predefined data

Mgr_Data_Config Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following columns are NOT available as filters: rep_desc, rep_filepath, rep_parameters, sort_order, custom_filter, max_pages, last_edit_comment

GetAllbyXML() As for GetAll()

GetByKey()

2004 CIMNET Inc www.CimnetInc.com 98

Page 99: FactelligenceMiddleware

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Graphic Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following columns are NOT available as filters: graphic_data, last_edit_comment, row_id

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add() This method requires an additional field “size” which needs to be supplied along with other fields to specify the size of an image

Update() This method requires an additional field “size” which needs to be supplied along with other fields to specify the size of an image

UpdateSpecific() Updating graphic_data column is not supported – use specific UpdateImage() method for this.

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

UpdateImage()

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

2004 CIMNET Inc www.CimnetInc.com 99

Page 100: FactelligenceMiddleware

Part Description

session_id Required. By Value. A variant (long) to identify the client session from which the request is being made.

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

graphic_data Required. By Value. A variant (string) to identify the graphic data.

size Required. By Value. A variant (long) to identify the size of the image

last_edit_comment Optional. By Value. A variant (string) to identify why the image was changed.

last_edit_at Optional. By Ref. A variant (datetime) to identify the last_edit_at. Also returns the last date and time of the image updated

Returns

Long. 0 if successful, else –1.

Remarks

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 COMMENTS

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

GetAllbyXML() As for GetAll()

2004 CIMNET Inc www.CimnetInc.com 100

Page 101: FactelligenceMiddleware

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

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 COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

File_Type Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

2004 CIMNET Inc www.CimnetInc.com 101

Page 102: FactelligenceMiddleware

The following columns are also included in the returned recordset: doc_type.descrip

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

File_Desc Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update() Not supported as there are no dependent fields

UpdateSpecific() Not supported as there are no dependent fields

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Dir Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

2004 CIMNET Inc www.CimnetInc.com 102

Page 103: FactelligenceMiddleware

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add() Standard method enhanced as described below.

Update()

UpdateSpecific()

Delete() Standard method enhanced as described below.

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

ChangeSeq()

ReSeq()

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 Description

session_id Required. By Value. A long to identify the session from

which the call was made.

ent_id Required. By Value. An integer identifying the entity.

seq_no Required. By Value. An integer identifying the sequence

or priority of using this directory.

directory Required. By Value. A string (max 254 chars) containing

the path to this directory.

last_edit_comment Optional. By Value. A string (max 254 chars) specifying

why the record was added.

last_edit_at Optional. By Ref. A variant datetime identifying the date

and time of creation of this record is returned to the user

validate Optional. By Value. A flag to define whether the data

should be validated before saving to the database or not.

2004 CIMNET Inc www.CimnetInc.com 103

Page 104: FactelligenceMiddleware

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_no’s 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_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 Description

session_id Required. By Value. A long to identify the session from which the call

was made.

ent_id Required. By Value. A long to identify the entity directory to be

deleted.

seq_no Required. By Value. A long to identify the entity directory to be

deleted.

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_no’s 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

2004 CIMNET Inc www.CimnetInc.com 104

Page 105: FactelligenceMiddleware

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 Description

session_id Required. By Value. A long to identify the session from which the

call was made.

ent_id Required. By Value. A long to identify the entity directory to be

resequenced.

orig_seq_no Required. By Value. A long to identify the original seq_no of the

entity directory to be resequenced.

new_seq_no Required. By Value. A long to identify the new seq_no for this

directory

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 Description

session_id Required. By Value. A long to identify the session from which the

2004 CIMNET Inc www.CimnetInc.com 105

Page 106: FactelligenceMiddleware

call was made.

ent_id Required. By Value. A long to identify the entity to be resequenced.

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 106

Page 107: FactelligenceMiddleware

Prod DLL Enhanced Methods

Item_State Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Item_Grade Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

2004 CIMNET Inc www.CimnetInc.com 107

Page 108: FactelligenceMiddleware

Item_Class Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Item_Class_Attr Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Item Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to

2004 CIMNET Inc www.CimnetInc.com 108

Page 109: FactelligenceMiddleware

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Item_Attr Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following columns are NOT available as filters: last_edit_comment, row_idThe following columns are also included in the returned recordset: item.item_desc, attr.attr_desc, attr.data_type

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Uom Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() All fields except last_edit_comment are supported as optional filter

2004 CIMNET Inc www.CimnetInc.com 109

Page 110: FactelligenceMiddleware

parameters

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Uom_Conv Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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.

GetAllbyXML() As for GetAll()

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: from_uom_id, to_uom_id, item_id.

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Item_Reas_Grp Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following columns are NOT available as filters: display_seq, last_edit_comment

2004 CIMNET Inc www.CimnetInc.com 110

Page 111: FactelligenceMiddleware

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Item_Reas_Grp_Class_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update() Not supported as there are no dependent fields

UpdateSpecific() Not supported as there are no dependent fields

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Item_Reas_Grp_Ent_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update() Not supported as there are no dependent fields

2004 CIMNET Inc www.CimnetInc.com 111

Page 112: FactelligenceMiddleware

UpdateSpecific() Not supported as there are no dependent fields

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

GetReasons()

GetReasons Method

Purpose

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 Description

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

item_ id Optional. By Value. A variant (string) to identify the item class

reas_grp_type 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>

2004 CIMNET Inc www.CimnetInc.com 112

Page 113: FactelligenceMiddleware

<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 COMMENTS

GetAll() The following columns are NOT available as filters: display_seq, last_edit_commentThe 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_typeThe 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() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Job_Exec Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() Only the following columns ARE available as filters to increase performance: ent_id, job_pos, spare1-4. last_edit_by, last_edit_at

GetByKey()

GetSpecificRS() Retrieval of the following specific recordsets are supported:

GetQueue(). Available filters are: ent_id, job_state, reqd_by,

2004 CIMNET Inc www.CimnetInc.com 113

Page 114: FactelligenceMiddleware

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()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

StartJob()

PauseJob()

EndJob()

SplitJob()

CloneJob()

CloneWO()

AddProd()

RejectProd()

AddProdPostExec()

AddCons()

AddConsPostExec()

SetCurLotData()

StartStep()

StopStep()

StepLogin()

StepLogout()

UpdateStepData()

CreateWOFromProcess()

VerifyProcess()

2004 CIMNET Inc www.CimnetInc.com 114

Page 115: FactelligenceMiddleware

CertSignoff()

CertSignoffAllowed()

CertSignoffReqd()

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

CertStartAllowed()

SetUIScreenTagValues()

ChangeWOQtys()

ChangeWOPriority()

ChangeWOReqdFinishTime()

ChangeWOValues()

SetAttr()

SetActualSpecValue()

DownloadSpecs()

ChangeSpecValue()

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 Description

ent_id Required. By Value. A long to identify the entity for which the

job queue is to be retrieved.

job_state 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).

reqd_by 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.

2004 CIMNET Inc www.CimnetInc.com 115

Page 116: FactelligenceMiddleware

job_priority Optional. By Value. A variant (long) to filter the queue by only

retrieving jobs <= the specified priority. Default is no filter for

this field.

max_rows Optional. By Value. A variant (long) to filter the rows with the

value specified. Default is 0; which is no filter for this field.

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.

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

2004 CIMNET Inc www.CimnetInc.com 116

Page 117: FactelligenceMiddleware

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 Description

session_id Required. By Value. A long to identify the session from which

the job is being started.

user_id Required. By Value. A string to identify the user_id starting the

job.

ent_id Required. By Value. A long to identify the entity on which the job

is to be run.

wo_id Required. By Value. A string to identify the wo_id

oper_id Required. By Value. A string to identify the oper_id

seq_no Required. By Value. A long to identify the seq_no

status_notes Optional. By Value. A variant (string) to include notes

associated with the state change. Defaults to null.

check_privs Optional. By Value. A variant (boolean) to specify whether the

user’s privileges should be checked before executing this

action. Defaults to False.

check_certs Optional. By Value. A variant (boolean) to specify whether the

user’s certifications should be checked before executing this

action (Requires Certification module). Defaults to False.

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

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)

2004 CIMNET Inc www.CimnetInc.com 117

Page 118: FactelligenceMiddleware

status_notes = status_notesact_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_idCur_oper_id = oper_idCur_seq_no = seq_noCur_Step_No = 0Cur_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>

<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 Description

session_id Required. By Value. A long to identify the session from which

the job is being ended.

2004 CIMNET Inc www.CimnetInc.com 118

Page 119: FactelligenceMiddleware

user_id Required. By Value. A string to identify the user_id ending the

job.

ent_id Required. By Value. A long to identify the entity on which the job

is to be ended.

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

running on the entity

oper_id Optional. By Value. A variant (string) to identify the oper_id

running on the entity

seq_no Optional. By Value. A variant (long) to identify the seq_no

running on the entity.

status_notes Optional. By Value. A variant (string) to include notes

associated with the state change. Defaults to null.

check_privs Optional. By Value. A variant (boolean) to specify whether the

user’s privileges should be checked before executing this

action. Defaults to False.

check_certs 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.

client_type Optional. By Value. A Variant (long) to identify which client

application is trying to end the job. Defaults to 37 (Operator)

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

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_notesact_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 = 0Cur_Step_No = NullCur_Step_Start = Null

2004 CIMNET Inc www.CimnetInc.com 119

Page 120: FactelligenceMiddleware

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>

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 Description

session_id Required. By Value. A long to identify the session from which

the job is being paused.

user_id Required. By Value. A string to identify the user_id pausing

the job.

ent_id Required. By Value. A long to identify the entity on which the

2004 CIMNET Inc www.CimnetInc.com 120

Page 121: FactelligenceMiddleware

job is running.

wo_id Required. By Value. A string to identify the wo_id

oper_id Required. By Value. A string to identify the oper_id

seq_no Required. By Value. . A long to identify the seq_no

paused_job_state 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)

status_notes Optional. By Value. A variant (string) to include notes

associated with the state change. Defaults to null.

check_privs Optional. By Value. A variant (boolean) to specify whether the

user’s privileges should be checked before executing this

action. Defaults to False.

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

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 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_statestatus_notes = status_notesact_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 = 0Cur_Step_No = NullCur_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>

2004 CIMNET Inc www.CimnetInc.com 121

Page 122: FactelligenceMiddleware

<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

Part Description

session_id Required. By Value. A long to identify the session from which

the job is being split.

wo_id Required. By Value. A string to identify the wo_id

oper_id Required. By Value. A string to identify the oper_id

orig_seq_no Required. By Value. A long to identify the seq_no from which

the split is being made.

user_id Required. By Value. A string to identify the user creating this

WO.

split_qty Required. By Value. A double to identify the quantity of the job

to be split to the new job.

new_seq_no 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.

2004 CIMNET Inc www.CimnetInc.com 122

Page 123: FactelligenceMiddleware

split_start_qty Optional. By Value. A variant (double) to identify the start

quantity of the job to be split to the new job. Defaults to null.

new_state_cd 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).

req_finish_time 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.

target_ent_id 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.

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

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.

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 = nullsched_pinned = falseQty_prod = 0Qty_prod_erp = nullQty_rejected = 0Qty_ rejected_erp = nullconcurrent_link = 0Act_start_time = nullAct_finish_time = nullsched_start_time = nullsched_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: ??

2004 CIMNET Inc www.CimnetInc.com 123

Page 124: FactelligenceMiddleware

Job_spec.act_spec_value is set = null

Job_Spec.act_time is set = nullJob_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

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 Description

session_id Required. By Value. A long to identify the session from which

the job is being cloned.

wo_id Required. By Value. A string to identify the wo_id to be cloned

oper_id Required. By Value. A string to identify the oper_id to be cloned

2004 CIMNET Inc www.CimnetInc.com 124

Page 125: FactelligenceMiddleware

seq_no Required. By Value. A long to identify the seq_no to be cloned

user_id Required. By Value. A string to identify the user performing this

action.

new_wo_id Optional. By Value. A variant (string) to identify the wo_id of the

new job

new_oper_id Optional. By Value. A variant (string) to identify the oper_id of

the new job

new_seq_no 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.

req_qty Optional. By Value. A variant (double) to identify the required

quantity of the new job. Defaults to same value as old job.

start_qty Optional. By Value. A variant (double) to identify the start

quantity of the new job. Defaults to same value as old job.

new_state_cd 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).

req_finish_time Optional. By Value. A variant (datetime) indicating the required

finish time of the new job. Defaults to same value as old job.

target_ent_id 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

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

Returns

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.

2004 CIMNET Inc www.CimnetInc.com 125

Page 126: FactelligenceMiddleware

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 = nullsched_pinned = falseQty_prod = 0Qty_prod_erp = nullQty_rejected = 0Qty_ rejected_erp = nullconcurrent_link = 0Act_start_time = nullAct_finish_time = nullsched_start_time = nullsched_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 = nullJob_ 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>

<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>

2004 CIMNET Inc www.CimnetInc.com 126

Page 127: FactelligenceMiddleware

<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 Description

session_id Required. By Value. A long to identify the session from which

the WO is being created.

wo_id Required. By Value. A string to identify the wo_id

process_id Required. By Value. A string to identify the process_id from

which this WO is being created.

item_id 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)

req_qty Required. By Value. A double to identify the quantity of the final

item to be made.

user_id Required. By Value. A string to identify the user creating this

WO.

start_qty Optional. By Value. A variant (double) for the required start qty.

Defaults to null.

init_wo_state Optional. By Value. A variant (long) for the initial state of all

jobs for the WO. Defaults to NEW (1).

wo_desc Optional. By Value. A variant (string) for the WO description.

Defaults to the wo_id.

release_time Optional. By Value. A variant (datetime) indicating the release

time of the WO. Defaults to the current date and time.

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.

2004 CIMNET Inc www.CimnetInc.com 127

Page 128: FactelligenceMiddleware

wo_priority Optional. By Value. A variant (long) for the priority of the WO

and all its Jobs. Defaults to 1.

cust_info Optional. By Value. A variant (string) for the customer

information field. Defaults to “”.

mo_id Optional. By Value. A variant (string) for the manufacturing

order field. Defaults to “”.

notes Optional. By Value. A variant (string) for the WO notes.

Defaults to “”.

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_Stacksp_Build_Jobsp_Build_BOM

sp_BI_to_Job_BOMsp_CALL_build_BOM_with_proper_START_QTYsp_BIOS_to_Job_specsp_BIOSL_to_Job_BOM_stepsp_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>

<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>

2004 CIMNET Inc www.CimnetInc.com 128

Page 129: FactelligenceMiddleware

<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 Description

session_id Required. By Value. A long to identify the session from which

the WO is being cloned.

new_wo_id Required. By Value. A string to identify the new wo_id

existing_wo_id Required. By Value. A string to identify the wo_id from which

this WO is being cloned.

user_id Required. By Value. A string to identify the user creating this

WO.

req_qty 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.

wo_desc Optional. By Value. A variant (string) for the WO description.

Defaults to the wo_id.

release_time Optional. By Value. A variant (datetime) indicating the release

time of the WO. Defaults to the current date and time.

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.

wo_priority Optional. By Value. A variant (long) for the priority of the WO

and all its Jobs. Defaults to value for existing WO.

cust_info Optional. By Value. A variant (string) for the customer information field. Defaults to “”.

2004 CIMNET Inc www.CimnetInc.com 129

Page 130: FactelligenceMiddleware

mo_id Optional. By Value. A variant (string) for the manufacturing

order field. Defaults to “”.

notes Optional. By Value. A variant (string) for the WO notes.

Defaults to “”.

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>

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)

2004 CIMNET Inc www.CimnetInc.com 130

Page 131: FactelligenceMiddleware

Parameters

Part Description

session_id Required. By Value. A long to identify the session from

which the call is being made.

user_id Required. By Value. A string to identify the user.

ent_id Required. By Value. A long to identify the entity.

bom_pos 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.

cur_item_id 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.

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 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

2004 CIMNET Inc www.CimnetInc.com 131

Page 132: FactelligenceMiddleware

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, row_id)

Parameters

Part Description

session_id Required. By Value. A long to identify the session from

which the call is being made.

user_id Required. By Value. A string to identify the user.

2004 CIMNET Inc www.CimnetInc.com 132

Page 133: FactelligenceMiddleware

ent_id Required. By Value. A long to identify the entity.

qty_prod Required. By Value. A double specifying the production

quantity to be added

reas_cd 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.

lot_no Optional. By Value. A variant (string) to identify the lot number for this quantity produced. Defaults to last used lot_no on this entity.

rm_lot_no 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.

to_ent_id 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.

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

being produced. Defaults to the last produced item on this

entity.

byproduct_bom_pos 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)

ext_ref Optional. By Value. A variant (string) to specify an external

reference for this row. Defaults to Null.

apply_scaling_factor Optional. By Value. A variant (Boolean) to specify whether

to apply scaling factor or not. Defaults to 0

spare1 Optional. By Value. A variant (string) to include optional

spare fields for this row. Defaults to Null.

spare2 Optional. By Value. A variant (string) to include optional

spare fields for this row. Defaults to Null.

spare3 Optional. By Value. A variant (string) to include optional

spare 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.

job_pos Optional. By Value. A variant (long) to identify the job

position, if > 1 jobs are running on this entity

row_id Optional. By Ref. A variant (long) to return the row_id of the

2004 CIMNET Inc www.CimnetInc.com 133

Page 134: FactelligenceMiddleware

row that was just inserted or updated if this call was

successful.

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 job’s 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 job’s 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 item’s 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 job’s 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 job’s 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 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 job’s 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

2004 CIMNET Inc www.CimnetInc.com 134

Page 135: FactelligenceMiddleware

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

Part Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

2004 CIMNET Inc www.CimnetInc.com 135

Page 136: FactelligenceMiddleware

user_id Required. By Value. A string to identify the user.

ent_id Required. By Value. A long to identify the entity.

qty_prod Required. By Value. A double specifying the production quantity

to be added

wo_id Required. By Value. A string to identify the wo_id.

oper_id Required. By Value. A string to identify the oper_id.

seq_no Required. By Value. A long to identify the seq_no.

shift_start Required. By Value. A date to specify the shift during which this

production occurred.

shift_id Required. By Value. A long to specify the shift on the entity.

item_id Optional. By Value. A variant (string) to identify the item being

produced. Defaults to current value in the job_bom table.

reas_cd 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.

lot_no Optional. By Value. A variant (string) to identify the lot number for this quantity produced. Defaults to current value in the job_bom table.

rm_lot_no 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.

to_ent_id Optional. By Value. A variant (long) to identify the storage entity

for this quantity produced. Defaults to current value in the

job_bom table.

processed Optional. By Value. A variant (boolean) to specify the processed

flag value for this quantity produced. Defaults to last No (0).

byproduct Optional. By Value. A variant (boolean) to specify whether this

is a byproduct or not. Defaults to NO (0).

ext_ref Optional. By Value. A variant (string) to specify an external

reference for this row. Defaults to null.

move_status Optional. By Value. A variant (integer) to specify the move

status of this row. Defaults to 0.

spare1 Optional. By Value. A variant (string) to include optional spare

fields for this row. Defaults to null.

2004 CIMNET Inc www.CimnetInc.com 136

Page 137: FactelligenceMiddleware

spare2 Optional. By Value. A variant (string) to include optional spare

fields for this row. Defaults to null.

spare3 Optional. By Value. A variant (string) to include optional spare

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

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>

<lot_no>lotabc</lot_no>

<to_ent_id>2</ to_ent_id>

2004 CIMNET Inc www.CimnetInc.com 137

Page 138: FactelligenceMiddleware

<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 Description

session_id Required. By Value. A long to identify the session from

which the call is being made.

user_id Required. By Value. A string to identify the user.

ent_id Required. By Value. A long to identify the entity.

bom_pos Required. By Value. A long to identify the BOM position on

the entity.

qty_cons Required. By Value. A double specifying the consumption

quantity to be added

reas_cd 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.

lot_no 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.

fg_lot_no Optional. By Value. A variant (string) to identify the lot number of the MAIN produced item for this quantity consumed. Defaults to default used lot_no for the produced item on this entity.

2004 CIMNET Inc www.CimnetInc.com 138

Page 139: FactelligenceMiddleware

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.

item_id 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.

ext_ref Optional. By Value. A variant (string) to specify an external

reference for this row. Defaults to null.

apply_scaling_factor Optional. By Value. A variant (Boolean) to specify whether

to apply scaling factor or not. Defaults to 0

spare1 Optional. By Value. A variant (string) to include optional

spare fields for this row. Defaults to Null.

spare2 Optional. By Value. A variant (string) to include optional

spare fields for this row. Defaults to Null.

spare3 Optional. By Value. A variant (string) to include optional

spare 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.

job_pos Optional. By Value. A variant (long) to identify the job

position, if > 1 jobs are running on this entity

row_id 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.

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 to the existing row. In this case the other specified dependent fields (from_ent_id, ext_ref, spare values

2004 CIMNET Inc www.CimnetInc.com 139

Page 140: FactelligenceMiddleware

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 Description

2004 CIMNET Inc www.CimnetInc.com 140

Page 141: FactelligenceMiddleware

session_id Required. By Value. A long to identify the session from which

the call is being made.

user_id Required. By Value. A string to identify the user.

ent_id Required. By Value. A long to identify the entity.

qty_cons Required. By Value. A double specifying the consumption

quantity to be added

wo_id Required. By Value. A string to identify the wo_id.

oper_id Required. By Value. A string to identify the oper_id.

seq_no Required. By Value. A long to identify the seq_no.

shift_start Required. By Value. A date to specify the shift during which

this production occurred.

shift_id Required. By Value. A long to specify the shift on the entity.

bom_pos Optional. By Value. A long to identify the BOM position on the

entity.

item_id Optional. By Value. A variant (string) to identify the item being

consumed. Defaults to current value in the job_bom table.

reas_cd 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.

lot_no Optional. By Value. A variant (string) to identify the lot number for this quantity consumed. Defaults to current value in the job_bom table.

fg_lot_no 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.

from_ent_id Optional. By Value. A variant (long) to identify the storage

entity for this quantity consumed. Defaults to current value in

the job_bom table.

ext_ref Optional. By Value. A variant (string) to specify an external

reference for this row. Defaults to null.

spare1 Optional. By Value. A variant (string) to include optional spare

fields for this row. Defaults to null.

spare2 Optional. By Value. A variant (string) to include optional spare

fields for this row. Defaults to null.

2004 CIMNET Inc www.CimnetInc.com 141

Page 142: FactelligenceMiddleware

spare3 Optional. By Value. A variant (string) to include optional spare

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>

2004 CIMNET Inc www.CimnetInc.com 142

Page 143: FactelligenceMiddleware

<lot_no>lotabc</lot_no>

<fg_lot_no></fg_lot_no>

<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 Description

session_id Required. By Value. A long to identify the session from

which the call is being made.

row_id Required. By Value. A long to identify the existing

item_prod record.

reject_qty Required. By Value. A double specifying the reject quantity

Must be less than or equal to the current quantity for this

row.

new_reas_cd Required. By Value. A variant (long) to identify the reason

code for this rejected quantity.

new_item_id Optional. By Value. A variant (string) to identify the new

item_id. Defaults to the value in the existing row.

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.

new_user_id Optional. By Value. A variant (string) to change the user for

this rejected quantity. Defaults to the value in the existing

row.

new_to_ent_id Optional. By Value. A variant (long) to identify the new

2004 CIMNET Inc www.CimnetInc.com 143

Page 144: FactelligenceMiddleware

storage entity for the split quantity. Defaults to the value in

the existing row.

Returns

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

2004 CIMNET Inc www.CimnetInc.com 144

Page 145: FactelligenceMiddleware

Part Description

process_id Required. By Value. A string to identify the process to be

verfied.

Returns

Boolean, true if process is valid, otherwise throws an exception detailing the error.

Remarks

Checks the following characteristics of a process:

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.

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>

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 Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

user_id Required. By Value. A string to identify the user starting the

step

ent_id Required. By Value. A long to identify the entity on which the

Step is to be started. This will identify the job which contains

2004 CIMNET Inc www.CimnetInc.com 145

Page 146: FactelligenceMiddleware

this step.

step_no Required. By Value. A string to identify the step being started

lot_no Required. By Value. A string to identify the lot on which this step

is being performed.

state_cd Optional. By Value. A variant (long) to specify the state of this

step. 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)

labor_option 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)

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 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 user’s 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 step’s 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()

2004 CIMNET Inc www.CimnetInc.com 146

Page 147: FactelligenceMiddleware

<?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>

<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 Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

user_id Required. By Value. A string to identify the user stopping the

step

ent_id 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.

step_no Required. By Value. A string to identify the step being stopped

lot_no Required. By Value. A string to identify the lot on which this step

has being performed.

state_cd Optional. By Value. A variant (long) to specify the state of this

step. Only 4 (COMPLETE) or 8 (BYPASSED) are allowed.

Defaults to COMPLETE.

check_cert Optional. By Value. A variant (boolean) to specify whether to

2004 CIMNET Inc www.CimnetInc.com 147

Page 148: FactelligenceMiddleware

that required certification signoff checks have been completed

before stopping the step. Defaults to False. (Requires

Certification option to be licensed)

labor_option 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)

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 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 step’s 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>

2004 CIMNET Inc www.CimnetInc.com 148

Page 149: FactelligenceMiddleware

<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 Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

user_id Required. By Value. A string to identify the user entering the

data

ent_id 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.

step_no Required. By Value. A string to identify the step

lot_no Required. By Value. A string to identify the lot on which this step

is being performed.

data Required. By Value. A string to specify the data to be saved for

this step / lot.

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 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

2004 CIMNET Inc www.CimnetInc.com 149

Page 150: FactelligenceMiddleware

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

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 Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

user_id Required. By Value. A string to identify the user working on the

step

ent_id 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.

step_no Required. By Value. A string to identify the step being worked

on

lot_no Required. By Value. A string to identify the lot on which this step

is being performed.

lab_cd 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.

dept_id Optional. By Value. A variant (long) to specify the dept_id to

which this labor is chargeable. Defaults to current dept_id for

2004 CIMNET Inc www.CimnetInc.com 150

Page 151: FactelligenceMiddleware

this user on the entity.

event_time Optional. By Value. A variant (datetime) to specify the start time

of this labor. Used to synchronize times if required. Defaults to

Now.

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 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

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

2004 CIMNET Inc www.CimnetInc.com 151

Page 152: FactelligenceMiddleware

StepLogout (session_id, user_id, ent_id, step_no, lot_no, event_time, job_pos)

Parameters

Part Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

user_id Required. By Value. A string to identify the user working on the

step

ent_id 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.

step_no Required. By Value. A string to identify the step being worked

on

lot_no Required. By Value. A string to identify the lot on which this step

is being performed.

event_time Optional. By Value. A variant (datetime) to specify the end time

of this labor. Used to synchronize times if required. Defaults to

Now.

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 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>

2004 CIMNET Inc www.CimnetInc.com 152

Page 153: FactelligenceMiddleware

<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 user’s 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 Description

user_id Required. By Value. A string to identify the user wishing to start

the job or step.

process_id Optional. By Value. A string to identify the operation. Required if

the operation OR operation step’s certifications are to be

checked. If omitted neither the operation nor the operation

step’s certification(s) are checked.

oper_id Optional. By Value. A string to identify the operation. Required if

the operation OR operation step’s certifications are to be

checked. If omitted neither the operation nor the operation

step’s certification(s) are checked.

step_no Optional. By Value. A string to identify the operation_step.

Required if the operation step’s certifications are to be checked.

If omitted the operation_step certification is not checked.

item_id Optional. By Value. A string to identify the item_id to be made.

Required if the item’s certifications are to be checked. If omitted

the item certification is not checked.

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

2004 CIMNET Inc www.CimnetInc.com 153

Page 154: FactelligenceMiddleware

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>

CertSignoffAllowed Method

Purpose

To find out whether a job or a job step may be signed off by a specific user based on the user’s 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 Description

user_id Required. By Value. A string to identify the user wishing to sign

off the job or step.

process_id Required. By Value. A string to identify the operation. Required

if the operation OR operation step’s certifications are to be

signed off.

oper_id Required. By Value. A string to identify the operation. Required

if the operation OR operation step’s certifications are to be

2004 CIMNET Inc www.CimnetInc.com 154

Page 155: FactelligenceMiddleware

signed off.

step_no Optional. By Value. A string to identify the operation_step.

Required if the operation step’s certifications are to be checked.

If omitted the operation_step certification is not checked.

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>

<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 Description

process_id Required. By Value. A string to identify the operation. Required

if the operation OR operation step’s certification requirements

are to be checked for.

2004 CIMNET Inc www.CimnetInc.com 155

Page 156: FactelligenceMiddleware

oper_id Required. By Value. A string to identify the operation. Required

if the operation OR operation step’s certification requirements

are to be checked for.

step_no Optional. By Value. A string to identify the operation_step.

Required if the operation step’s certification requirements are to

be checked for.

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>

<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 Description

wo_id Required. By Value. A string to identify the job for which sign off

is to be checked.

oper_id Required. By Value. A string to identify the job for which sign off

2004 CIMNET Inc www.CimnetInc.com 156

Page 157: FactelligenceMiddleware

is to be checked.

seq_no Required. By Value. A long to identify the job for which sign off

is to be checked.

step_no Optional. By Value. A long to identify the job step. Required if

the any of job step’s certification sign offs are to be checked for.

cert_name 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.

lot_no Optional. By Value. A variant (string) to identify a valid lot

prod_log_id Optional. By Value. A variant (long) to identify the row_id in

item_prod table

cons_log_id Optional. By Value. A variant (long) to identify the row_id in

item_cons table

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

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>

2004 CIMNET Inc www.CimnetInc.com 157

Page 158: FactelligenceMiddleware

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 Description

session_id Required. By Value. A long to identify the session from which

the call was made.

wo_id Required. By Value. A string to identify the job for which sign off

is to be checked.

oper_id Required. By Value. A string to identify the job for which sign off

is to be checked.

seq_no Required. By Value. A long to identify the job for which sign off

is to be checked.

cert_name Required. By Value. A string to specify which certification is to

be signed off.

lot_no Optional. By Value. A variant (string) to identify a valid lot

step_no Optional. By Value. A variant (long) to identify the job step.

Required if the certification to be signed off is for a Step.

user_id Optional. By Value. A variant (string) to identify the user signing

off the job or step.

user_pw Optional. By Value. A variant (string) to specify the user’s

password. If included, the password is verified, if omitted then it

is assumed the user was authenticated when he logged in.

sign_off Optional. By Value. A variant (datetime) to specify the

certification audit time

prod_log_id Optional. By Value. A variant (long) to identify the row_id in

item_prod table

cons_log_id Optional. By Value. A variant (long) to identify the row_id in

item_cons table

comments Optional. By Value. A variant (string) to include comments

describing the audit sign off

2004 CIMNET Inc www.CimnetInc.com 158

Page 159: FactelligenceMiddleware

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>

<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

2004 CIMNET Inc www.CimnetInc.com 159

Page 160: FactelligenceMiddleware

Part Description

session_id Required. By Value. A long to identify the session from which

the call was made.

ent_id Required. By Value. A long to identify the entity for which the

specs are exposed via the Factory Connector.

wo_id 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.

oper_id Required. By Value. A string to identify the job for which the

specs are to be downloaded.

seq_no Required. By Value. A long to identify the job for which the

specs are to be downloaded.

step_no 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.

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.

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>

2004 CIMNET Inc www.CimnetInc.com 160

Page 161: FactelligenceMiddleware

</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 doesn’t know which job is currently running on an entity.

Syntax

SetActualSpecValue (session_id, ent_id, spec_id, act_spec_value, job_pos)

Parameters

Part Description

session_id Required. By Value. A long to identify the client or Factory

Connector session from which the request is being made.

ent_id 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.

spec_id Required. By Value. A string to identify the spec parameter

who’s actual value is being set.

act_spec_value Required. By Value. A string to specify the actual spec value to

be saved.

job_pos Optional. By Value. A long to identify the job position, if > 1 jobs

are running on this entity

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 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>

2004 CIMNET Inc www.CimnetInc.com 161

Page 162: FactelligenceMiddleware

<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 Description

xmlRequest 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:

<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.

2004 CIMNET Inc www.CimnetInc.com 162

Page 163: FactelligenceMiddleware

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"?><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>

2004 CIMNET Inc www.CimnetInc.com 163

Page 164: FactelligenceMiddleware

<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><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>

2004 CIMNET Inc www.CimnetInc.com 164

Page 165: FactelligenceMiddleware

</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 doesn’t know which job is currently running on an entity.

Syntax

SetAttr (session_id, ent_id, attr_id, attr_value, job_pos)

Parameters

Part Description

session_id Required. By Value. A long to identify the client or Factory

Connector session from which the request is being made.

ent_id 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.

attr_id Required. By Value. A string to identify the attribute who’s value

is being set.

attr_value Required. By Value. A string to specify the actual attribute value

to be saved.

job_pos Optional. By Value. A long to identify the job position, if > 1 jobs

are running on this entity

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

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>

2004 CIMNET Inc www.CimnetInc.com 165

Page 166: FactelligenceMiddleware

<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 Description

session_Id Required. By Value. A variant (long) to identify the client session from which the request is being made.

wo_id Required. By Value. A variant (string) to identify the Work Order Id

new_priority Required. By Value. A variant (long) to identify the new Priority for all the jobs

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:

<?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>

2004 CIMNET Inc www.CimnetInc.com 166

Page 167: FactelligenceMiddleware

</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 Description

session_Id Required. By Value. A variant (long) to identify the client session from which the request is being made

wo_id Required. By Value. A variant (string) to identify the Work Order Id

req_finish_time 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>

<session_id>111</session_id>

<wo_id>SampleWO-CIMWO1</wo_id>

<req_finish_time>12/30/2002</req_finish_time>

</request>

ChangeWOQtys Method

2004 CIMNET Inc www.CimnetInc.com 167

Page 168: FactelligenceMiddleware

Purpose

Change Starting and Required Quantities for a Work Order.

Syntax

ChangeWOQtys (session_id, wo_id, qty_reqd, qty_at_start)

Parameters

Part Description

session_Id Required. By Value. A variant (long) to identify the client session from which the request is being made.

wo_id Required. By Value. A variant (string) to identify the Work Order Id

qty_reqd Required. By Value. A variant (long) to identify the Required Quantity

qty_at_start Required. By Value. A variant (long) to identify the starting quantity

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

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>

<qty_reqd>100</qty_reqd>

<qty_at_start>75</qty_at_start>

</request>

StartNextJobViaFC Method

Purpose

2004 CIMNET Inc www.CimnetInc.com 168

Page 169: FactelligenceMiddleware

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 Description

session_id Required. By Value. A long to identify the session from which

the job is being started.

user_id Required. By Value. A string to identify the user_id starting the

job.

ent_id Required. By Value. A long to identify the entity on which the job

is to be run.

job_pos 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)

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 formatted to include the required method parameters as follows:

<?xml version="1.0"?>

<request>

<object>job_exec</object>

<msgtype>exec</ msgtype >

<cmd>StartNextJobViaFC</cmd>

2004 CIMNET Inc www.CimnetInc.com 169

Page 170: FactelligenceMiddleware

<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 parameter’s 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 Description

session_id Required. By Value. A long to identify the client or Factory

Connector session from which the request is being made.

user_id 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.

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.

spec_id Required. By Value. A string to identify the spec parameter who’s value is being changed.

new_spec_value Required. By Value. A string to specify the new spec value to

replace the existing one.

update_template 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.

bom_pos Optional. By Value. A variant (long) to specify the bom_pos

bom_ver_id Optional. By Value. A variant (string) to specify the bom

version id

job_pos 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)

2004 CIMNET Inc www.CimnetInc.com 170

Page 171: FactelligenceMiddleware

comments 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.

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>

</request>

GetSchedulableEntities Method

2004 CIMNET Inc www.CimnetInc.com 171

Page 172: FactelligenceMiddleware

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 Description

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

oper_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>

GetReqdCertSignoffs Method

2004 CIMNET Inc www.CimnetInc.com 172

Page 173: FactelligenceMiddleware

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 Description

wo_id Required. By Value. A string to identify the WO for which

required signoff certifications are to be returned.

oper_id Required. By Value. A string to identify the WO operation for

which required signoff certifications are to be returned.

step_no 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.

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>

<oper_id>10</oper_id>

<step_no>1</step_no>

</request>

2004 CIMNET Inc www.CimnetInc.com 173

Page 174: FactelligenceMiddleware

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 Description

wo_id Required. By Value. A string to identify the WO for which

required signoff certifications are to be returned.

oper_id Required. By Value. A string to identify the WO operation for

which required signoff certifications are to be returned.

seq_no Required. By Value. A long to identify the job.

step_no 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.

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()

<?xml version="1.0"?>

<request>

<object>job_exec</object>

2004 CIMNET Inc www.CimnetInc.com 174

Page 175: FactelligenceMiddleware

<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 Description

session_id Required. By Value. A long to identify the session from

which the call is being made.

ent_id Required. By Value. A long to identify the currently running

job to which this event applies if any.

event_time Optional. By Value. A variant (datetime) to specify the

timestamp for this event. Defaults to Now.

job_pos Optional. By Value. A variant (long) to identify the job

position if > 1 jobs are currently running on this entity .

Defaults to 0.

step_no Optional. By Value. A variant (long) to identify the step for

which this event applies if any. Defaults to null.

event_type Optional. By Value. A variant (string) to categorize this

event to facilitate retrieval filters. Defaults to null.

bom_pos Optional. By Value. A variant (long) to identify the bom_pos

to which this event applies if any. Defaults to null.

lot_no Optional. By Value. A variant (string) to specify the lot_no

to which this event applies if any. Defaults to null.

2004 CIMNET Inc www.CimnetInc.com 175

Page 176: FactelligenceMiddleware

item_id Optional. By Value. A variant (string) to specify the item_id

to which this event applies if any. Defaults to null.

cert_name Optional. By Value. A variant (string) to specify the

certification to which this event applies if any. Defaults to

null.

done_by_user_id Optional. By Value. A variant (string) to identify the user

that performed an action if any. Defaults to null.

checked_by_user_id Optional. By Value. A variant (string) to identify the user

that checked an action if any. Defaults to null.

item_prod_row_id 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.

item_cons_row_id 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.

spec_id Optional. By Value. A variant (string) to specify a

specification parameter to which this event applies if any.

Defaults to null.

comments Optional. By Value. A variant (string) to specify any

comments that apply to this event if any. Defaults to null.

value1 – value10 Optional. By Value. Variants (string) to specify any

additional user defined values that apply to this event if

any. All default to null.

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>

2004 CIMNET Inc www.CimnetInc.com 176

Page 177: FactelligenceMiddleware

<session_id>1248</session_id><ent_id>1</ent_id>

<event_time></event_time> <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 Description

wo_id Required. By Value. A string to identify the WO

oper_id Required. By Value. A string to identify the WO operation

seq_no Required. By Value. A long to identify the job.

step_no Required. By Value. A long to identify the job step.

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.

2004 CIMNET Inc www.CimnetInc.com 177

Page 178: FactelligenceMiddleware

Remarks

This method is useful when job bom and job bom step data (if linked) needs to be accessed within a 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 parameter’s 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 Description

session_id Required. By Value. A long to identify the client or Factory

Connector session from which the request is being made.

user_id 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.

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.

spec_id Required. By Value. A string to identify the spec parameter

who’s value is being changed.

new_spec_value Optional. By Value. A string to specify the new spec value to

2004 CIMNET Inc www.CimnetInc.com 178

Page 179: FactelligenceMiddleware

replace the existing one.

new_min_value Optional. By Value. A string to specify the new min_value to

replace the existing one.

new_max_value Optional. By Value. A string to specify the new max_value to

replace the existing one.

update_template 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.

check_privs Optional. By Value. A variant (boolean) to specify whether the

user’s privileges should be checked before executing this

action Defaults to False.

bom_pos Optional. By Value. A variant (long) to specify the bom_pos.

Defaults to 0

bom_ver_id Optional. By Value. A variant (string) to specify the bom

version id

comments 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.

job_pos 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)

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.

User’s access level is validated against the Specifications. User’s 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).

2004 CIMNET Inc www.CimnetInc.com 179

Page 180: FactelligenceMiddleware

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. 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 Description

session_id Required. By Value. A long to identify the client or Factory

Connector session from which the request is being made.

2004 CIMNET Inc www.CimnetInc.com 180

Page 181: FactelligenceMiddleware

user_id 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.

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.

check_privs Optional. By Value. A variant (boolean) to specify whether the

user’s privileges should be checked before executing this action

Defaults to False.

job_pos 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)

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>

2004 CIMNET Inc www.CimnetInc.com 181

Page 182: FactelligenceMiddleware

GetRunnableEntities Method

Purpose

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

Syntax

GetRunnableEntities(ent_id)

Parameters

Part Description

ent_id Required. By Value. A variant (string) to identify the 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>

GetSchedulableEntity Method

Purpose

To return an entity that can schedule a job.

Syntax

GetSchedulableEntity(ent_id)

Parameters

Part Description

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

Returns

ADODB.recordset. Recordset columns are: ent_id

Remarks

2004 CIMNET Inc www.CimnetInc.com 182

Page 183: FactelligenceMiddleware

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()

<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 Description

ent_id Required. By Value. A variant (string) to identify the 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>

GetJobQueue Method

Purpose

2004 CIMNET Inc www.CimnetInc.com 183

Page 184: FactelligenceMiddleware

To return a recordset containing a list of all jobs in a work order

Syntax

GetJobQueue(wo_id, item_id)

Parameters

Part Description

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

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

Returns

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 Description

session_id Required. By Value. A variant (long) to identify the valid session

from which the job is being started.

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

2004 CIMNET Inc www.CimnetInc.com 184

Page 185: FactelligenceMiddleware

starting the job.

ent_id Required. By Value. A variant (long) to identify the entity on

which the job is to be run.

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

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

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

est_prod_rate Required. By Value. A variant (double) to identify the estimated

production rate.

uom_id Optional. By Value. A variant (long) to identify the uom_id.

Defaults to Null.

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 job’s item. The supplied est_prod_rate is updated with the existing job’s record, if the supplied est_prod_rate does not match with the existing est_prod_rate column in the job’s 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()

2004 CIMNET Inc www.CimnetInc.com 185

Page 186: FactelligenceMiddleware

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>

<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 Description

session_id Required. By Value. A variant (long) to identify the valid

session from which the job is being started.

from_ent_id Required. By Value. A variant (long) to identify the entity where

the item is consumed from the inventory.

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

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

qty_cons Required. By Value. A variant (double) specifying the quantity

to be consumed from the inventory.

reas_cd Required. By Value. A variant (long) specifying the reason code

for this quantity consumed.

grade_cd Required. By Value. A variant (long) specifying the grade code

for this quantity consumed.

status_cd Required. By Value. A variant (long) specifying the status code

2004 CIMNET Inc www.CimnetInc.com 186

Page 187: FactelligenceMiddleware

for this quantity consumed.

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

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

Defaults to Null.

oper_id Optional. By Value. A variant (string) to identify the oper_id.

Defaults to Null.

seq_no Optional. By Value. A variant (long) to identify the seq_no.

Defaults to Null.

shift_start Optional. By Value. A variant (datetime) to identify the

shift_start. Defaults to Null.

fg_lot_no Optional. By Value. A variant (string) to identify the fg_lot_no.

Defaults to Null.

item_scrapped Optional. By Value. A variant (int) to specify the item_scrapped.

Defaults to 0.

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

Defaults to Null.

shift_id Optional. By Value. A variant (long) to identify the shift_id.

Defaults to 0.

qty_cons_erp Optional. By Value. A variant (double) to identify the

qty_cons_erp. Defaults to 0.

ext_ref Optional. By Value. A variant (string) to identify the ext_ref.

transaction_type Optional. By Value. A variant (long) to identify the

transaction_type. Defaults to 0.

spare1 Optional. By Value. A variant (string) to include optional spare

fields for this row. Defaults to Null.

spare2 Optional. By Value. A variant (string) to include optional spare

fields for this row. Defaults to Null.

spare3 Optional. By Value. A variant (string) to include optional spare

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.

row_id 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.

2004 CIMNET Inc www.CimnetInc.com 187

Page 188: FactelligenceMiddleware

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 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>

2004 CIMNET Inc www.CimnetInc.com 188

Page 189: FactelligenceMiddleware

Job_Event Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

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() No specific recordsets currently supported

Add() Not supported: Use job_exec.LogJobEvent() instead

Update()

UpdateSpecific()

Delete()

DeleteAll() Not supported: Not have composite primary key

ExecuteXMLCmd()

IsValid()

Job_Sched_Exec Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() The following columns are not available as filters: queue_time, sort_order, filter.

GetByKey()

GetSpecificRS() Retrieval of the following specific recordsets are supported:

GetRefreshedShiftSched ().

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll() Not supported: Table does not have composite primary key.

2004 CIMNET Inc www.CimnetInc.com 189

Page 190: FactelligenceMiddleware

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

ApplySchedule()

GetRefreshedShiftSched() (Stub only – not implemented yet)

CreateTempShiftExc() (Stub only – not implemented yet)

RefreshTempShiftExc()

DropTempShiftExc()

CreateWOAltInfo() (Stub only – not implemented yet)

CreateWOJobs() (Stub only – not implemented yet)

DropWOAltInfo() (Stub only – not implemented yet)

ApplySchedule Method

Purpose

To apply the specified schedule in one transaction.

Syntax

ApplySchedule (session_id, schedule)

Parameters

Part Description

session_Id Required. By Value. A variant (long) to identify the client session from which the request is being made.

schedule Required. By Value. A variant (string) containing an XML string listing the new 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.):

2004 CIMNET Inc www.CimnetInc.com 190

Page 191: FactelligenceMiddleware

<?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>)

(<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>)

2004 CIMNET Inc www.CimnetInc.com 191

Page 192: FactelligenceMiddleware

(<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>

<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>)

2004 CIMNET Inc www.CimnetInc.com 192

Page 193: FactelligenceMiddleware

(<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>)

(<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 Description

session_id Required. By Value. A variant (long) to identify a valid session to identify the data to be refreshed from shift_exc.

Returns

True if successfully refreshed, else False.

RemarksEach 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”>

2004 CIMNET Inc www.CimnetInc.com 193

Page 194: FactelligenceMiddleware

<request>

<object>job_sched_exec</object>

<cmd>RefreshTempShiftExc</cmd>

<msgtype>exec</msgtype>

<session_id>12121</session_id>

</request>

DropTempShiftExc Method

Purpose

Deletes the data from Temp_Shift_Exc table.

Syntax

DropTempShiftExc (session_id)

Parameters

Part Description

session_id Required. By Value. A variant (long) to identify a valid session

Returns

True if successfully refreshed, else False.

RemarksEach 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>

CreateWOAltInfo Method

Purpose

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

2004 CIMNET Inc www.CimnetInc.com 194

Page 195: FactelligenceMiddleware

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.

Job_State Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() All fields except last_edit_comment are permitted as optional filter parameters

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

WO Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

2004 CIMNET Inc www.CimnetInc.com 195

Page 196: FactelligenceMiddleware

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific() mod_id is optional

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Wo_Attr Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Job Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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_idIf any of the req_finish_time, sched_start_time, latest_start_time or

2004 CIMNET Inc www.CimnetInc.com 196

Page 197: FactelligenceMiddleware

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() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

GetCanLogDataCapability

GetDisplaySeq()

GetNextSeqNo()

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 Description

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

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

seq_no Required. By Value. A variant (long) to identify the seq_no

can_log_data Optional. By Ref. A variant (long) resulting the can_log_data capability

Returns

2004 CIMNET Inc www.CimnetInc.com 197

Page 198: FactelligenceMiddleware

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>

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 Description

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

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

display_seq Required. By Ref. A variant (long) resulting the next available display seq_no.

Returns

2004 CIMNET Inc www.CimnetInc.com 198

Page 199: FactelligenceMiddleware

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>

<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 Description

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

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

next_seq_no Required. By Ref. A variant (long) resulting the next available 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

2004 CIMNET Inc www.CimnetInc.com 199

Page 200: FactelligenceMiddleware

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><next_seq_no>1</next_seq_no>

</response>

Job_Attr Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Job_Route Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

2004 CIMNET Inc www.CimnetInc.com 200

Page 201: FactelligenceMiddleware

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

GetAllbyXML() As for GetAll()

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()

GetJobPath Method

Purpose

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

Syntax

GetJobPath (wo_id, sort_ascending)

Parameters

Part Description

wo_id Required. By Value. A variant (string) to identify the Work Order Id

sort_order Optional. By Value. A variant (Boolean) to determine the sort order (default is True)

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()

2004 CIMNET Inc www.CimnetInc.com 201

Page 202: FactelligenceMiddleware

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>

GetJobRoute Method

Purpose

Returns the record set needed to build the routing diagram for a work order.

Syntax

GetJobRoute (wo_id)

Parameters

Part Description

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

Returns

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>

2004 CIMNET Inc www.CimnetInc.com 202

Page 203: FactelligenceMiddleware

Item_Prod Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

GetSpecificRS() No specific recordsets currently supported

Add() Not supported. Use job_exec.AddProd() and AddProdPostExec() to add rows to this table.

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

Split() 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

2004 CIMNET Inc www.CimnetInc.com 203

Page 204: FactelligenceMiddleware

Part Description

session_id Required. By Value. A long to identify the session from

which the call is being made.

old_row_id Required. By Value. A long to identify the existing row_id

on which the production has to be splitted

split_qty_prod 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.

new_wo_id Optional. By Value. A variant (string) to identify the new

wo_id. Defaults to the value in the existing row.

new_oper_id Optional. By Value. A variant (string) to identify the new

oper_id. Defaults to the value in the existing row.

new_seq_no Optional. By Value. A variant (long) to identify the new

seq_no. Defaults to the value in the existing row.

new_shift_start Optional. By Value. A variant (date) to identify the new shift

during which this production occurred. Defaults to the value

in the existing row.

new_item_id Optional. By Value. A variant (string) to identify the new

item_id. Defaults to the value in the existing row.

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.

new_reas_cd 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.

new_user_id Optional. By Value. A variant (string) to identify the new

user for this quantity produced. Defaults to the value in the

existing row.

new_ent_id 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.

new_shift_id Optional. By Value. A variant (long) to identify the new shift

ID. Defaults to the value in the existing row.

new_to_ent_id Optional. By Value. A variant (long) to identify the new

storage entity for the split quantity. Defaults to the value in

the existing row.

2004 CIMNET Inc www.CimnetInc.com 204

Page 205: FactelligenceMiddleware

split_qty_prod_erp 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.

split_processed_flag Optional. By Value. A variant (boolean) to specify the

processed flag value for the split quantity. Defaults to the

value in the existing row.

split_byproduct_flag 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.

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.

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>

2004 CIMNET Inc www.CimnetInc.com 205

Page 206: FactelligenceMiddleware

<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:

STANDARD METHODS COMMENTS

GetAll() The following columns ARE available as filters: process_class_id, last_edit_by, last_edit_at

GetAllbyXML() The following columns ARE available as filters: process_class_id, last_edit_by, last_edit_at

GetByKey()

GetSpecificRS() No specific recordsets currently supported.

Add()

Update() Not supported: No dependent data

UpdateSpecific() Not supported: No dependent data

Delete()

DeleteAll() Not supported: Table does not have composite primary key.

ExecuteXMLCmd()

IsValid()

2004 CIMNET Inc www.CimnetInc.com 206

Page 207: FactelligenceMiddleware

Process Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

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.

Update() Not supported as many fields are updated automatically. Use UpdateSpecific() instead.

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.

Delete() The session_id and user_id must be included as parameters.

DeleteAll() Not supported – use Delete().

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

Clone() Clone an existing Process to a new Process

CheckIn() CheckIn a process that a user has checked out

CheckOut() Checkout a process for a user to edit.

GetNextVerId() Returns the next process version id in the process class

2004 CIMNET Inc www.CimnetInc.com 207

Page 208: FactelligenceMiddleware

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 Description

session_Id Required. By Value. A variant (long) to identify the client session from which the request is being made.

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

existing_process_id Required. By Value. A variant (string) to identify the source Process Id

new_process_id Required. By Value. A variant (string) to identify the new Process Id.

new_process_desc Required. By Value. A variant (string) to identify the new process description

new_process_ver_id Optional. By Value. A variant (string) to identify the new process version id

disassociate_items 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.

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>

2004 CIMNET Inc www.CimnetInc.com 208

Page 209: FactelligenceMiddleware

<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 Description

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

process_Id Required. By Value. A variant (string) to identify the 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 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>

2004 CIMNET Inc www.CimnetInc.com 209

Page 210: FactelligenceMiddleware

CheckOut Method

Purpose

Checkout a process for a user to edit.

Syntax

Checkout (user_id, process_id)

Parameters

Part Description

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

process_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

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

2004 CIMNET Inc www.CimnetInc.com 210

Page 211: FactelligenceMiddleware

Purpose

Returns the next process version id in the process class.

Syntax

GetNextVerId(process_class_id, next_process_ver_id)

Parameters

Part Description

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

process class id

next_process_ver_id Required. By Ref. A Variant (string) resulting the next

process version 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>

<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

2004 CIMNET Inc www.CimnetInc.com 211

Page 212: FactelligenceMiddleware

Part Description

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

oper_id Required. By Value. A variant (string) to identify the Operation

item_id Required. By Value. A variant (string) to identify the final item produced by the process.

item_produced 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>

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 Description

2004 CIMNET Inc www.CimnetInc.com 212

Page 213: FactelligenceMiddleware

process_id Optional. By Value. A variant (string) to identify the process.

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

oper_exist Optional. By Value. A variant (long) to specify the oper_exist flag. Defaults to 0.

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>

Process_Attr Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

2004 CIMNET Inc www.CimnetInc.com 213

Page 214: FactelligenceMiddleware

DeleteAll()

ExecuteXMLCmd()

IsValid()

Item_Process_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following columns are NOT available as filters: last_edit_comment, row_idThe 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

GetNextItemPref Returns the next available item preference number

GetNextItemPref Method

Purpose

Returns the next available item preference number.

Syntax

GetNextItemPref(process_id)

Parameters

Part Description

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

Returns

Long.

Remarks

2004 CIMNET Inc www.CimnetInc.com 214

Page 215: FactelligenceMiddleware

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 COMMENTS

GetAll() 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Oper_Attr Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

2004 CIMNET Inc www.CimnetInc.com 215

Page 216: FactelligenceMiddleware

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Oper_Ent_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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_idThe following columns are also included in the returned recordset : ent.ent_name, process.process_desc

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

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:Delete All rows in the oper_ent_route table where this row is an input or an output operation.

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

GetCanLogDataCapability

GetCanLogDataCapability Method

2004 CIMNET Inc www.CimnetInc.com 216

Page 217: FactelligenceMiddleware

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 Description

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

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

Step_no Required. By Value. A variant (long) to identify the step_no

can_log_data Optional. By Ref. A variant (long) resulting the can_log_data capability

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>

2004 CIMNET Inc www.CimnetInc.com 217

Page 218: FactelligenceMiddleware

Oper_Ent_Route Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following columns are NOT available as filters: last_edit_comment, row_idThe 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)

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Oper_Ent_Item_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

OEE_Exec Class

Summary of the methods supported by this class:

2004 CIMNET Inc www.CimnetInc.com 218

Page 219: FactelligenceMiddleware

STANDARD METHODS COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to increase performance: target_perf, current_perf, target_qual, current_qual, def_prod_rate, target_oee, current_oee, last_edit_commentThe 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() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

TPM_Stat Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Lot_Attr Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following columns are NOT permitted as filters: last_edit_comment,

2004 CIMNET Inc www.CimnetInc.com 219

Page 220: FactelligenceMiddleware

row_idThe following columns are also included in the returned recordset : attr.attr_desc, attr.data_type, item.item_desc

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update() Not supported as there are no dependent fields

UpdateSpecific() Not supported as there are no dependent fields

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

2004 CIMNET Inc www.CimnetInc.com 220

Page 221: FactelligenceMiddleware

EnProd DLL Enhanced Methods

BOM_Ver Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

Clone()

Copy()

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 Description

session_id Required. By Value. A variant (long) to identify the client session from

2004 CIMNET Inc www.CimnetInc.com 221

Page 222: FactelligenceMiddleware

which the request is being made.

existing_item_id Required. By Value. A variant (string) to identify the item_id of the BOM version being cloned.

existing_ver_id Required. By Value. A variant (string) to identify the ver_id of the BOM version being cloned

new_item_id Required. By Value. A variant (string) to identify the item_id for the new BOM version.

new_ver_id Required. By Value. A variant (string) to identify the ver_id for the new BOM version.

new_ver_comments Optional. By Value. A variant (string) to identify the BOM version comments for the newly cloned bom

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 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

2004 CIMNET Inc www.CimnetInc.com 222

Page 223: FactelligenceMiddleware

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

Syntax

Copy (session_id, existing_parent_item_id, existing_ver_id, new_parent_item_id, new_ver_id, new_ver_comments)

Parameters

Part Description

session_id Required. By Value. A variant (long) to identify the client session from which the request is being made.

existing_item_id Required. By Value. A variant (string) to identify the item_id of the BOM version being cloned.

existing_ver_id Required. By Value. A variant (string) to identify the ver_id of the BOM version being cloned

new_item_id Required. By Value. A variant (string) to identify the item_id for the new BOM version.

new_ver_id Required. By Value. A variant (string) to identify the ver_id for the new BOM version.

new_ver_comments Optional. By Value. A variant (string) to identify the BOM version comments for the newly copied bom

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 >

2004 CIMNET Inc www.CimnetInc.com 223

Page 224: FactelligenceMiddleware

<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>

BOM_Item Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

BOM_Item_Oper_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

2004 CIMNET Inc www.CimnetInc.com 224

Page 225: FactelligenceMiddleware

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()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

ChangeProducedItem() 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 Description

session_Id Required. By Value. A variant (long) to identify the client session from which the request is being made.

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

oper_id Required. By Value. A variant (string) to identify the operation

old_item_id Required. By Value. A variant (string) to identify the item currently produced

old_ver_id Required. By Value. A variant (string) to identify the BOM version currently being used

new_item_id Required. By Value. A variant (string) to identify the item that should be produced

new_ver_id Required. By Value. A variant (string) to identify the BOM version that should be used

Returns

Boolean. True if the update is made or False if the update fails.

Remarks

2004 CIMNET Inc www.CimnetInc.com 225

Page 226: FactelligenceMiddleware

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

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 Description

parent_item_id Required. By Value. A Variant (string) to identify the item being

produced at the operation.

ver_id Required. By Value. A Variant (string) to identify the version of

the BOM.

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

being used to produce the item.

oper_id Required. By Value. A Variant (string) to identify the operation

being performed..

Returns

2004 CIMNET Inc www.CimnetInc.com 226

Page 227: FactelligenceMiddleware

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

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 COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific() mod_id is optional

Delete()

2004 CIMNET Inc www.CimnetInc.com 227

Page 228: FactelligenceMiddleware

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

GetJobBomData() To return a recordset containing all job bom records for a specific work order with the values substituted if any.

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 Description

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

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

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

bom_pos Optional. By Value. A Variant (long) to identify the 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>

2004 CIMNET Inc www.CimnetInc.com 228

Page 229: FactelligenceMiddleware

<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>

Item_Cons Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

GetSpecificRS() No specific recordsets currently supported

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

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

Split() Used to split a production row eg if some produced goods are rejected.

Split Method

Purpose

2004 CIMNET Inc www.CimnetInc.com 229

Page 230: FactelligenceMiddleware

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

session_id Required. By Value. A long to identify the session from which

the call is being made.

old_row_id Required. By Value. A long to identify the existing

consumption row id to be splitted

split_qty_cons 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.

new_wo_id Optional. By Value. A variant (string) to identify the new

wo_id. Defaults to the value in the existing row.

new_oper_id Optional. By Value. A variant (string) to identify the new

oper_id. Defaults to the value in the existing row.

new_seq_no Optional. By Value. A variant (long) to identify the new

seq_no. Defaults to the value in the existing row.

new_shift_start Optional. By Value. A variant (date) to identify the new shift

during which this consumption occurred. Defaults to the value

in the existing row.

new_item_id Optional. By Value. A variant (string) to identify the new

item_id that was consumed. Defaults to the value in the

existing row.

new_lot_no Optional. By Value. A variant (string) to identify the new lot number for this quantity consumed. Defaults to the value in the existing row.

.

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.

new_reas_cd 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.

new_user_id Optional. By Value. A variant (string) to identify the new user

2004 CIMNET Inc www.CimnetInc.com 230

Page 231: FactelligenceMiddleware

for this quantity consumed. Defaults to the value in the

existing row.

new_ent_id 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.

new_shift_id Optional. By Value. A variant (long) to identify the new shift

ID. Defaults to the value in the existing row.

new_from_ent_id Optional. By Value. A variant (long) to identify the new

storage entity for the split quantity. Defaults to the value in

the existing 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"?>

2004 CIMNET Inc www.CimnetInc.com 231

Page 232: FactelligenceMiddleware

<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>

<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 COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

2004 CIMNET Inc www.CimnetInc.com 232

Page 233: FactelligenceMiddleware

DeleteAll()

ExecuteXMLCmd()

IsValid()

Bom_Item_Subst Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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_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() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Job_Bom_Subst Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

2004 CIMNET Inc www.CimnetInc.com 233

Page 234: FactelligenceMiddleware

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Oper_Step_Grp Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to increase performance: step_grp_desc, last_edit_comment, row_id

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Oper_Step Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

2004 CIMNET Inc www.CimnetInc.com 234

Page 235: FactelligenceMiddleware

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Oper_Step_File Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to increase performance: assoc_file, assoc_file_type, last_edit_comment, row_id

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Oper_Step_Ent_Exc Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update() Not supported as there are no dependent fields

UpdateSpecific() Not supported as there are no dependent fields

Delete()

2004 CIMNET Inc www.CimnetInc.com 235

Page 236: FactelligenceMiddleware

DeleteAll()

ExecuteXMLCmd()

IsValid()

BOM_Item_Oper_Step_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

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()

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 Description

parent_item_id Required. By Value. A Variant (string) to identify the item being

produced at the operation.

ver_id Required. By Value. A Variant (string) to identify the version of

the BOM.

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

2004 CIMNET Inc www.CimnetInc.com 236

Page 237: FactelligenceMiddleware

being used to produce the item.

oper_id Required. By Value. A Variant (string) to identify the operation

being performed.

step_no Required. By Value. A Variant (long) to identify the step being

performed.

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>

<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 COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to increase performance: step_grp_desc, last_edit_comment, row_id

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

2004 CIMNET Inc www.CimnetInc.com 237

Page 238: FactelligenceMiddleware

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Job_Step Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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_idThe 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

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 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 COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to increase performance: assoc_file, assoc_file_type, last_edit_comment, row_id

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

2004 CIMNET Inc www.CimnetInc.com 238

Page 239: FactelligenceMiddleware

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Job_BOM_Step Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Job_Step_Data Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to increase performance: step_data, step_data_time, last_edit_comment, row_idIf 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.

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

2004 CIMNET Inc www.CimnetInc.com 239

Page 240: FactelligenceMiddleware

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Spec Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Oper_Spec_Ver Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to increase performance: ver_comments, last_edit_comment, mod_id, row_idIf 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

2004 CIMNET Inc www.CimnetInc.com 240

Page 241: FactelligenceMiddleware

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Oper_Ent_Spec Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

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()

GetSpecs Method

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 Description

2004 CIMNET Inc www.CimnetInc.com 241

Page 242: FactelligenceMiddleware

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

oper_id Required. By Value. A Variant (string) to identify the operation.

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

ver_id Required. By Value. A Variant (string) to BOM version.

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

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>

GetItemEntSpecs Method

Purpose

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 Description

2004 CIMNET Inc www.CimnetInc.com 242

Page 243: FactelligenceMiddleware

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

Oper_id Required. By Value. A variant (string) to identify the oper_id

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

item_id Required. By Value. A variant (string) to identify the 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>

BOM_Item_Oper_Spec Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to increase performance: assoc_file, assoc_file_type, comments, min_value, max_value, 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

2004 CIMNET Inc www.CimnetInc.com 243

Page 244: FactelligenceMiddleware

(spec_id), spec.units, spec.spare1-4, spec.data_type

GetAllbyXML() As for GetAll()

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()

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 Description

item_id Required. By Value. A Variant (string) to identify the item.

ver_id Required. By Value. A Variant (string) to BOM version.

bom_pos Required. By Value. A Variant (long) to identify the item’s

position in the BOM.

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

oper_id Required. By Value. A Variant (string) to identify the operation.

spec_ver_id Required. By Value. A Variant (string) to identify the version of

the specification.

Returns

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

2004 CIMNET Inc www.CimnetInc.com 244

Page 245: FactelligenceMiddleware

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 COMMENTS

GetAll() 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() As for GetAll()

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()

IsValid()

2004 CIMNET Inc www.CimnetInc.com 245

Page 246: FactelligenceMiddleware

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 Description

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

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

seq_no Required. By Value. A variant (long) to identify the seq_no

step_no Required. By Value. A variant (long) to identify the 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>

Storage_Exec Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following columns are NOT available as filters: last_edit_comment

2004 CIMNET Inc www.CimnetInc.com 246

Page 247: FactelligenceMiddleware

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() As above

GetByKey()

GetSpecificRS() 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() Not supported. Use job_exec.AddCons() and AddConsPostExec() to add rows to this table.

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

AddInv()

ReduceInv()

Transfer()

TransferAndUpdateInv()

Split()

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 Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

user_id Required. By Value. A string to identify the user.

2004 CIMNET Inc www.CimnetInc.com 247

Page 248: FactelligenceMiddleware

ent_id Required. By Value. A long to identify the storage entity to

which we are adding the quantity of inventory.

item_id Required. By Value. A string to identify the item_id

grade_cd Required. By Value. A long to identify the grade of the added

item(s)

status_cd Required. By Value. A long to identify the state of the added

item(s)

add_qty Required. By Value. A double specifying the quantity to be

added.

lot_no Optional. By Value. A string to identify the lot number

add_qty_erp Optional. By Value. A variant (double) specifying how much of

the added quantity has already been reported to the ERP

system. Defaults to 0.

date_in Optional. By Value. A variant (date) specifying when this

quantity was received into this location. Defaults to Now.

expiry_date Optional. By Value. A variant (date) specifying when this

quantity will expire. Defaults to Null (never).

wo_id Optional. By Value. A variant (string) to identify a wo_id that

produced this quantity. Defaults to Null.

oper_id Optional. By Value. A variant (string) identify the oper_id that

produced this quantity. Defaults to Null.

seq_no Optional. By Value. A variant (long) to identify the seq_no that

produced this quantity. Defaults to Null.

from_ent_id Optional. By Value. A variant (long) to identify the entity from

which these item(s) where transferred, if any.

goods_received 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.

checkgradestatus Optional. By Value. A variant (Boolean) to specify whether to

make a check on Grade and Status

row_id 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.

Returns

2004 CIMNET Inc www.CimnetInc.com 248

Page 249: FactelligenceMiddleware

Integer. 0 if successful, else -1

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

2004 CIMNET Inc www.CimnetInc.com 249

Page 250: FactelligenceMiddleware

Part Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

user_id Required. By Value. A string to identify the user.

ent_id Required. By Value. A long to identify the storage entity from

which we are reducing the quantity of inventory.

item_id Required. By Value. A string to identify the item_id

grade_cd Required. By Value. A long to identify the unique storage

location

status_cd Required. By Value. A long to identify the unique storage

location

reduce_qty Required. By Value. A double specifying the quantity to be

removed.

lot_no Optional. By Value. A string to identify the lot number

reduce_qty_erp Optional. By Value. A variant (double) specifying how much of

the removed quantity has already been reported to the ERP

system. Defaults to 0.

date_out Optional. By Value. A variant (date) specifying when this

quantity was removed from this location. Defaults to Now.

goods_shipped 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.

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 doesn’t 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.

2004 CIMNET Inc www.CimnetInc.com 250

Page 251: FactelligenceMiddleware

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_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 Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

user_id Required. By Value. A string to identify the user.

from_ent_id Required. By Value. A long to identify the storage entity FROM

which we are transferring the quantity of inventory.

to_ent_id Required. By Value. A long to identify the storage entity TO

which we are transferring the quantity of inventory.

item_id Required. By Value. A string to identify the item_id

lot_no Required. By Value. A string to identify the lot number

2004 CIMNET Inc www.CimnetInc.com 251

Page 252: FactelligenceMiddleware

transfer_qty Required. By Value. A double specifying the quantity to be

transferred.

transfer_qty_erp Optional. By Value. A variant (double) specifying how much of

the transferred quantity has already been reported to the ERP

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)

2004 CIMNET Inc www.CimnetInc.com 252

Page 253: FactelligenceMiddleware

Parameters

Part Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

user_id Required. By Value. A string to identify the user.

old_row_id Required. By Value. A long to identify the storage location

split_qty Required. By Value. A double specifying the quantity to be split.

new_ent_id 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.

new_item_id Optional. By Value. A variant (string) to specify the item_id of

the new row. Defaults to value in split source row.

new_lot_no Optional. By Value. A variant (string) to specify the lot number

of the new row. Defaults to value in split source row.

new_grade_cd Optional. By Value. A variant (long) to specify the grade of the

new row. Defaults to value in split source row.

new_status_cd Optional. By Value. A variant (long) to specify the status of the

new row. Defaults to value in split source row.

split_qty_erp Optional. By Value. A variant (double) specifying how much of

the split quantity has already been reported to the ERP system.

Defaults to 0.

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

2004 CIMNET Inc www.CimnetInc.com 253

Page 254: FactelligenceMiddleware

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:

<?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 Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

user_id Required. By Value. A string to identify the user.

from_ent_id Required. By Value. A long to identify the storage entity FROM

which we are transferring the quantity of inventory.

item_id Required. By Value. A string to identify the item_id

transfer_qty Required. By Value. A double specifying the quantity to be

transferred.

2004 CIMNET Inc www.CimnetInc.com 254

Page 255: FactelligenceMiddleware

transfer_option 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.Transfer Option 1 :- Source row’s Grade Code, Status Code and Expiry date must match with Destination row’s Grade Code, Status Code and Expiry date. If not an error is returned.Transfer Option 2:- Even if source row’s Grade Code, Status

Code and Expiry Date do not match a possible destination

row’s Grade Code, Status Code and Expiry Date, the original

destination row’s Grade Code, Status Code and Expiry Date

will be retained and the source row’s quantity will be added to

it.

Transfer Option 3:- Even if source row’s Grade Code, Status

Code and Expiry Date do not match a possible destination

row’s Grade Code, Status Code and Expiry Date, the source

row’s Grade Code, Status Code and Expiry Date will overwrite

the existing values in the destination row and the source row’s

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.

to_item_id Optional. By Value. A string to identify the destination Item

lot_no Optional. By Value. A string to identify the lot number

to_lot_no Optional. By Value. A string to identify the destination lot no

from_grade_cd Optional. By Value. A long to identify the unique source

location

to_grade_cd Optional. By Value. A long to identify the unique destination

location

from_status_cd Optional. By Value. A long to identify the unique source

location

to_status_cd Optional. By Value. A long to identify the unique destination

location

transfer_qty_erp Optional. By Value. A variant (double) specifying how much of

the transferred quantity has already been reported to the ERP

system. Defaults to 0.

Returns

Integer. 0 if successful, else -1

Remarks

2004 CIMNET Inc www.CimnetInc.com 255

Page 256: FactelligenceMiddleware

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.

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

2004 CIMNET Inc www.CimnetInc.com 256

Page 257: FactelligenceMiddleware

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

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

Returns

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>

2004 CIMNET Inc www.CimnetInc.com 257

Page 258: FactelligenceMiddleware

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

Part Description

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

ent_id.

include_moveable_entities Optional. By Value. A Variant (long) to identify

whether to include all the storage entities or not.

Defaults to 0.

last_edit_by Optional. By Value. A Variant (string) to identify the

user_id who has last changed this record. Defaults to

Null.

last_edit_at Optional. By Value. A Variant (datetime) to identify

the date and time of the record which was last

modified. Defaults to Null.

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"?>

2004 CIMNET Inc www.CimnetInc.com 258

Page 259: FactelligenceMiddleware

<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>

Item_Inv Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

2004 CIMNET Inc www.CimnetInc.com 259

Page 260: FactelligenceMiddleware

Item_Transfer Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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.

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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Item_Storage_Exec_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

2004 CIMNET Inc www.CimnetInc.com 260

Page 261: FactelligenceMiddleware

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Transfer_List Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Data_Log_Grp Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

2004 CIMNET Inc www.CimnetInc.com 261

Page 262: FactelligenceMiddleware

IsValid()

SPECIFIC METHODS COMMENTS

Clone() To clone an existing Data Log Group

SaveSample() 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

GetEntGroups() Get all data log groups configured for the specified entity and its parents

Clone Method

Purpose

To clone an existing Data Log Group.

Syntax

Clone (session_id, cur_grp_id, new_grp_desc)

Parameters

Part Description

session_id Required. By Value. A long to identify the session from which

the call was made.

cur_grp_id Required. By Value. A long to identify the data log group to be

cloned.

new_grp_desc Required. By Value. A string to specify the new group’s

description. This should uniquely distinguish the group.

Returns

Long. >=0 if successful to represent the new row’s 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"?>

2004 CIMNET Inc www.CimnetInc.com 262

Page 263: FactelligenceMiddleware

<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)

Parameters

Part Description

session_id Required. By Value. A long to identify the client or Factory

Connector session from which the request is being made.

grp_id Required. By Value. A long to identify the data log group to be

sampled.

ent_id Optional. By Value. A long to identify the entity

job_pos Optional. By Value. A long to identify the job position, if > 1 jobs

are running on this entity

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>

2004 CIMNET Inc www.CimnetInc.com 263

Page 264: FactelligenceMiddleware

<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

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

Returns

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)

2004 CIMNET Inc www.CimnetInc.com 264

Page 265: FactelligenceMiddleware

Parameters

Part Description

grp_id Required. By Value. A Variant (long) to identify the data log

group id.

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

value_exists Required. By Ref. A Variant (long) returning 1 (true) or 0 (false).

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 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 COMMENTS

GetAll() The following fields are not permitted as optional filter parameters: last_edit_comment, row_id

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update() Not supported as there are no dependent fields

2004 CIMNET Inc www.CimnetInc.com 265

Page 266: FactelligenceMiddleware

UpdateSpecific() Not supported as there are no dependent fields

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Data_Log_16 and Data_Log_48 Classes

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to increase performance: All value fields, last_edit_comment, row_idIf 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, item.item_desc, shift.shift_desc

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add() Data_Log_48 class does not support Value46 – 48 fields

Update() Data_Log_48 class does not support Value46 – 48 fields

UpdateSpecific() Data_Log_48 class does not support Value46 – 48 fields

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Res Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following columns are NOT available as filters: qty_avail, num_decimals, last_edit_comment, mod_id.

GetAllbyXML() The following columns are NOT available as filters: qty_avail, num_decimals, last_edit_comment, mod_id.

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

2004 CIMNET Inc www.CimnetInc.com 266

Page 267: FactelligenceMiddleware

UpdateSpecific() mod_id is optional

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Res_Exc Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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, 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() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific() mod_id is optional

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Res_Oper_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

2004 CIMNET Inc www.CimnetInc.com 267

Page 268: FactelligenceMiddleware

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Res_Job_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific() mod_id is optional

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

DNC DLL Enhanced Methods

Folder Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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:

2004 CIMNET Inc www.CimnetInc.com 268

Page 269: FactelligenceMiddleware

ent.ent_name, item.item_desc,

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

SetPreferredVer()

Clone() To clone an existing Folder to a new folder in the database

SetPreferredVer Method

Purpose

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 Description

session_id Required. By Value. A long to identify the session from which

the call was made.

item_id Required. By Value. A string to identify the item_id

oper_id Required. By Value. A string to identify the oper_id

ent_id Required. By Value. A long to identify the entity.

ver_id Required. By Value. A string to identify the ver_id

mod_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.

Returns

Integer. 0 if successful, else -1

Remarks

2004 CIMNET Inc www.CimnetInc.com 269

Page 270: FactelligenceMiddleware

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

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 Description

session_id Required. By Value. A variant (long) to identify the client session from which the request is being made.

existing_item_id Required. By Value. A variant (string) to identify the item_id of the folder to be cloned

existing_oper_id Required. By Value. A variant (string) to identify the oper_id of the folder to be cloned

existing_ent_id Required. By Value. A variant (long) to identify the ent_id of the folder to be cloned

existing_ver_id Required. By Value. A variant (string) to identify the ver_id of the folder to be cloned

new_item_id Required. By Value. A variant (string) to identify the item_id for the new folder.

2004 CIMNET Inc www.CimnetInc.com 270

Page 271: FactelligenceMiddleware

new_oper_id Required. By Value. A variant (string) to identify the oper_id for the new folder

new_ent_id Required. By Value. A variant (long) to identify the ent_id for the new folder

new_ver_id Required. By Value. A variant (string) to identify the ver_id for the new folder

new_oper_desc Optional. By Value. A variant (string) to identify the oper_desc for the new folder

new_notes Optional. By Value. A variant (string) to identify the notes for the new folder

new_udf1 Optional. By Value. A variant (string) to identify the udf1 for the new folder

new_udf2 Optional. By Value. A variant (string) to identify the udf2 for the new folder

new_preferred_ver Optional. By Value. A variant (boolean) to identify the preferred_ver for the new folder

new_design_hold Optional. By Value. A variant (boolean) to identify the design_hold for the new folder

mod_id Optional. By Ref. A variant (string) returns the mod_id of the newly cloned folder data

Returns

Long. 0 if successful, else –1.

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"?>

2004 CIMNET Inc www.CimnetInc.com 271

Page 272: FactelligenceMiddleware

<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 COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to increase performance: file_desc, file_size, last_edit_comment, mod_id, row_idIf 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Folder_Item_Oper_Ent_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following fields are not permitted as optional filter parameters:

2004 CIMNET Inc www.CimnetInc.com 272

Page 273: FactelligenceMiddleware

last_edit_comment, row_id

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Folder_Distr Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update() Not supported as there are no dependent fields

UpdateSpecific() Not supported as there are no dependent fields

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

WO_File Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to increase performance: file_desc, file_size, last_edit_comment, mod_id, row_idIf the last_modified filter is included then all rows AT AND AFTER the

2004 CIMNET Inc www.CimnetInc.com 273

Page 274: FactelligenceMiddleware

specified filter datetime are included.

The following columns are also included in the returned recordset : user_name.user_desc

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Item_File Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

DNC_Exec Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following columns are NOT permitted as filter parameters: config, last_edit_comment

2004 CIMNET Inc www.CimnetInc.com 274

Page 275: FactelligenceMiddleware

The following columns are also included in the returned recordset: ent.ent_name, hub.hub_name, hub.hub_type

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

GetProtocols()

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

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

2004 CIMNET Inc www.CimnetInc.com 275

Page 276: FactelligenceMiddleware

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Hub_Dev Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() All fields except last_edit_at are permitted as optional filter parameters.

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Defcon Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to increase performance: config.

GetAllbyXML() As for GetAll()

GetByKey()

2004 CIMNET Inc www.CimnetInc.com 276

Page 277: FactelligenceMiddleware

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

DNC_Log Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

EndLogEntry()

EndLogEntry Method

Purpose

End the DNC Log Entry.

Syntax

EndLogEntry (session_id, log_id, bytes)

Parameters

2004 CIMNET Inc www.CimnetInc.com 277

Page 278: FactelligenceMiddleware

Part Description

session_id Required. By Value. A Variant (long) to identify the session from

which the call was made.

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

bytes Optional. By Value. A Variant (long) to identify the 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 COMMENTS

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

2004 CIMNET Inc www.CimnetInc.com 278

Page 279: FactelligenceMiddleware

(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() As for GetAll()

GetByKey()

GetSpecificRS() 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 COMMENTS

SetReason() Manually change the reason code on an entity which may also change the state.

SetRawReason() Change the raw reason code on an entity from Factory Connector.

SetPendingReason() Override the raw reason code on an entity by the user.

GetAvailableReasons() Return the available final reasons for an entity, optionally filtered by the raw reason.

GetOldAvailableReasons()

Returns the possible set of final reasons for the OLD non_final reasons of the given entity

GetStatusInfoByUser() Return the available utilization data for an entity.

UpdateDurations() Update the durations of current rows in util_log.

NewEvent() 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

Part Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

2004 CIMNET Inc www.CimnetInc.com 279

Page 280: FactelligenceMiddleware

user_id Required. By Value. A string to identify the user.

ent_id Required. By Value. A long to identify the entity.

new_reas_cd Required. By Value. A long to identify the new utilization reason

on this entity.

new_reas_start Optional. By Value. A variant (datetime) to specify the

timestamp from which the new reason applies. Defaults to Now.

reas_pending 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.

comments Optional. By Value. A variant (string) to include a comment that

provides more information for the new reason. Defaults to “”.

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>

<cmd>SetReason</cmd>

<ent_id>1</ent_id>

<new_reas_cd>23</new_reas_cd>

<new_reas_start></new_reas_start>

2004 CIMNET Inc www.CimnetInc.com 280

Page 281: FactelligenceMiddleware

<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 Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

ent_id Required. By Value. A long to identify the entity.

raw_reas_cd Required. By Value. A long to specify the new Raw reason.

new_reas_start Optional. By Value. A variant (datetime) to specify the

timestamp from which the new raw reason applies. Defaults to

Now.

comments Optional. By Value. A variant (string) to include a comment that

provides more information for the new reason. Defaults to “”.

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 formatted to include the required method parameters as follows:

<?xml version="1.0"?>

2004 CIMNET Inc www.CimnetInc.com 281

Page 282: FactelligenceMiddleware

<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 Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

user_id Required. By Value. A string to identify the user.

ent_id Required. By Value. A long to identify the entity.

final_reas_cd Required. By Value. A long to identify the Final reason code to

replace the pending reasons on this entity.

log_id Optional. By Value. A variant (long) to identify the util_log row

to override the non-final reason with the final reason

period_affected 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).

old_reas_cd 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).

comments Optional. By Value. A variant (string) to include a comment that

provides more information for the new final reason. Defaults to

“”.

Returns

2004 CIMNET Inc www.CimnetInc.com 282

Page 283: FactelligenceMiddleware

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

2004 CIMNET Inc www.CimnetInc.com 283

Page 284: FactelligenceMiddleware

ent_id Required. By Value. A long to identify the entity.

raw_reas_cd 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, reas-desc, 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 Description

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

reas_cd Required. By Value. A variant (long) to identify the current non-

final reason

Returns

2004 CIMNET Inc www.CimnetInc.com 284

Page 285: FactelligenceMiddleware

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

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 Description

session_id Required. By Value. A long to identify the session from which

the call was made.

ent_id Optional. By Value. A long to identify the entity. Defaults to null

which will update all entities that can capture utilization.

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.

2004 CIMNET Inc www.CimnetInc.com 285

Page 286: FactelligenceMiddleware

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.

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 Description

session_id Required. By Value. A long to identify the user’s session

user_id Required. By Value. A string to identify the user

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:

2004 CIMNET Inc www.CimnetInc.com 286

Page 287: FactelligenceMiddleware

<?xml version="1.0"?>

<request>

<object>util_exec</object>

<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 COMMENTS

GetAll() All fields except last_edit_comment are permitted as optional filter parameters

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Util_Reas_Grp Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following columns are NOT available as filters: display_seq, last_edit_comment

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

2004 CIMNET Inc www.CimnetInc.com 287

Page 288: FactelligenceMiddleware

IsValid()

Util_Reas Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Util_Reas_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update() Not Supported as there are no dependent fields

UpdateSpecific() Not Supported as there are no dependent fields

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

2004 CIMNET Inc www.CimnetInc.com 288

Page 289: FactelligenceMiddleware

Util_Raw_Reas Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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_raw_reas.def_reas_cd, util_reas.reas_desc as def_reas_desc (def_reas_cd)

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Util_Log Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() Not supported. Use the SetReason() and SetRawReason() methods of the util_exec class to add rows to this table.

Update()

UpdateSpecific()

2004 CIMNET Inc www.CimnetInc.com 289

Page 290: FactelligenceMiddleware

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.

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

AdjustDuration()

Split()

GetAllByPeriod()

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 Description

ent_id Required. By Value. A long to identify the entity.

start_time Optional. By Value. A variant (Datetime) to specify the start

date and time of the period. Defaults to 24 hours ago.

end_time Optional. By Value. A variant (Datetime) to specify the end date

and time of the period. Defaults to Now.

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()

2004 CIMNET Inc www.CimnetInc.com 290

Page 291: FactelligenceMiddleware

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>

<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 Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

user_id Required. By Value. A string to identify the user.

ent_id Required. By Value. A long to identify the entity.

event_time 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.

new_duration Required. By Value. A long to specify the new duration of the

current event in seconds. Must be less than the current

duration.

wo_id Optional. By Value. A variant (string) to specify the wo_id for

the new split row. Defaults to value in original row.

oper_id Optional. By Value. A variant (string) to specify the oper_id for

the new split row. Defaults to value in original row.

seq_no Optional. By Value. A variant (long) to specify the seq_no for

the new split row. Defaults to value in original row.

step_no Optional. By Value. A variant (long) to specify the step_no for

the new split row. Defaults to value in original row.

2004 CIMNET Inc www.CimnetInc.com 291

Page 292: FactelligenceMiddleware

item_id Optional. By Value. A variant (string) to specify the item_id for

the new split row. Defaults to value in original row.

shift_id Optional. By Value. A variant (long) to specify the shift_id for

the new split row. Defaults to value in original row.

shift_start Optional. By Value. A variant (datetime) to specify the

shift_start time for the new split row. Defaults to value in

original row.

reas_cd Optional. By Value. A variant (long) to specify the reas_cd for

the new split row. Defaults to value in original row.

reas_pending Optional. By Value. A variant (boolean) to specify the

reas_pending flag for the new split row. Defaults to value in

original row.

comments Optional. By Value. A variant (string) to specify the comments

value for the new split row. Defaults to value in original row.

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"?>

2004 CIMNET Inc www.CimnetInc.com 292

Page 293: FactelligenceMiddleware

<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>

<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 Description

session_id Required. By Value. A long to identify the session from which

the call was made.

ent_id Required. By Value. A long to identify the entity.

event_time 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.

new_duration 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.

Returns

Integer. 0 if successful, else -1

2004 CIMNET Inc www.CimnetInc.com 293

Page 294: FactelligenceMiddleware

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.

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 294

Page 295: FactelligenceMiddleware

LABOR DLL Enhanced Methods

Labor_Exec Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

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 COMMENTS

GetAvailableLabCodes()

AddLabor()

SetLabData()

UpdateDuration()

GetStatusInfoByUser()

SetRawReason()

NewEvent() Not Supported

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

2004 CIMNET Inc www.CimnetInc.com 295

Page 296: FactelligenceMiddleware

GetAvailableLabCodes (ent_id, raw_reas_cd)

Parameters

Part Description

ent_id Required. By Value. A long to identify the entity.

raw_reas_cd 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 Description

session_id Required. By Value. A long to identify the session from which

2004 CIMNET Inc www.CimnetInc.com 296

Page 297: FactelligenceMiddleware

the call is being made.

ent_id Required. By Value. A long to identify the entity.

user_id Required. By Value. A string to identify the user.

lab_cd Required. By Value. A string to specify the labor code

duration Required. By Value. A long to specify the duration in seconds of

labor used.

dept_id Optional. By Value. A variant (string) to specify the dept_id for

which the labor was performed. Defaults to default department

for this user.

pct_to_apply 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%.

event_time Optional. By Value. A variant (date) to specify the transaction

entry time. Defaults to Now.

wo_id Optional. By Value. A variant (string) to specify the wo_id on

which the labor was performed. Defaults to current value on this

entity.

oper_id Optional. By Value. A variant (string) to specify the oper_id on

which the labor was performed. Defaults to current value on this

entity.

seq_no Optional. By Value. A variant (long) to specify the seq_no on

which the labor was performed. Defaults to current value on this

entity.

step_no Optional. By Value. A variant (long) to specify the step_no on

which the labor was performed. Defaults to current value on this

entity.

item_id 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.

lot_no 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.

shift_id 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.

2004 CIMNET Inc www.CimnetInc.com 297

Page 298: FactelligenceMiddleware

shift_start Optional. By Value. A variant (datetime) to specify the

shift_start time for the shift during which the labor was

performed. Defaults to current shift’s 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 entity’s 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>

2004 CIMNET Inc www.CimnetInc.com 298

Page 299: FactelligenceMiddleware

<item_id></item_id>

<lot_no></lot_no>

<shift_id></shift_id>

<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 Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

ent_id Required. By Value. A long to identify the entity.

user_id Required. By Value. A string to identify the user performing the

labor.

step_no 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.

lot_no 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.

lab_cd Optional. By Value. A variant (string) to specify a new labor

code for this labor event. Defaults to existing value.

dept_id Optional. By Value. A variant (string) to specify a new dept_id

(cost center) to which this labor is attributed. Defaults to

existing value.

pct_to_apply Optional. By Value. A variant (double) to specify a new

percentage of labor for this event. Defaults to existing value.

comments Optional. By Value. A variant (string) to add comments to this

labor event. Defaults to existing value.

2004 CIMNET Inc www.CimnetInc.com 299

Page 300: FactelligenceMiddleware

Returns

Integer. 0 if successful, else -1

Remarks

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 Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

2004 CIMNET Inc www.CimnetInc.com 300

Page 301: FactelligenceMiddleware

log_id 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.

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 Description

session_id Required. By Value. A long to identify the user’s session

user_id Required. By Value. A string to identify the user

Returns

ADODB.recordset.

Remarks

2004 CIMNET Inc www.CimnetInc.com 301

Page 302: FactelligenceMiddleware

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.

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 Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

ent_id Required. By Value. A long to identify the entity.

raw_reas_cd Required. By Value. A long to specify the new Raw reason.

new_reas_start Optional. By Value. A variant (datetime) to specify the

timestamp from which the new raw reason applies. Defaults to

Now.

comments Optional. By Value. A variant (string) to include a comment that

provides more information for the new reason. Defaults to “”.

Returns

2004 CIMNET Inc www.CimnetInc.com 302

Page 303: FactelligenceMiddleware

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.

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 COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Labor_Dept Class

Summary of the methods supported by this class:

2004 CIMNET Inc www.CimnetInc.com 303

Page 304: FactelligenceMiddleware

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Labor_Reas_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update() Not supported as there are no dependent fields

UpdateSpecific() Not supported as there are no dependent fields

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Labor_Raw_Reas Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

2004 CIMNET Inc www.CimnetInc.com 304

Page 305: FactelligenceMiddleware

The following columns are also included in the returned recordset: labor_cat.lab_desc, ent.ent_name

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Labor_Usage Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add() Not supported. Use the LogonEnt() methods of the labor_exec class to add rows to this table.

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

2004 CIMNET Inc www.CimnetInc.com 305

Page 306: FactelligenceMiddleware

CERT DLL Enhanced Methods

Cert_Type Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following columns are NOT available as filters: signoff_notes, num_signoffs_reqd, reqd_exp_to_renew, comments_reqd, last_edit_comment, row_id

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS()

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Cert_User_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

2004 CIMNET Inc www.CimnetInc.com 306

Page 307: FactelligenceMiddleware

IsValid()

Cert_Item_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Cert_Oper_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

2004 CIMNET Inc www.CimnetInc.com 307

Page 308: FactelligenceMiddleware

Cert_Oper_Step_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Cert_Attr_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Cert_Audit_Log Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

2004 CIMNET Inc www.CimnetInc.com 308

Page 309: FactelligenceMiddleware

GetAll() 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() As for GetAll()

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() Not supported. Use the CertSignoff() methods of the job_exec class to add rows to this table.

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

2004 CIMNET Inc www.CimnetInc.com 309

Page 310: FactelligenceMiddleware

CUST DLL Enhanced Methods

Cust Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

GetAllByFilter Returns a recordset of customers and sales orders filtered by the user’s current filter settings

GetAllByFilter Method

Purpose

Returns a recordset of customers and sales orders filtered by the user’s current filter settings.

Syntax

GetAllByFilter(user_id)

Parameters

Part Description

user_id 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.

2004 CIMNET Inc www.CimnetInc.com 310

Page 311: FactelligenceMiddleware

Remarks

This method must first get the user’s 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 COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SO Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to

2004 CIMNET Inc www.CimnetInc.com 311

Page 312: FactelligenceMiddleware

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.

The following columns are also included in the returned recordset : cust.cust_name

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

So_Line Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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_idIf 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

GetNextSoLineNo Returns the next available sales order line no

GetAllByFilter Returns a recordset of line items filtered by the user’s current filter settings

2004 CIMNET Inc www.CimnetInc.com 312

Page 313: FactelligenceMiddleware

GetNextSoLineNo Method

Purpose

Returns the next available line number for a sales order.

Syntax

GetNextSoLineNo (cust_id, po_id)

Parameters

Part Description

cust_id Required. By Value. A Variant (string) to identify the customer

to which the item is being shipped

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

being shipped.

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 user’s current filter settings.

Syntax

GetAllByFilter(user_id, cust_id)

Parameters

2004 CIMNET Inc www.CimnetInc.com 313

Page 314: FactelligenceMiddleware

Part Description

user_id Required. By Value. A Variant (string) to identify the user

running Supervisor.

cust_id Required. By Value. A Variant (string) to identify the customer

whose line items should be returned

po_id Required. By Value. A Variant (string) to identify the purchase

order id

Returns

ADODB.recordset. The columns are po_line_no, item_id, and item_desc.

Remarks

This method must first get the user’s 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 COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

2004 CIMNET Inc www.CimnetInc.com 314

Page 315: FactelligenceMiddleware

Update() Not supported as there are no dependent fields

UpdateSpecific() Not supported as there are no dependent fields

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Shipment Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Shipment_Lot Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

2004 CIMNET Inc www.CimnetInc.com 315

Page 316: FactelligenceMiddleware

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

GetQtyShipped() Returns the sum of quantity shipped for the customer on a selected sales order and the sales order line being shipped

GetLotNos() Returns a recordset of available lot nos

GetMaxToShip() Returns the maximum amount or number of the item that can be shipped for a sales order line

Ship() 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 Description

cust_id Required. By Value. A Variant (string) to identify the customer

to which the item is being shipped

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

being shipped.

so_line_no Required. By Value. A Variant (long) to identify the sales order

line being shipped.

Returns

Variant (Double). Throws an exception if an error occurs.

Remarks

2004 CIMNET Inc www.CimnetInc.com 316

Page 317: FactelligenceMiddleware

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:

<?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 Description

item_id Required. By Value. A Variant (string) to identify the item being

shipped.

cust_id Required. By Value. A Variant (string) to identify the customer

to which the item is being shipped

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

being shipped.

so_line_no Required. By Value. A Variant (long) to identify the sales order

line being shipped.

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

2004 CIMNET Inc www.CimnetInc.com 317

Page 318: FactelligenceMiddleware

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>

<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 Description

item_id Required. By Value. A Variant (string) to identify the item being

shipped.

cust_id Required. By Value. A Variant (string) to identify the customer

to which the item is being shipped

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

being shipped.

so_line_no Required. By Value. A Variant (long) to identify the sales order

line being shipped.

ship_date Required. By Value. A Variant (datetime) to identify the

shipment.

lot_no Required. By Value. A Variant (string) to identify the lot being

shipped.

Returns

Double. Throws an exception if an error occurs. Returns –1 if there is no restriction to the number that can be shipped.

Remarks

2004 CIMNET Inc www.CimnetInc.com 318

Page 319: FactelligenceMiddleware

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()

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 Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

shipment_details Required. By Value. A Variant (string) containing an XML string

listing the shipping details

mod_id Optional. By Ref. A Variant (string) to identify the row in

shipment_lot table.

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.

2004 CIMNET Inc www.CimnetInc.com 319

Page 320: FactelligenceMiddleware

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 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:

2004 CIMNET Inc www.CimnetInc.com 320

Page 321: FactelligenceMiddleware

STANDARD METHODS COMMENTS

GetAll() 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

PO Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Po_Line Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following fields are not permitted as optional filter

2004 CIMNET Inc www.CimnetInc.com 321

Page 322: FactelligenceMiddleware

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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Receipt Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Receipt_Lot Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

2004 CIMNET Inc www.CimnetInc.com 322

Page 323: FactelligenceMiddleware

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

DX DLL Enhanced Methods

Dx_Sched Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

ImportXMLData()

SPECIFIC METHODS COMMENTS

2004 CIMNET Inc www.CimnetInc.com 323

Page 324: FactelligenceMiddleware

SetDataType()

RunQuery()

Clone() Not Implemented yet

TestQuery()

GetImportFieldMappings()

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.

Syntax

SetDataType (session_id, sched_id, sched_type)

Parameters

Part Description

session_id Required. By Value. A long to identify the session from which the

call is being made.

sched_id Required. By Value. A string identifying the schedule.

sched_type Required. By Value. A long specifying the new data type. Valid

values are as in the previously defined “data_type” enumeration list

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>

2004 CIMNET Inc www.CimnetInc.com 324

Page 325: FactelligenceMiddleware

<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>

<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 Description

session_id Required. By Value. A long to identify the session from which

the call is being made.

query_id Required. By Value. A long to identify the existing query as

defined in the dx_query table.

parameters Optional. By Value. A variant (string) containing XML formatted

runtime parameter values to apply to the query.

Returns

ADODB.recordset.

Remarks

2004 CIMNET Inc www.CimnetInc.com 325

Page 326: FactelligenceMiddleware

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>

<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 Description

session_id Required. By Value. A long to identify the session from which the

call is being made.

sched_id Required. By Value. A string identifying the schedule to be

cloned.

new_sched_id Required. By Value. A string to identify the new schedule

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

2004 CIMNET Inc www.CimnetInc.com 326

Page 327: FactelligenceMiddleware

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>

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 Description

XMLRequest Required. By Value. An XML formatted string

Returns

ADODB.recordset.

Remarks

The XML formatted command must be structured as follows

2004 CIMNET Inc www.CimnetInc.com 327

Page 328: FactelligenceMiddleware

<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

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>

2004 CIMNET Inc www.CimnetInc.com 328

Page 329: FactelligenceMiddleware

<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 Description

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

Returns

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>

2004 CIMNET Inc www.CimnetInc.com 329

Page 330: FactelligenceMiddleware

</request>

Dx_Field Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following columns are NOT available as filters: default_value, format_detail, formula, last_edit_comment, row_id

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Dx_Map_Imp Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

GetDistinctMappings()

GetDistinctMappings Method

2004 CIMNET Inc www.CimnetInc.com 330

Page 331: FactelligenceMiddleware

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>

<msgtype>GetSpec</msgtype>

<cmd>GetDistinctMappings</cmd>

</request>

Dx_Map_Exp Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

2004 CIMNET Inc www.CimnetInc.com 331

Page 332: FactelligenceMiddleware

IsValid()

SPECIFIC METHODS COMMENTS

GetDistinctMappings()

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 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 COMMENTS

GetAll() The following columns are NOT available as filters: query_detail, last_edit_comment, row_id

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

2004 CIMNET Inc www.CimnetInc.com 332

Page 333: FactelligenceMiddleware

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

Clone() Used to clone a query. Stub only – yet to be implemented

Dx_Query_Param Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Dx_Queue Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to increase performance: details, row_id

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() Stub only. No specific recordsets currently supported

Add()

Update()

2004 CIMNET Inc www.CimnetInc.com 333

Page 334: FactelligenceMiddleware

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Dx_Log Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

2004 CIMNET Inc www.CimnetInc.com 334

Page 335: FactelligenceMiddleware

FC DLL Enhanced Methods

FC_Namesp_Node Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

Clone() To clone a namespace node and all of its children. Exposed tags are not cloned.

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 Description

session_id Required. By Value. A variant (long) to identify the session from

which the call is being made.

node_id Required. By Value. A variant (long) to identify the destination

node under which the cloned nodes are to be inserted.

from_node_id Required. By Value. A variant (long) to identify the node FROM

2004 CIMNET Inc www.CimnetInc.com 335

Page 336: FactelligenceMiddleware

which the cloned nodes are to be read.

Returns

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 node’s 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 COMMENTS

GetAll() 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

GetChangesAndReset() Return all changed tags for a given FC EXE instance, and then reset the

2004 CIMNET Inc www.CimnetInc.com 336

Page 337: FactelligenceMiddleware

changed flags.

GetChangesAndReset Method

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 Description

fc_id 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 COMMENTS

GetAll() 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:

2004 CIMNET Inc www.CimnetInc.com 337

Page 338: FactelligenceMiddleware

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()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Form DLL Enhanced Methods

Form Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to increase performance: content_file, form_properties, last_edit_comment, row_id

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

ExecuteXMLCmd()

IsValid()

Script Class

Summary of the methods supported by this class:

2004 CIMNET Inc www.CimnetInc.com 338

Page 339: FactelligenceMiddleware

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

ExecuteXMLCmd()

IsValid()

SPECIFIC METHODS COMMENTS

DeleteByName() Deletes a Script identified by its Script_Name, Script_Type and Context

UpdateByName() Updates a script identified by its Script_Name, Script_Type and Context

SaveFormScript 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 Description

session_id Required. By Value. A variant (long) to identify the session

script_name Required. By Value. A variant (string) to identify the script.

script_type Required. By Value. A variant (long) to identify the script_type

context Required. By Value. A variant (long) to identify the context of

the script

form_name Optional. By Value. A variant (string) to specify the optional

form_name for which this script is to be deleted

2004 CIMNET Inc www.CimnetInc.com 339

Page 340: FactelligenceMiddleware

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.

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 Description

session_id Required. By Value. A variant (long) to identify the session.

script_name Required. By Value. A string to identify the script.

context Required. By Value. A long to identify the context of the script

script_type Required. By Value. A long to identify the script_type

2004 CIMNET Inc www.CimnetInc.com 340

Page 341: FactelligenceMiddleware

form_name Optional. By Value. A variant (string) to identify the optional

form_name for which this script is to be updated

script Optional. By Value. A variant (string) to identify the script

spare1 Optional. By Value. A variant (string) to identify spare1

spare2 Optional. By Value. A variant (string) to identify spare2

spare3 Optional. By Value. A variant (string) to identify spare3

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

2004 CIMNET Inc www.CimnetInc.com 341

Page 342: FactelligenceMiddleware

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

Part Description

session_id Required. By Value. A variant (long) to identify the session

form_name Required. By Value. A string to identify the form for which the

script is being saved.

script_name Required. By Value. A string to identify the script.

context Required. By Value. A long to identify the context of the script

script_type Required. By Value. A long to identify the script_type

script Required. By Value. A variant (string) containing the script

spare1 Optional. By Value. A variant (string) to identify spare1

spare2 Optional. By Value. A variant (string) to identify spare2

spare3 Optional. By Value. A variant (string) to identify spare3

spare4 Optional. By Value. A variant (string) to identify spare4

script_id Optional. By Ref. A variant (long) to return the script_id for this

script to the caller.

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

2004 CIMNET Inc www.CimnetInc.com 342

Page 343: FactelligenceMiddleware

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>

<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 COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPC DLL Enhanced Methods

SPC_Char Class

2004 CIMNET Inc www.CimnetInc.com 343

Page 344: FactelligenceMiddleware

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

ExecuteXMLCmd()

IsValid()

SPC_Item_Char_Link Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPC_Char_Oper_Link Class

Summary of the methods supported by this class:

2004 CIMNET Inc www.CimnetInc.com 344

Page 345: FactelligenceMiddleware

STANDARD METHODS COMMENTS

GetAll() 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() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPC_Char_Job Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPC_Event Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() The following fields are not permitted as optional filter parameters to

2004 CIMNET Inc www.CimnetInc.com 345

Page 346: FactelligenceMiddleware

increase performance: notes, last_edit_comment

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPC_Sample Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() All columns except last_edit_comment are available as filters

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

SPC_Stats Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

GetAll() 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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

2004 CIMNET Inc www.CimnetInc.com 346

Page 347: FactelligenceMiddleware

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

Gage_Config Class

Summary of the methods supported by this class:

STANDARD METHODS COMMENTS

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

GetAllbyXML() As for GetAll()

GetByKey()

GetSpecificRS() No specific recordsets currently supported

Add()

Update()

UpdateSpecific()

Delete()

DeleteAll()

ExecuteXMLCmd()

IsValid()

2004 CIMNET Inc www.CimnetInc.com 347

Page 348: FactelligenceMiddleware

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 COMMENTS

GenericXMLRequest() 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() Calls GetRSbyXML() to return a RS then converts it to XML based on the <schema> tag in the XML request.

GetRSbyXML() Creates an object based on the <object> tag in the XML request and calls the object’s GetAllbyXML() method to return a RS.

GetSpecificRSasXML() Calls GetSpecificRS() to return a RS then converts it to XML based on the <schema> tag in the XML request.

GetSpecificRS() Creates an object based on the <object> tag in the XML request and calls the object’s GetSpecificRS() method to return a RS.

GetRSbySQLasXML() 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):

GetRSbySQL() 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)

GetShapedRSbySQLasXML() Calls GetShapedRSbySQL() to return a shaped or hierarchical RS then converts it to XML based on the <schema> tag in the XML request.

GetShapedRSbySQL() 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.

GetRSFromExtDB() Extracts the Connect String and SQL query included in the <sql> tag in

2004 CIMNET Inc www.CimnetInc.com 348

Page 349: FactelligenceMiddleware

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 performance as the SQL is not precompiled into a Stored Procedure, and the client needs knowledge of the database)

GetRSFromExtDBasXML() Calls GetRSFromExtDB() to return a RS then converts it to XML based on the <schema> tag in the XML request.

RunQueryasXML() 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.

RunQuery() 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.

ExecuteXMLCmd() Creates an object based on the <object> tag in the XML request and calls the object’s ExecuteXMLCmd() method to handle the command and return an XML formatted response.

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 349

Page 350: FactelligenceMiddleware

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 3 rd

2004 CIMNET Inc www.CimnetInc.com 350

Page 351: FactelligenceMiddleware

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> mandatory name of class / table (omit if msgtype = 'GetbySQL')

<cmd> mandatory for commands (Add, Update, Delete and other class specific commands)

<schema> optional XML schema for retrieves (‘element’ or ‘attribute’ (default))

Other parameters depend on the XML Request / Command as detailed in their relevant sections.

Returns

For commands it returns an XML string format returning the status / error description in the following format

<result> 0 for success, -1 for failure - always included

<identity> Identity value – only included if success on Identity table inserts

<error><desc> error description - only included if unsuccessful

For requests for a recordset it returns an XML string formatted according to the <schema> tag.

Remarks

2004 CIMNET Inc www.CimnetInc.com 351

Page 352: FactelligenceMiddleware

Any commands or requests supported by any Director class methods will be delegated by this method 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> mandatory name of class / table

<cmd> mandatory command (Add, Update, Delete and other class specific cmds)

<validate> optional validate flag (default = 1)

<classname> mandatory class / table name for Adds, Updates and Deletes

<fieldname_x> field names – optional for some methods

Returns

String in XML format returning the status / error description in the following format

<result> 0 for success, -1 for failure - always included

<identity> Identity value – only included if success on Identity table inserts

<error><desc> error description - only included if unsuccessful

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.

2004 CIMNET Inc www.CimnetInc.com 352

Page 353: FactelligenceMiddleware

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 table’s 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> mandatory name of class / table

<filter> optional Filters for the recordset (default = no filter)

<fieldname_x> optional field value(s) for filter (default = all rows)

<maxrows> Optional Max no of rows to return (default = all) (Not implemented yet)

<skiprows> Optional Skip number of rows (default = 0) (Not implemented yet)

Returns

ADODB.Recordset containing the optionally filtered resultset. The recordset will be disconnected from the database and will be Read Only, Forward Only.

The recordset’s 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 recordset’s fields by name instead of by index when writing client side code to access the fields.

Remarks

2004 CIMNET Inc www.CimnetInc.com 353

Page 354: FactelligenceMiddleware

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 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> mandatory name of class / table

<schema> optional XML schema for retrieves (‘element’ or ‘attribute’ (default))

<filter> optional Filters for the recordset (default = no filter)

<fieldname_x> optional field value(s) for filter (default = all rows)

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"?>

2004 CIMNET Inc www.CimnetInc.com 354

Page 355: FactelligenceMiddleware

<request>

<object>grp_priv_link</object>

<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> mandatory name of class / table

<cmd> mandatory command (Usually the name of the Specific method to be invoked)

Other parameters depend on the Specific method to be invoked.

Returns

ADODB.Recordset containing the specific recordset. The recordset will be disconnected from the database and will be Read Only, Forward Only.

The recordset’s 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 recordset’s 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>

2004 CIMNET Inc www.CimnetInc.com 355

Page 356: FactelligenceMiddleware

<object>grp_ent_link</object>

<msgtype>getspec</msgtype>

<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> mandatory name of class / table

<cmd> mandatory command (Usually the name of the Specific method to be invoked)

<schema> optional XML schema for retrieves (‘element’ or ‘attribute’ (default))

Other parameters depend on the Specific method to be invoked.

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.

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

2004 CIMNET Inc www.CimnetInc.com 356

Page 357: FactelligenceMiddleware

The strSQL parameter must be a valid SQL retrieve statement for the IF database.

Returns

ADODB.Recordset containing the resultset. The recordset will be disconnected from the database and will be Static with a BatchOptimistic lock.

The recordset’s 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

2004 CIMNET Inc www.CimnetInc.com 357

Page 358: FactelligenceMiddleware

To retrieve a recordset AS an shaped ADODB.recordset object by specifying the SQL for the retrieve statement.

Syntax

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 recordset’s 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>

2004 CIMNET Inc www.CimnetInc.com 358

Page 359: FactelligenceMiddleware

</request>

GetRSFromExtDB Method

Purpose

To retrieve a recordset from an external database

Syntax

GetRSFromExtDB (connect_string, sql_query)

Parameters

Part Description

connect_string Required. By Value. A variant (string) to identify a valid connect string to connect to the database

sql_query Optional. By Value. A variant (string) to specify the select sql to be executed on the database

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>

2004 CIMNET Inc www.CimnetInc.com 359

Page 360: FactelligenceMiddleware

GetRSFromExtDBasXML Method

Purpose

To retrieve a recordset in XML format by specifying the connect string and SQL for the retrieve statement.

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>

2004 CIMNET Inc www.CimnetInc.com 360

Page 361: FactelligenceMiddleware

<parameters><parameter name="param1" value="val1" /><parameter name="param2" value="val2" />

</parameters></request>

Returns

ADODB.Recordset containing the resultset. The recordset will be disconnected from the database and will be Static with a BatchOptimistic lock.

The recordset’s 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

2004 CIMNET Inc www.CimnetInc.com 361

Page 362: FactelligenceMiddleware

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)

Purpose

To execute a predefined sql or sp passing relevant runtime parameters and return an appropriate recordset.

Syntax

GetRSbySP (XMLCmd)

Parameters

Part Description

XMLCmd Required. By Value. An XML formatted string

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"?>

2004 CIMNET Inc www.CimnetInc.com 362

Page 363: FactelligenceMiddleware

<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>

</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”/> <parameter

name=”tree_icon” datatype=”200” direction=”1” size=”254” value=”new.ico”/>

</sp_parameters>

</test_query>

</request>

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 caller’s user_id. This is useful to know as Database Connection string’s etc may be overridden for certain users.

Also See SetUserConnStr() method

SetUserConnStr Method

2004 CIMNET Inc www.CimnetInc.com 363

Page 364: FactelligenceMiddleware

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

Part Description

ConnStr 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 COMMENTS

ExecuteXMLCmd() 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.

ExecuteBatchXMLCmds() 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.

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

2004 CIMNET Inc www.CimnetInc.com 364

Page 365: FactelligenceMiddleware

The XML formatted command must be structured as follows:

<object> Custom

<msgtype> ‘Exec’

<cmd> ‘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 =

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> 0 for success, -1 for failure

<rows_affected>0</rows_affected> Number of rows affected by transaction

(Note successful transactions executed by

SPs may return 0 rows affected even on

success eg. when its 1st 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

2004 CIMNET Inc www.CimnetInc.com 365

Page 366: FactelligenceMiddleware

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.

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

2004 CIMNET Inc www.CimnetInc.com 366

Page 367: FactelligenceMiddleware

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

<request> literal tag to mark start of one action on one class

..Contents are exact XML format for a single XML command

</request> literal tag to mark end of one action on one class

<request> additional request(s) within the same transaction

..Contents are exact XML format for a single XML command

</request>

</transaction> literal tag to mark end of transaction

Returns

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

2004 CIMNET Inc www.CimnetInc.com 367

Page 368: FactelligenceMiddleware

<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

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>

2004 CIMNET Inc www.CimnetInc.com 368

Page 369: FactelligenceMiddleware

<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>

<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

2004 CIMNET Inc www.CimnetInc.com 369

Page 370: FactelligenceMiddleware

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

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> Included when adding to Identity table

<mod_id>01 Jan 1900 00:14:20:010</mod_id> Included if changed mod_id field

<error> Only included if result <> 0

<desc>Command not handled - ADDG</desc>

<number>445</number> Included if available

<source>Attr.Add</desc> Included if relevant

2004 CIMNET Inc www.CimnetInc.com 370

Page 371: FactelligenceMiddleware

</error>

</response>

2004 CIMNET Inc www.CimnetInc.com 371