Give us contact

Do you prefer to ask us directly?

Call us +420 605 203 938 (the Czech Republic)

or use this contacts

AyMINE

Related links


FI - Finance Management

Transpilation old object format

Objects defined in the version 1 could be easily transformed to the version 2 format

Transpilation to the new format using regex conversion

Object model was significantly simplified in 6/2021 and newly support object definition of attributes, operations and views. Older format that uses the array definition is still supported by server and application. The array–like format is depreciated.

New formal is more readable and controls duplicities. The old format to the new one can be converted almost automatically using the following regex conversion. Transpilation was tested and used in the https://regex101.com/ but any tool that supports transpilation based on js–regex definition can be used

Transpilation

Transpilation of the several parts of the model. It converts:

  • Attributes – both class definition and view definition (both list and detail)
  • Detail view tabs
  • Operation – both class and view related

The transpilation is saved and stored: https://regex101.com/r/qz98hr/1

regular expression: ({"name":")(\w*)(",)(.*)

substitution: "$2":{$4

Box transpilation

Transpilation of boxes is different because there are more items to change.

stored: https://regex101.com/r/rTvVFR/1

regular expression: \s*(.*,)("name":")(\w*)(",)(.*)

substitution: "$3":$1$5 \n

Object hierarchy

Object definition support hierarchy and inheritance. Currently only single parent is allowed

General rules for the inheritance:

  • Parent could be from different module
  • User that has right for child object does not have to have right for parent object. However, if parent view has defined it's own uright, user should have them even when view is used in the context of the child object
  • No private method/view supported. Everything what is defined in parent is visible in child. But each element (operation, attribute) could be overwritten
  • Inheritance is supported with new styles only (operations and methods defined as objects); more precisely both parent and child must use the same format
  • Inheritace does not anyhow merge views but child can extend parent view

Operations patterns

Original function to set and object mark

Method reads data from server and set value without reload and save (value is already saved in database)

"setMark": { 
   "icon":"mark", 
   "right":"=obj.isResponsible", 
   "enabled":"=!obj.isNew && !obj.mark",
   "command": [ 
      "server.tskDecision.getMark",
      "window.setValue(fieldName=mark, newValue=@newMark)",
      "window.setReadOnly(fieldName=mark, newValue=true)",
      "run.return(status=OK, message=noRefresh)"
   ]
}