Code data is a way to add custom codes to collections, specifying tags and collecting the codes to be used in different scenarioes. E.g. in our Web Operator, it’s possibly to use code data as job types, stop- and waste reason code.

Storing codes in database

To store the code data and collections in our database, four tables has been created.

ECodeData – The raw code data with name, description, color and tags.

  • siteId: Site ID relationship
  • Id: Unique code data identifier (the code used, e.g. ETIK)
  • Name: The name of the code data
  • Description: The description of the code data
  • Color: The color of the code data
  • Tags: The tags this code data is related to
  • Disabled: Instead of deleting code data, we simply disable them with this bit flag (0 = false, 1 = true)
  • CreationCalendar: When the code data was created
  • ModificationCalendar: Last time the code data was modified

ECodeCollectionCodes – A mapping between the code data and collections in a many-to-many relationship.

  • siteId: Site ID relationship
  • CollectionId: Foreign key of the code collection primary key
  • codeId: Foreign key of the code data primary key
  • Order: The order of the code data in a collection

ECodeCollection – Collecting code data to be used for specific tags. A parent collection can also be assigned.

  • siteId: Site ID relationship
  • Id: Unique code collection identifier
  • Name: The name of the code collection
  • Description: The description of the code collection
  • parentCollection: Foreign key of a parent code collection primary key
  • Disabled: Instead of deleting code collections, we simply disable them with this bit flag (0 = false, 1 = true)
  • Tags: The tags this code collection is related to
  • CreationCalendar: When the code collection was created
  • ModificationCalendar: Last time the code collection was modified

ECodeCollectionMapping – A mapping between code collections and ROB-EX basemodel data.

  • siteId: Site ID relationship
  • Id: Unique mapping identifier
  • Qualifier (optional): (Not in use atm.)
  • Context: Tag that this mapping should affect
  • Target (optional): Basemodel type (resource, operation etc.) that this mapping should be mapped to
  • Selector (optional): Basemodel id (id of resource, template operation, cloned operation etc.) that this mapping should be mapped to
  • CollectionId: Foreign key of the code collection primary key
  • Tags: The tags this mapping is related to
  • CreationCalendar: When the mapping was created
  • ModificationCalendar: Last time the mapping was modified

Query example

Default mapping contexts and usecase

  • TT_JOB_TYPE: Job type (or sub job) used in Web Operator. This can be used to divide a job into multiple sub jobs.
  • TT_REG_CODE: Stop code used in Web Operator. This can be used to specify a reason for ie. Creating pause time registrations.
  • TT_QTY_BAD_CODE: Waste code (quantity bad) used in Web Operator. This can be used to specify a reason for registering waste.

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment