Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hdkhanhkhtn/938b005dc89abad4e2c845852fe51a66 to your computer and use it in GitHub Desktop.
Save hdkhanhkhtn/938b005dc89abad4e2c845852fe51a66 to your computer and use it in GitHub Desktop.
Define job steptypes.js
{
"step-types": {
"script-module-step": [
{
"@type-id": "custom.HDK.ImportInventory",
"module": "app_storefront_controllers/cartridge/scripts/importInventory",
"function": "importInventory",
"parameters": {
"parameters": [
{
"@name": "WorkingFolder",
"@description": "Local folder relatively to IMPEX/src. (e.g download/inventory)",
"@type": "string",
"@required": false,
"@trim": true
},
{
"@name": "FilePattern",
"@description": "Input File pattern to search in local folder relatively to IMPEX/ (default is ^Inventory_(\\d){14}\\.xml).",
"@type": "string",
"@required": false,
"@trim": true
},
{
"@name": "ImportMode",
"@description": "Import Mode",
"@type": "string",
"@required": true,
"@trim": true,
"enum-values": {
"value": [
"MERGE",
"REPLACE",
"UPDATE",
"DELETE"
]
}
},
{
"@name": "ImportFailedStatus",
"@description": "Treat Import Failed as",
"@type": "string",
"@required": true,
"@trim": true,
"enum-values": {
"value": [
"WARN",
"ERROR"
]
}
},
{
"@name": "AfterProcessAction",
"@description": "Handle file after process",
"@type": "string",
"@required": true,
"@trim": true,
"enum-values": {
"value": [
"DELETE_FILE",
"KEEP_FILE",
"ARCHIVE_FILE"
]
}
}
]
},
"status-codes": {
"status": [
{
"@code": "ERROR",
"description": "Used when an error occurred."
},
{
"@code": "OK",
"description": "Used when everything went well."
},
{
"@code": "WARN",
"description": "Used when small, but acceptable problems occurred."
}
]
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment