Test a Logic

post/formulamanager.testexec

Executes a draft logic for a given approvable and calculates the result. This command is used to test a logic during editing (the "Test Logic" button in IntelliJ Pricefx Studio).

The backend will compile and execute the test logic (specified in the testFormula property) without persisting it in the database.

Securitybasic or X-PriceFx-jwt
Request
Request Body schema: application/json
required
object
targetDate
string non-empty
required
object (Formula)

The Formula object. The type code is F.

lastUpdateByName
string <= 255 characters
createdByName
string
typedId
string
lastUpdateDate
string <date-time>
label
string <= 255 characters
formulaNature
string <= 255 characters
version
integer
simulationSet
string <= 255 characters
uniqueName
string <= 255 characters
formulaType
string
Possible values: "PRICING" "WORKFLOW" "LIBRARY"
createdBy
integer
Array of objects
Array
version
integer
typedId
string
elementName
string
elementLabel
string
elementDescription
string
elementGroups
Array of strings
conditionElementName
string
hideWarnings
boolean
excludeFromExport
boolean
protectedExpression
boolean
elementTimeout
integer
displayOptions
integer
formatType
string
Possible values: "NUMERIC" "NUMERIC_LONG" "MONEY" "PERCENT" "TEXT" "MONEY_EUR" "MONEY_USD" "MONEY_GBP" "MONEY_JPY" "MONEY_CHF" "MONEY_PLN" "DATETIME" "DATE" "INTEGER" "LINK" "COMPLEX" "SPARKLINE"
elementSuffix
string
allowOverride
boolean
summarize
boolean
hideOnNull
boolean
userGroup
string
cssProperties
string
resultGroup
string
combinationType
string
Possible values: "ADD" "SUBTRACT" "RESULT" "INFO" "FUNCTION" "BRICK" "PYTHON"
object
redAlert
object
yellowAlert
object
labelTranslations
string
createDate
string
createdBy
integer
lastUpdateDate
string
lastUpdateBy
integer
formulaExpression
string
userGroupEdit
string <= 255 characters
userGroupViewDetails
string <= 255 characters
validAfter
string <date>
Array of objects
Array
name
string
label
string
labelTranslations
string
group
string
dataType
string
inputType
string
formatType
string
from
string
to
string
values
string
required
boolean
alwaysEditable
boolean
status
string <= 255 characters
Possible values: "ACTIVE" "SIMULATIONONLY" "INACTIVE"
createDate
string <date-time>
lastUpdateBy
integer
knownElements
Array of strings
productSKU
string
item
string
items
Array of strings
nature
string
natureValue
string
headerPhases
object
formulaExpression
string
allResults
boolean
type
string
debugPort
string
allowObjectMods
boolean
selectedRows
Array of strings
formulaFilterParam
string
forceLineRecalculation
boolean

Used by PFX Studio for Header logics only.

Responses
200

OK

Response Schema: application/json
object
node
string
Array of objects
Array
elementName
string
elementLabel
string
elementResultDescription
string or null
traceMessages
string or null
alertMessage
string or null
warnings
Array of strings or null
alertType
string or null
displayOptions
integer
formatType
string or null
overridden
boolean
overridable
boolean
summarize
boolean
hideOnNull
boolean
hideWarnings
boolean
excludeFromExport
boolean
userGroup
string or null
resultGroup
string or null
labelTranslations
string or null
suffix
string or null
cssProperties
string or null
cellStyles
string or null
overrideValueOptions
string or null
overrideAllowEmpty
boolean
fieldType
integer
resultType
string
elementResultClass
string or null
elementResult
string or null
status
integer
Request samples
application/json
{
  • "data": {
    • "targetDate": "2021-12-10",
    • "testFormula": {
      • "elements": [
        • {
          }
        ],
      • "status": "ACTIVE",
      • "uniqueName": "MichalS",
      • "validAfter": "2020-01-01",
      • "__PROC": {
        • "sourceId": "CalculationLogic/MichalS+2020-01-01",
        • "typeCode": "F",
        • "fsId": "CalculationLogic/MichalS+2020-01-01",
        • "type": "CalculationLogic"
        }
      }
    }
}
Response samples
application/json
{
  • "response": {
    • "node": "pricefx-cluster-app-frontend-65c978b8dd-6wgk5",
    • "data": [
      • {
        • "elementName": "NewElement",
        • "elementLabel": "NewElement",
        • "elementResultDescription": null,
        • "traceMessages": null,
        • "alertMessage": null,
        • "warnings": [
          ],
        • "alertType": null,
        • "displayOptions": 16,
        • "formatType": null,
        • "overridden": false,
        • "overridable": false,
        • "summarize": false,
        • "hideOnNull": false,
        • "hideWarnings": false,
        • "excludeFromExport": false,
        • "userGroup": null,
        • "resultGroup": null,
        • "labelTranslations": null,
        • "suffix": null,
        • "cssProperties": null,
        • "cellStyles": null,
        • "overrideValueOptions": null,
        • "overrideAllowEmpty": true,
        • "fieldType": 0,
        • "resultType": "SIMPLE",
        • "elementResultClass": null,
        • "elementResult": null
        },
      • {
        • "elementName": "__TRACE__",
        • "elementLabel": "__TRACE__",
        • "elementResultDescription": null,
        • "traceMessages": null,
        • "alertMessage": null,
        • "warnings": null,
        • "alertType": null,
        • "displayOptions": 0,
        • "formatType": null,
        • "overridden": false,
        • "overridable": false,
        • "summarize": false,
        • "hideOnNull": false,
        • "hideWarnings": false,
        • "excludeFromExport": false,
        • "userGroup": null,
        • "resultGroup": null,
        • "labelTranslations": null,
        • "suffix": null,
        • "cssProperties": null,
        • "cellStyles": null,
        • "overrideValueOptions": null,
        • "overrideAllowEmpty": true,
        • "fieldType": 2,
        • "resultType": "SIMPLE",
        • "elementResultClass": "java.lang.String",
        • "elementResult": "---------------------------------------------------------\nDuration (ms) Count Execution element\n---------------------------------------------------------\n 599.54 100% ██████████ 1 TestExecute\n 0.26 0% ░░░░░░░░░░ 1 ├── search.Partition\n 2.34 0% ░░░░░░░░░░ 1 ├── search.ApplicationProperties\n 562.31 94% █████████░ 1 └── MichalS\n 0.09 0% ░░░░░░░░░░ 1 ├── POS.flush\n 562.11 94% █████████░ 1 └── NewElement\n 3.10 1% ░░░░░░░░░░ 1 └── search.PricingFormula\n"
        }
      ],
    • "status": 0
    }
}