software‎ > ‎módulos‎ > ‎engine‎ > ‎atualizações‎ > ‎

2017.10

postado em 27 de out de 2017 11:31 por Ariluce Sousa

Publicação Técnica

  • As classes e funções globais nativas do ambiente JavaScript do Engine e do pacote erp-engine.jaz foram migradas para uma nova estrutura de módulos no padrão CommonJS. Essa migração não altera o comportamento dos códigos existentes no sistema, pois todos os símbolos globais foram mantidos para fins de compatibilidade. A nova estrutura de módulos é uma funcionalidade experimental do sistema e ainda não deve ser utilizada em customizações ou produtos desenvolvidos na plataforma Bematech ERP. Por ser uma funcionalidade experimental, ainda são esperadas alterações de estruturas que podem exigir a revisão do uso dos módulos. Será criada uma publicação técnica quando a nova estrutura de módulos estiver amadurecida e pronta para ser utilizada pelos clientes e parceiros. Segue a relação das APIs migradas:

    • ngin.string.removeLineBreaks: erp-engine/lib/string/removeLineBreaks
    • ngin.string.removePrefix: erp-engine/lib/string/removePrefix
    • ngin.string.removeSuffix: erp-engine/lib/string/removeSuffix
    • ngin.string.splitByCommaOrSemicolon: erp-engine/lib/string/splitByCommaOrSemicolon
    • goog.array.remove: erp-engine/lib/array/remove
    • goog.array.removeAt: erp-engine/lib/array/removeAt
    • ngin.classdef.AfterPersistEvent: erp-engine/lib/classdef/AfterPersistEvent
    • ngin.classdef.BeforePersistEvent: erp-engine/lib/classdef/BeforePersistEvent
    • ngin.classdef.Def: erp-engine/lib/classdef/ClassDef
    • ngin.classdef.Cache: erp-engine/lib/classdef/ClassDefCache
    • ngin.classdef.Manager: erp-engine/lib/classdef/ClassDefManager
    • ClassSourceGenerator: erp-engine/lib/classdef/ClassSourceGenerator
    • ngin.classdef.ConfigDef: erp-engine/lib/classdef/ConfigDef
    • ngin.classdef.DataEvent: erp-engine/lib/classdef/DataEvent
    • ngin.classdef.Field: erp-engine/lib/classdef/Field
    • ngin.classdef.FieldChangeEvent: erp-engine/lib/classdef/FieldChangeEvent
    • ngin.classdef.FieldEvent: erp-engine/lib/classdef/FieldEvent
    • ngin.classdef.FieldGroup: erp-engine/lib/classdef/FieldGroup
    • ngin.classdef.FieldList: erp-engine/lib/classdef/FieldList
    • ngin.classdef.FieldNameList: erp-engine/lib/classdef/FieldNameList
    • ngin.classdef.FieldOptionsEvent: erp-engine/lib/classdef/FieldOptionsEvent
    • ngin.classes.getLookupDataClass: erp-engine/lib/classdef/getLookupDataClass
    • ngin.classdef.InterceptorConfiguration: erp-engine/lib/classdef/InterceptorConfiguration
    • ngin.classdef.LookupAddResultEvent: erp-engine/lib/classdef/LookupAddResultEvent
    • ngin.classdef.LookupDisplayEvent: erp-engine/lib/classdef/LookupDisplayEvent
    • ngin.classdef.MasterDeleteAction: erp-engine/lib/classdef/MasterDeleteAction
    • ngin.classdef.ModelDef: erp-engine/lib/classdef/ModelDef
    • ngin.classdef.PermissionField: erp-engine/lib/classdef/PermissionField
    • ngin.classdef.PermissionFieldScope: erp-engine/lib/classdef/PermissionFieldScope
    • ngin.classdef.PersistEvent: erp-engine/lib/classdef/PersistEvent
    • ngin.classdef.ReadOnlyMode: erp-engine/lib/classdef/ReadOnlyMode
    • SessionConfiguration: erp-engine/lib/classdef/SessionConfiguration
    • SessionEnvironmentType: erp-engine/lib/classdef/SessionEnvironmentType
    • SessionPersistence: erp-engine/lib/classdef/SessionPersistence
    • ngin.classdef.SourceType: erp-engine/lib/classdef/SourceType
    • ngin.strict.Evaluator: erp-engine/lib/classdef/StrictModeEvaluator
    • ngin.database.DataType: erp-engine/lib/database/DataType
    • KeysUtilities: erp-engine/lib/database/KeysUtilities
    • QueryUtilities: erp-engine/lib/database/QueryUtilities
    • Method: erp-engine/lib/event/LegacyMethod
    • Event: erp-engine/lib/event/LegacyEvent
    • ngin.geo.AngleFormats: erp-engine/lib/geo/AngleFormat
    • ngin.geo.formatAngle: erp-engine/lib/geo/formatAngle
    • ngin.geo.formatLatitude: erp-engine/lib/geo/formatLatitude
    • ngin.geo.formatLongitude: erp-engine/lib/geo/formatLongitude
    • ngin.geo.LatitudeFormats: erp-engine/lib/geo/LatitudeFormat
    • ngin.geo.LongitudeFormats: erp-engine/lib/geo/LongitudeFormat
    • ngin.geo.parseAngle: erp-engine/lib/geo/parseAngle
    • ngin.geo.parseLatitude: erp-engine/lib/geo/parseLatitude
    • ngin.geo.parseLongitude: erp-engine/lib/geo/parseLongitude
    • goog.math.isInteger: erp-engine/lib/math/isInteger
    • ngin.struct.PropertyMapper: erp-engine/lib/object/PropertyMapper
    • parsePhone: erp-engine/lib/phone/parsePhone
    • PhoneNumber: erp-engine/lib/phone/PhoneNumber
    • ngin.product.canRelateKeys: erp-engine/lib/product/canRelateKeys
    • ngin.product.getChangeableProducts: erp-engine/lib/product/getChangeableProducts
    • ngin.product.getDependencies: erp-engine/lib/product/getDependencies
    • ngin.product.getProductFromKey: erp-engine/lib/product/getProductFromKey
    • ngin.product.canRelateKeys: erp-engine/lib/product/canRelateKeys
    • ngin.security.ClassChangePolicy: erp-engine/lib/security/ClassChangePolicy
    • ngin.security.PermissionModes: erp-engine/lib/security/PermissionMode
    • caseTreatment: erp-engine/lib/string/adjustCase
    • identifierToName: erp-engine/lib/string/identifierToName
    • nameToIdentifier: erp-engine/lib/string/nameToIdentifier
    • goog.string.padNumber: erp-engine/lib/string/padNumber
    • StringList: erp-engine/lib/string/StringList
    • stringToInt32: erp-engine/lib/string/stringToInt32
    • stringToInteger: erp-engine/lib/string/stringToInteger
    • stringToNumber: erp-engine/lib/string/stringToNumber
    • validateString: erp-engine/lib/string/validateString
    • formatNumber: erp-engine/lib/string/formatNumber
    • ngin.testing.classes.testModelDefs: erp-engine/lib/testing/classdef/testModelDefs
    • ngin.testing.classes.testViewDefs: erp-engine/lib/testing/classdef/testViewDefs
    • ngin.dataset.appendRecords: erp-engine/lib/testing/dataset/appendRecords
    • extractNameFromUrl: erp-engine/lib/url/extractNameFromUrl
    • ngin.encode.removeUnsupportedChars: erp-engine/lib/xml/removeUnsupportedChars
    • RoundingMode: erp-engine/lib/math/RoundingMode
    • Math.decimalPrecision: erp-engine/lib/math/decimalPrecision
    • Math.isZero: erp-engine/lib/math/isZero
    • round: erp-engine/lib/math/round
    • DataSetManager: erp-engine/lib/dataset/DataSetManager
    • DataSetManagerError: erp-engine/lib/dataset/DataSetManagerError
    • ngin.keys.PermissionsApplyModes: erp-engine/keys/PermissionApplyModes
    • ngin.classes.getTabularHierarchy: erp-engine/lib/database/Classes#getTabularHierarchy
    • ngin.classes.getOrphans: erp-engine/lib/database/Classes#getOrphans
    • ngin.classes.checkClassPath: erp-engine/lib/database/Classes#checkClassPath
    • ngin.dataset.forEach: erp-engine/lib/dataset/forEachRecord
    • ngin.dataset.pruneTree: erp-engine/lib/dataset/pruneTree
    • ngin.dataset.isTextualField: erp-engine/lib/dataset/isTextualField
    • ngin.dataset.fieldValuesAreEqual: erp-engine/lib/dataset/fieldValuesAreEqual
    • ngin.dataset.fieldValueIsEqual: erp-engine/lib/dataset/fieldValueIsEqual]
    • goog.object.some: erp-engine/lib/object/some
    • goog.object.isEmpty: erp-engine/lib/object/isEmpty
    • goog.object.forEach: erp-engine/lib/object/forEach
    • goog.object.filter: erp-engine/lib/object/filter
    • goog.object.map: erp-engine/lib/object/map
    • goog.object.createSet: erp-engine/lib/object/createSet
    • ngin.keys.Files: erp-engine/keys/Files
    • ngin.keys.Groups: erp-engine/keys/Groups
    • ngin.keys.Products: erp-engine/keys/Products
    • ngin.keys.Roles: erp-engine/keys/Roles
    • ngin.keys.Users: erp-engine/keys/Users
    • ngin.keys.applyDisablingProductKeyCreation: erp-engine/lib/product/applyDisablingProductKeyCreation
    • ngin.progress.task: erp-engine/lib/progress/applyWithProgress
    • ngin.progress.indeterminateTask: erp-engine/lib/progress/applyWithIndeterminateProgress
    • ngin.permission.Assignment: erp-engine/lib/security/PermissionAssignment
    • ngin.permission.Manager: erp-engine/lib/security/PermissionManager
    • ngin.permission.Schema: erp-engine/lib/security/PermissionSchema
    • Permission: erp-engine/lib/security/PermissionReplicator
    • PermissionsMaintenance: erp-engine/lib/security/PermissionMaintenance
    • ngin.security.hasPermissionControl: erp-engine/lib/security/Security#hasPermissionControl
    • ngin.security.suggestPermissionApplyMode: erp-engine/lib/security/Security#suggestPermissionApplyMode
    • goog.object.every: erp-engine/lib/object/every
    • AppSms: erp-engine/lib/sms/AppSms
    • HumanSms: erp-engine/lib/sms/HumanSms
  • As variáveis globais das APIs nativas do Engine passam a também poder ser obtidas construindo as classes associadas a elas. Antes dessa versão, os construtores dessas classes não eram acessíveis. Segue a relação das variáveis globais e os módulos que contêm os construtores equivalentes:

    • memoryManager: erp-engine/lib/engine/MemoryManager
    • profiler: erp-engine/lib/profiler/Profiler
    • criticalSection: erp-engine/lib/sync/CriticalSection
    • classes: erp-engine/lib/database/Classes
    • licenseManager: erp-engine/lib/license/LicenseManager
    • javaServer: erp-engine/lib/java/JavaServer
    • scheduler: erp-engine/lib/scheduler/Scheduler
    • virtualFS: erp-engine/lib/vfs/VirtualFileSystem
    • unionFS: erp-engine/lib/ufs/UnionFileSystem
    • security: erp-engine/lib/security/Security
    • dbCache: erp-engine/lib/database/DBCache
    • idoDBManager: erp-engine/lib/ido/IdoDBManager
    • repository: erp-engine/lib/repository/Repository
  • As variáveis globais request, response, session, connection, database, engine e tempDB, nativas do Engine, passam a também poder ser obtidas por meio de um módulo especial chamado context. Esse módulo passa a representar o contexto de atendimento de uma requisição do Engine e nele estão contidos objetos que são configurados dinamicamente pelo Engine com base no usuário requisitante e a base de dados requisitada. Segue a relação das variáveis globais e seus módulos equivalentes:

    • request: erp-engine/context/request
    • response: erp-engine/context/response
    • session: erp-engine/context/session
    • connection: erp-engine/context/connection
    • database: erp-engine/context/database
    • engine: erp-engine/context/engine
    • tempDB: erp-engine/context/tempDB
  • A classe ComInstaller, responsável pela instalação de objetos COM do Windows, foi movida do produto Engine para o Store, pois era utilizada apenas na instalação do iPdvLib. O licenciamento do produto Store deve ser solicitado se essa classe for utilizada em alguma customização do sistema.

  • Foi criado o método DBCache.tableContainsKey com a finalidade de verificar se uma chave existe em uma tabela do cache local. Mais detalhes em http://developer.erp.bematech.com/js-api/latest/module-erp-engine_lib_database_DBCache-DBCache.html#tableContainsKey. (por Paulo César Moreno, #13102704)
    [-1897050167,calculoVencimentoCartaoProprio.ijs]
    [-1895835975,calculaRateioAtualNoExtrato.ijs]
    [-1898141721,engine.jaz]
    [-1897023544,erp-task.jaz]
    [-1898190623,stringList.js]
    [-1895835988,ExtratoAnterior.ijs]
    [-1895835985,ReceitasFinanceiras.ijs]
    [-1895835973,calculaRateioNoMovdispo.ijs]
    [-1895835962,ValoresReceitasFinanceirasComPagamentoRotativo.ijs]
    [-1894442748,AcrescimoCondicao.ijs]
    [-1891604048,0120 Engine.model]
    [-1898191188,keysUtilities.js]
    [-1898140328,0320 JAZ API.ijs]
    [-1897023575,erp-core.jaz]
    [-1898144796,0100 Engine.is]
    [-1898140329,0010 StrictMode.config]
    [-1898142643,0100 Engine.ijs]
    [-1898144741,KeyUtilities.it]
    [-1898144910,Validators.iejs]
    [-1898144405,Validators.it]
    [-1896041975,erp-store.jaz]
    [-1895835989,Extrato.ijs]
    [-1898145965,ComInstaller.js]
    [-1898141338,0100 Engine.ijs]
    [-1896042028,0600 Store.config]
    [-1898141835,iDBCsql library.ijs]
    [-1895835987,ResumoTitulosDeVenda.ijs]
    [-1895835963,ConstantesConfiguraçãoCard.ijs]
    [-1895835977,buscaDadosDoExtrato.ijs]
    [-1898141289,0100 Engine.ijs]
    [-1895835960,PrecoServicos.ijs]
    [-1899925559,errors.js]
    [-1897050164,funcões Relacionadas a Extrato do Cartão.ijs]
    [-1898191186,queryUtilities.js]
    [-1895835986,ResumoMovdispos.ijs]
    [-1895835976,calculaRateioDoExtratoNaData.ijs]
    [-1898145969,enumerators.js]
    [-1898140346,erp-engine.jaz]
    [-1895835984,CalculaReceitasFinanceirasComPagamentoRotativo.ijs]
    [-1895835979,GravaResultadosDoExtrato.ijs]
    [-1898140333,0100 Engine.config]
    [-1895835983,BuscaServicosAtivos.ijs]
    [-1897023545,erp-card.jaz]
    [-1895835974,calculaRateioNaNegociacao.ijs]
    [-1899925547,numbers.js]
    [-1892603660,webframework.jaz]
    [-1895835980,CalculaCarenciaDoExtrato.ijs]
    [-1895835982,EstornaServicosAtivos.ijs]
    [-1899925553,strings.js]
    [-1898140334,0010 StrictMode.config]
    [-1899925560,events.js]
    [-1895835981,CalculaValorDoExtrato.ijs]
    [-1895835971,ConfiguraçãoCard.ijs]

Comments