Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • fieldValueExpressions: error when a value is undefined

    SmartClient Version: SNAPSHOT_v12.1d_2019-05-10/EVAL Deployment (expires 2019.07.09_07.46.37) Licensed to: Isomorphic Software (#ISC_EVAL_NIGHTLY)

    Hello, I've got a fieldValueExpressions with a field which is not always present in the previous response data.

    I expected that I would have got a null value, but I see a validation error (Must be a date), so I think it's trying to use the velocity expression as a string.

    Is it expected behaviour or it's a bug?

    Code:
    2019-05-14T17:31:41,786 DEBUG RPCManager Request #3 (DSRequest) payload: {
        values:{
        },
        operationConfig:{
            dataSource:"JOFC_CARRELLO_FAILED_FO",
            repo:null,
            operationType:"add",
            textMatchStyle:"exact"
        },
        appID:"builtinApplication",
        operation:"JOFC_CARRELLO_FAILED_FO_add",
        oldValues:{
        },
        fieldValueExpressions:{
            ....
            DATA_VERIFICA_INCASSO:"$responseData.last.DATA_VERIFICA_INCASSO",
            ....
        },
        criteria:{
        }
    } 
    2019-05-14T17:31:41,787 DEBUG RPCManager Request #4 (DSRequest) payload: {
        criteria:{
            ID_REC:74
        },
        operationConfig:{
            dataSource:"JOFC_CARRELLO_FO",
            repo:null,
            operationType:"remove",
            textMatchStyle:"exact"
        },
        appID:"builtinApplication",
        operation:"JOFC_CARRELLO_FO_remove",
        oldValues:{
            ID_REC:74
        }
    } 
    2019-05-14T17:31:41,795 INFO  SQLDriver [builtinApplication.annullaIdCarrello] Executing SQL query on 'DBJOFC' using connection '1177218852': UPDATE DBJOFC.JOFC_CARRELLO_DETTAGLI SET ID_CARRELLO_FK=NULL WHERE (JOFC_CARRELLO_DETTAGLI.ID_CARRELLO_FK=74 AND JOFC_CARRELLO_DETTAGLI.ID_CLUB_FK=1) 
    2019-05-14T17:31:41,801 INFO  SQLDriver [builtinApplication.JOFC_CARRELLO_FO_fetch] Executing SQL query on 'DBJOFC' using connection '1177218852': SELECT JOFC_CARRELLO.ID_REC, JOFC_CARRELLO.ID_CLUB_FK, JOFC_CARRELLO.IMPORTO_TOTALE, JOFC_CARRELLO.MODALITA_PAGAMENTO, JOFC_CARRELLO.DATA_VERIFICA_INCASSO, JOFC_CARRELLO.CODICE_TRANSAZIONE, JOFC_CARRELLO.ESITO_TRANSAZIONE, JOFC_CARRELLO.CREATOR, JOFC_CARRELLO.CREATOR_TIMESTAMP, JOFC_CARRELLO.MODIFIER, JOFC_CARRELLO.MODIFIER_TIMESTAMP, JOFC_CARRELLO.BRAND, JOFC_CARRELLO.CODICE_AUTORIZZAZIONE, JOFC_CARRELLO.CODICE_CONVENZIONE, JOFC_CARRELLO.DATA, JOFC_CARRELLO.ESITO, JOFC_CARRELLO.ID_OPERAZIONE, JOFC_CARRELLO.NAZIONE, JOFC_CARRELLO.ORA, JOFC_CARRELLO.REGIONE, JOFC_CARRELLO.TIMESTAMP, JOFC_CARRELLO.TIPO_PRODOTTO, JOFC_CARRELLO.TIPO_TRANSAZIONE, JOFC_CARRELLO.IMPORT, JOFC_CARRELLO.DIVISA FROM DBJOFC.JOFC_CARRELLO WHERE ((JOFC_CARRELLO.ID_REC = 74 AND JOFC_CARRELLO.ID_REC IS NOT NULL) AND (JOFC_CARRELLO.ID_CLUB_FK = 1 AND JOFC_CARRELLO.ID_CLUB_FK IS NOT NULL)) 
    2019-05-14T17:31:41,806 INFO  DSResponse DSResponse: List with 1 items 
    Found response for FIRST = com.isomorphic.datasource.DSResponse@6314726c which has data = [{MODIFIER=eeee@ddd.lk, ID_CLUB_FK=1, IMPORTO_TOTALE=16, MODIFIER_TIMESTAMP=2019-05-14, ESITO_TRANSAZIONE=false, ID_REC=74, CODICE_TRANSAZIONE=JOFC_22_H9PE_JVNYDZC1, CREATOR=eeee@ddd.lk, CREATOR_TIMESTAMP=2019-05-14}]
    2019-05-14T17:31:41,830 DEBUG AppBase [builtinApplication.JOFC_CARRELLO_FAILED_FO_add] No public zero-argument method named '_JOFC_CARRELLO_FAILED_FO_add' found, performing generic datasource operation 
    2019-05-14T17:31:41,831 DEBUG ValidationContext [builtinApplication.JOFC_CARRELLO_FAILED_FO_add] Adding validation errors at path '/JOFC_CARRELLO_FAILED_FO/DATA_VERIFICA_INCASSO/DATA_VERIFICA_INCASSO': {errorMessage=Must be a date.} 
    2019-05-14T17:31:41,831 DEBUG PoolableDataSourceFactory [builtinApplication.JOFC_CARRELLO_FAILED_FO_add] Tried to create DataSource  of type 'trimText' but null was returned 
    2019-05-14T17:31:41,833 INFO  Validation [builtinApplication.JOFC_CARRELLO_FAILED_FO_add] Validation error: [
        {
            DATA_VERIFICA_INCASSO:{
                errorMessage:"Must be a date."
            }
        }
    ]

  • #2
    Originally posted by claudiobosticco View Post
    I expected that I would have got a null value, but I see a validation error (Must be a date), so I think it's trying to use the velocity expression as a string.
    I confirm, I've tried removing that date field, and there are text fields which are also undefined and it saves the string
    $responseData.last.....

    Comment

    Working...
    X