diff options
Diffstat (limited to 'auth/cli-editor/src/main/resources')
6 files changed, 3373 insertions, 0 deletions
diff --git a/auth/cli-editor/src/main/resources/etc/editor/ApexModelProperties.json b/auth/cli-editor/src/main/resources/etc/editor/ApexModelProperties.json new file mode 100644 index 000000000..bd33d69da --- /dev/null +++ b/auth/cli-editor/src/main/resources/etc/editor/ApexModelProperties.json @@ -0,0 +1,9 @@ +{ + "defaultConceptVersion" : "0.0.1", + "defaultEventNamespace" : "org.onap.policy.apex.auth.clieditor", + "defaultEventSource" : "CLIEditorSource", + "defaultEventTarget" : "CLIEditorTarget", + "defaultLogicBlockStartTag" : "LS", + "defaultLogicBlockEndTag" : "LE", + "defaultMacroFileTag" : "#MACROFILE:" +} diff --git a/auth/cli-editor/src/main/resources/etc/editor/Commands.json b/auth/cli-editor/src/main/resources/etc/editor/Commands.json new file mode 100644 index 000000000..54ad92a2b --- /dev/null +++ b/auth/cli-editor/src/main/resources/etc/editor/Commands.json @@ -0,0 +1,2427 @@ +{ + "commandList": [ + { + "name": "quit", + "keywordlist": [ + "quit" + ], + "argumentList": [], + "systemCommand": "true", + "description": "quit execution of command handling, this command quits immediately without saving the model" + }, + { + "name": "back", + "keywordlist": [ + "back" + ], + "argumentList": [], + "systemCommand": "true", + "description": "go back one level in editor context hierarchy" + }, + { + "name": "help", + "keywordlist": [ + "help" + ], + "argumentList": [], + "systemCommand": "true", + "description": "output help information appropriate to this point in the editor context hierarchy" + }, + { + "name": "load", + "keywordlist": [ + "load" + ], + "argumentList": [ + { + "argumentName": "fileName", + "nullable": false, + "description": "Name of a file containing an Apex model in JSON or XML format" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexModel.loadFromFile", + "description": "Load an Apex model from a file" + }, + { + "name": "save", + "keywordlist": [ + "save" + ], + "argumentList": [ + { + "argumentName": "fileName", + "nullable": true, + "description": "Name of the file to save the model to" + }, + { + "argumentName": "xmlFlag", + "nullable": true, + "description": "Flag indicating that the model should be saved in XML format, model saved in JSON format if flag is false or is not specified" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexModel.saveToFile", + "description": "Save an Apex model to a file" + }, + { + "name": "analyse", + "keywordlist": [ + "analyse" + ], + "argumentList": [], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexModel.analyse", + "description": "Analyse an Apex model to show concept usage" + }, + { + "name": "validate", + "keywordlist": [ + "validate" + ], + "argumentList": [], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexModel.validate", + "description": "Validate the entire Apex model to ensure it is consistent" + }, + { + "name": "compare", + "keywordlist": [ + "compare" + ], + "argumentList": [ + { + "argumentName": "otherModelFileName", + "nullable": false, + "description": "The file name of the other model" + }, + { + "argumentName": "diffsOnly", + "nullable": true, + "description": "Flag indicating that only differences between the model are returned when set" + }, + { + "argumentName": "keysOnly", + "nullable": true, + "description": "Flag indicating that only keys are printed when set, more terse output" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexModel.compare", + "description": "Compare an Apex model with another Apex model" + }, + { + "name": "split", + "keywordlist": [ + "split" + ], + "argumentList": [ + { + "argumentName": "targetModelName", + "nullable": false, + "description": "the file name of the target model in which to store the model split out from the original model" + }, + { + "argumentName": "splitOutPolicies", + "nullable": "false", + "description": "the policies form the original model to include in the split out model, specified as a comma delimited list of policy names" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexModel.split", + "description": "Split an Apex model into a separate Apex model with only the specified policies" + }, + { + "name": "merge", + "keywordlist": [ + "merge" + ], + "argumentList": [ + { + "argumentName": "mergeInModelName", + "nullable": false, + "description": "the file name of the model to merge into the current model" + }, + { + "argumentName": "keepOriginal", + "nullable": "true", + "description": "if true, if a concept exists in both models, the original model copy of that concept is kept, if false, the mreged model overwrites" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexModel.merge", + "description": "Merge another Apex model into this model" + }, + { + "name": "createModel", + "keywordlist": [ + "model", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the model" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the model, omit to use the default version" + }, + { + "argumentName": "uuid", + "nullable": true, + "description": "model UUID, omit to generate a UUID" + }, + { + "argumentName": "description", + "nullable": true, + "description": "model description, omit to generate a description" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createModel", + "description": "Create an Apex model." + }, + { + "name": "listModel", + "keywordlist": [ + "model", + "list" + ], + "argumentList": [], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.listModel", + "description": "List an Apex model, list all the concepts in the model" + }, + { + "name": "deleteModel", + "keywordlist": [ + "model", + "delete" + ], + "argumentList": [], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deleteModel", + "description": "Delete an Apex model, clear all the concepts in the model" + }, + { + "name": "createKeyInformation", + "keywordlist": [ + "keyinfo", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the concept for the key information" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the concept for the key information, omit to use the default version" + }, + { + "argumentName": "uuid", + "nullable": true, + "description": "key information UUID, set to null to generate a UUID" + }, + { + "argumentName": "description", + "nullable": true, + "description": "concept description, omit to generate a description" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createKeyInformation", + "description": "Create key information" + }, + { + "name": "updateKeyInformation", + "keywordlist": [ + "keyinfo", + "update" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the concept for the key information" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the concept for the key information, omit to update the latest version" + }, + { + "argumentName": "uuid", + "nullable": true, + "description": "key information UUID, omit to not update" + }, + { + "argumentName": "description", + "nullable": true, + "description": "concept description, omit to not update" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.updateKeyInformation", + "description": "Update key information" + }, + { + "name": "listKeyInformation", + "keywordlist": [ + "keyinfo", + "list" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": true, + "description": "name of the concept for the key information, omit to list all" + }, + { + "argumentName": "version", + "nullable": true, + "description": "starting version of the concept for the key information, omit to list all versions" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.ListKeyInformation", + "description": "List key information" + }, + { + "name": "deleteKeyInformation", + "keywordlist": [ + "keyinfo", + "delete" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": true, + "description": "name of the concept for the key information" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the concept for the key information, omit to delete all versions" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deleteKeyInformation", + "description": "Delete key information" + }, + { + "name": "validateKeyInformation", + "keywordlist": [ + "keyinfo", + "validate" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": true, + "description": "name of the concept for the key information" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the concept for the key information, omit to validate all versions" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.validateKeyInformation", + "description": "Validate key information" + }, + { + "name": "createSchema", + "keywordlist": [ + "schema", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the schema" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the schema, omit to use the default version" + }, + { + "argumentName": "flavour", + "nullable": true, + "description": "the flavour of the technology for this schema, defaults to \"Java\"" + }, + { + "argumentName": "schema", + "nullable": false, + "description": "the schema text that describes the item represented by the schema" + }, + { + "argumentName": "uuid", + "nullable": true, + "description": "schema UUID, omit to generate a UUID" + }, + { + "argumentName": "description", + "nullable": true, + "description": "schema description, omit to generate a description" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createContextSchema", + "description": "Create a schema." + }, + { + "name": "updateSchema", + "keywordlist": [ + "schema", + "update" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the schema" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the schema, omit to use the default version" + }, + { + "argumentName": "flavour", + "nullable": true, + "description": "the flavour of the technology for this schema, defaults to \"Java\"" + }, + { + "argumentName": "schema", + "nullable": false, + "description": "the schema text that describes the item represented by the schema" + }, + { + "argumentName": "uuid", + "nullable": true, + "description": "schema UUID, omit to generate a UUID" + }, + { + "argumentName": "description", + "nullable": true, + "description": "schema description, omit to generate a description" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.updateContextSchema", + "description": "Update a schema." + }, + { + "name": "listSchemas", + "keywordlist": [ + "schema", + "list" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": true, + "description": "name of the schema, omit to list all" + }, + { + "argumentName": "version", + "nullable": true, + "description": "starting version of the schema, omit to list all versions" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.listContextSchemas", + "description": "List schemas." + }, + { + "name": "deleteSchema", + "keywordlist": [ + "schema", + "delete" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": true, + "description": "name of the schema" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the schema, omit to delete all versions" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deleteContextSchema", + "description": "Delete a schema." + }, + { + "name": "validateSchemas", + "keywordlist": [ + "schema", + "validate" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": true, + "description": "name of the schema, omit to list all" + }, + { + "argumentName": "version", + "nullable": true, + "description": "starting version of the schema, omit to list all versions" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.validateContextSchemas", + "description": "Validate context schemas." + }, + { + "name": "createEvent", + "keywordlist": [ + "event", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the event" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the event, omit to use the default version" + }, + { + "argumentName": "nameSpace", + "nullable": true, + "description": "of the event, omit to use the default value" + }, + { + "argumentName": "source", + "nullable": true, + "description": "of the event, omit to use the default value" + }, + { + "argumentName": "target", + "nullable": true, + "description": "of the event, omit to use the default value" + }, + { + "argumentName": "uuid", + "nullable": true, + "description": "event UUID, omit to generate a UUID" + }, + { + "argumentName": "description", + "nullable": true, + "description": "event description, omit to generate a description" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createEvent", + "description": "Create an event." + }, + { + "name": "updateEvent", + "keywordlist": [ + "event", + "update" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the event" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the event, omit to use the latest version" + }, + { + "argumentName": "nameSpace", + "nullable": true, + "description": "of the event, omit to not update" + }, + { + "argumentName": "source", + "nullable": true, + "description": "of the event, omit to not update" + }, + { + "argumentName": "target", + "nullable": true, + "description": "of the event, omit to not update" + }, + { + "argumentName": "uuid", + "nullable": true, + "description": "event UUID, omit to not update" + }, + { + "argumentName": "description", + "nullable": true, + "description": "event description, omit to not update" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.updateEvent", + "description": "Update an event." + }, + { + "name": "listEvent", + "keywordlist": [ + "event", + "list" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": true, + "description": "name of the event, omit to list all" + }, + { + "argumentName": "version", + "nullable": true, + "description": "starting version of the event, omit to list all versions" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.listEvent", + "description": "List events." + }, + { + "name": "deleteEvent", + "keywordlist": [ + "event", + "delete" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the event" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the event, omit to delete all versions" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deleteEvent", + "description": "Delete an event." + }, + { + "name": "validateEvent", + "keywordlist": [ + "event", + "validate" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": true, + "description": "name of the event, omit to list all" + }, + { + "argumentName": "version", + "nullable": true, + "description": "starting version of the event, omit to list all versions" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.validateEvent", + "description": "Validate events." + }, + { + "name": "createEventPar", + "keywordlist": [ + "event", + "parameter", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the event" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the event, omit to use the latest version" + }, + { + "argumentName": "parName", + "nullable": false, + "description": "of the parameter" + }, + { + "argumentName": "schemaName", + "nullable": false, + "description": "name of the parameter schema" + }, + { + "argumentName": "schemaVersion", + "nullable": true, + "description": "version of the parameter schema, omit to use the latest version" + }, + { + "argumentName": "optional", + "nullable": true, + "description": "indicates if the parameter is optional, if omitted, the parameter is mandatory" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createEventPar", + "description": "Create an event parameter." + }, + { + "name": "listEventPar", + "keywordlist": [ + "event", + "parameter", + "list" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the event" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the event, omit to list latest version" + }, + { + "argumentName": "parName", + "nullable": true, + "description": "name of the parameter, omit to list all parameters of the event" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.listEventPar", + "description": "List event parameters." + }, + { + "name": "deleteEventPar", + "keywordlist": [ + "event", + "parameter", + "delete" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the event" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the event, omit to use the latest version" + }, + { + "argumentName": "parName", + "nullable": true, + "description": "of the parameter, omit to delete all parameters" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deleteEventPar", + "description": "Delete an event parameter." + }, + { + "name": "createAlbum", + "keywordlist": [ + "album", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the context album" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the context album, omit to use the default version" + }, + { + "argumentName": "scope", + "nullable": false, + "description": "scope of application of the context album" + }, + { + "argumentName": "writable", + "nullable": false, + "description": "true if the album is writable, false otherwise, album defaults to writable if omitted" + }, + { + "argumentName": "schemaName", + "nullable": false, + "description": "name of the album schema" + }, + { + "argumentName": "schemaVersion", + "nullable": true, + "description": "version of the album schema, omit to use the latest version" + }, + { + "argumentName": "uuid", + "nullable": true, + "description": "context album UUID, omit to generate a UUID" + }, + { + "argumentName": "description", + "nullable": true, + "description": "album description, omit to generate a description" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createContextAlbum", + "description": "Create a context album." + }, + { + "name": "updateAlbum", + "keywordlist": [ + "album", + "update" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the context album" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the context album, omit to use the latest version" + }, + { + "argumentName": "scope", + "nullable": false, + "description": "scope of application of the context album" + }, + { + "argumentName": "writable", + "nullable": false, + "description": "true if the album is writable, false otherwise, album defaults to writable if omitted" + }, + { + "argumentName": "schemaName", + "nullable": false, + "description": "name of the album schema" + }, + { + "argumentName": "schemaVersion", + "nullable": true, + "description": "version of the album schema, omit to use the latest version" + }, + { + "argumentName": "uuid", + "nullable": true, + "description": "context album UUID, omit to not update" + }, + { + "argumentName": "description", + "nullable": true, + "description": "album description, omit to not update" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.updateContextAlbum", + "description": "Update a context album." + }, + { + "name": "listAlbum", + "keywordlist": [ + "album", + "list" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": true, + "description": "name of the context album, omit to list all" + }, + { + "argumentName": "version", + "nullable": true, + "description": "starting version of the context album, omit to list all versions" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.listContextAlbum", + "description": "List context albums." + }, + { + "name": "deleteAlbum", + "keywordlist": [ + "album", + "delete" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the context album" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the context album, omit to delete versions" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deleteContextAlbum", + "description": "Delete a context album." + }, + { + "name": "validateAlbum", + "keywordlist": [ + "album", + "validate" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": true, + "description": "name of the context album, omit to list all" + }, + { + "argumentName": "version", + "nullable": true, + "description": "starting version of the context album, omit to list all versions" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.validateContextAlbum", + "description": "Validate context albums." + }, + { + "name": "createTask", + "keywordlist": [ + "task", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to use the default version" + }, + { + "argumentName": "uuid", + "nullable": true, + "description": "task UUID, omit to generate a UUID" + }, + { + "argumentName": "description", + "nullable": true, + "description": "task description, omit to generate a description" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createTask", + "description": "Create a task." + }, + { + "name": "updateTask", + "keywordlist": [ + "task", + "update" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to use the latest version" + }, + { + "argumentName": "uuid", + "nullable": true, + "description": "task UUID, omit to not update" + }, + { + "argumentName": "description", + "nullable": true, + "description": "task description, omit to not update" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.updateTask", + "description": "Update a task." + }, + { + "name": "listTask", + "keywordlist": [ + "task", + "list" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": true, + "description": "name of the task, omit to list all" + }, + { + "argumentName": "version", + "nullable": true, + "description": "starting version of the task, omit to list all versions" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.listTask", + "description": "List tasks." + }, + { + "name": "deleteTask", + "keywordlist": [ + "task", + "delete" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to use the latest version" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deleteTask", + "description": "Delete a task." + }, + { + "name": "validateTask", + "keywordlist": [ + "task", + "validate" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": true, + "description": "name of the task, omit to list all" + }, + { + "argumentName": "version", + "nullable": true, + "description": "starting version of the task, omit to list all versions" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.validateTask", + "description": "Validate tasks." + }, + { + "name": "createTaskLogic", + "keywordlist": [ + "task", + "logic", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to use the latest version" + }, + { + "argumentName": "logicFlavour", + "nullable": true, + "description": "the task logic flavour for the task, omit to use the default task logic flavour" + }, + { + "argumentName": "logic", + "nullable": false, + "description": "the source code for the logic of the task" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createTaskLogic", + "description": "Create logic for a task." + }, + { + "name": "updateTaskLogic", + "keywordlist": [ + "task", + "logic", + "update" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to use the latest version" + }, + { + "argumentName": "logicFlavour", + "nullable": true, + "description": "the task logic flavour for the task, omit to not update" + }, + { + "argumentName": "logic", + "nullable": true, + "description": "the source code for the logic of the task, omit to not update" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.updateTaskLogic", + "description": "Update logic for a task." + }, + { + "name": "listTaskLogic", + "keywordlist": [ + "task", + "logic", + "list" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to list the latest version" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.listTaskLogic", + "description": "List task logic." + }, + { + "name": "deleteTaskLogic", + "keywordlist": [ + "task", + "logic", + "delete" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to use the latest version" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deleteTaskLogic", + "description": "Delete logic for a task." + }, + { + "name": "createTaskInputField", + "keywordlist": [ + "task", + "inputfield", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to use the latest version" + }, + { + "argumentName": "fieldName", + "nullable": false, + "description": "of the input field" + }, + { + "argumentName": "schemaName", + "nullable": false, + "description": "name of the input field schema" + }, + { + "argumentName": "schemaVersion", + "nullable": true, + "description": "version of the input field schema, omit to use the latest version" + }, + { + "argumentName": "optional", + "nullable": true, + "description": "indicates if the field is optional, if omitted, the field is mandatory" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createTaskInputField", + "description": "Create a task input field." + }, + { + "name": "listTaskInputField", + "keywordlist": [ + "task", + "inputfield", + "list" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to use the latest version" + }, + { + "argumentName": "fieldName", + "nullable": true, + "description": "field name of the input field, omit to list all input fields of the task" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.listTaskInputField", + "description": "List task input fields." + }, + { + "name": "deleteTaskInputField", + "keywordlist": [ + "task", + "inputfield", + "delete" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to use the latest version" + }, + { + "argumentName": "fieldName", + "nullable": true, + "description": "of the input field, omit to delete all input fields" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deleteTaskInputField", + "description": "Delete a task input field." + }, + { + "name": "createTaskOutputField", + "keywordlist": [ + "task", + "outputfield", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to use the latest version" + }, + { + "argumentName": "fieldName", + "nullable": false, + "description": "of the output field" + }, + { + "argumentName": "schemaName", + "nullable": false, + "description": "name of the output field schema" + }, + { + "argumentName": "schemaVersion", + "nullable": true, + "description": "version of the output field schema, omit to use the latest version" + }, + { + "argumentName": "optional", + "nullable": true, + "description": "indicates if the field is optional, if omitted, the field is mandatory" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createTaskOutputField", + "description": "Create a task output field." + }, + { + "name": "listTaskOutputField", + "keywordlist": [ + "task", + "outputfield", + "list" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to use the latest version" + }, + { + "argumentName": "fieldName", + "nullable": true, + "description": "field name of the output field, omit to list all output fields of the task" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.listTaskOutputField", + "description": "List task output fields." + }, + { + "name": "deleteTaskOutputField", + "keywordlist": [ + "task", + "outputfield", + "delete" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to use the latest version" + }, + { + "argumentName": "fieldName", + "nullable": true, + "description": "of the output field, omit to delete all output fields" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deleteTaskOutputField", + "description": "Delete a task output field." + }, + { + "name": "createTaskParameter", + "keywordlist": [ + "task", + "parameter", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to use the latest version" + }, + { + "argumentName": "parName", + "nullable": false, + "description": "of the parameter" + }, + { + "argumentName": "defaultValue", + "nullable": false, + "description": "of the parameter" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createTaskParameter", + "description": "Create a task parameter." + }, + { + "name": "listTaskParameter", + "keywordlist": [ + "task", + "parameter", + "list" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to use the latest version" + }, + { + "argumentName": "parName", + "nullable": true, + "description": "name of the parameter, omit to list all parameters of the task" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.listTaskParameter", + "description": "List task parameters." + }, + { + "name": "deleteTaskParameter", + "keywordlist": [ + "task", + "parameter", + "delete" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to use the latest version" + }, + { + "argumentName": "parName", + "nullable": true, + "description": "of the parameter, omit to delete all task parameters" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deleteTaskParameter", + "description": "Delete a task parameter." + }, + { + "name": "createTaskContextRef", + "keywordlist": [ + "task", + "contextref", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to use the latest version" + }, + { + "argumentName": "albumName", + "nullable": false, + "description": "name of the context album for the context reference" + }, + { + "argumentName": "albumVersion", + "nullable": true, + "description": "version of the context album for the context reference, omit to use the latest version" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createTaskContextRef", + "description": "Create a task context reference." + }, + { + "name": "listTaskContextRef", + "keywordlist": [ + "task", + "contextref", + "list" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to use the latest version" + }, + { + "argumentName": "albumName", + "nullable": true, + "description": "name of the context album for the context reference, omit to list all task context references" + }, + { + "argumentName": "albumVersion", + "nullable": true, + "description": "version of the context album for the context reference, omit to use the latest version" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.listTaskContextRef", + "description": "List task context references." + }, + { + "name": "deleteTaskContextRef", + "keywordlist": [ + "task", + "contextref", + "delete" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the task, omit to use the latest version" + }, + { + "argumentName": "albumName", + "nullable": true, + "description": "name of the context album for the context reference, omit to delete all task context references" + }, + { + "argumentName": "albumVersion", + "nullable": true, + "description": "version of the context album for the context reference, omit to use the latest version" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deleteTaskContextRef", + "description": "Delete a task context reference." + }, + { + "name": "createPolicy", + "keywordlist": [ + "policy", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the default version" + }, + { + "argumentName": "template", + "nullable": true, + "description": "template used to create the policy, omit to use the default template" + }, + { + "argumentName": "firstState", + "nullable": false, + "description": "the first state of the policy" + }, + { + "argumentName": "uuid", + "nullable": true, + "description": "policy UUID, omit to generate a UUID" + }, + { + "argumentName": "description", + "nullable": true, + "description": "policy description, omit to generate a description" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createPolicy", + "description": "Create a policy." + }, + { + "name": "updatePolicy", + "keywordlist": [ + "policy", + "update" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "template", + "nullable": true, + "description": "template used to create the policy, omit to not update" + }, + { + "argumentName": "firstState", + "nullable": false, + "description": "the first state of the policy" + }, + { + "argumentName": "uuid", + "nullable": true, + "description": "policy UUID, omit to not update" + }, + { + "argumentName": "description", + "nullable": true, + "description": "policy description, omit to not update" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.updatePolicy", + "description": "Update a policy." + }, + { + "name": "listPolicy", + "keywordlist": [ + "policy", + "list" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": true, + "description": "name of the policy, omit to list all" + }, + { + "argumentName": "version", + "nullable": true, + "description": "starting version of the policy, omit to list all versions" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.listPolicy", + "description": "List policies." + }, + { + "name": "deletePolicy", + "keywordlist": [ + "policy", + "delete" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deletePolicy", + "description": "Delete a policy." + }, + { + "name": "validatePolicy", + "keywordlist": [ + "policy", + "validate" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": true, + "description": "name of the policy, omit to list all" + }, + { + "argumentName": "version", + "nullable": true, + "description": "starting version of the policy, omit to list all versions" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.validatePolicy", + "description": "Validate policies." + }, + { + "name": "createPolicyState", + "keywordlist": [ + "policy", + "state", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + }, + { + "argumentName": "triggerName", + "nullable": false, + "description": "name of the trigger event for this state" + }, + { + "argumentName": "triggerVersion", + "nullable": true, + "description": "version of the trigger event for this state, omit to use the latest version" + }, + { + "argumentName": "defaultTaskName", + "nullable": false, + "description": "the default task name" + }, + { + "argumentName": "defaultTaskVersion", + "nullable": true, + "description": "the default task version, omit to use the latest version" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createPolicyState", + "description": "Create a policy state." + }, + { + "name": "updatePolicyState", + "keywordlist": [ + "policy", + "state", + "update" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + }, + { + "argumentName": "triggerName", + "nullable": true, + "description": "name of the trigger event for this state, omit to not update" + }, + { + "argumentName": "triggerVersion", + "nullable": false, + "description": "version of the trigger event for this state, set to use latest version of trigger event" + }, + { + "argumentName": "defaultTaskName", + "nullable": true, + "description": "the default task name, omit to not update" + }, + { + "argumentName": "defaultTaskVersion", + "nullable": false, + "description": "the default task version, set to use latest version of default task" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.updatePolicyState", + "description": "Update a policy state." + }, + { + "name": "listPolicyState", + "keywordlist": [ + "policy", + "state", + "list" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": true, + "description": "of the state, omit to list all states of the policy" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.listPolicyState", + "description": "List policy states." + }, + { + "name": "deletePolicyState", + "keywordlist": [ + "policy", + "state", + "delete" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": true, + "description": "of the state, omit to delete all states" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deletePolicyState", + "description": "Delete a policy state." + }, + { + "name": "createPolicyStateTaskSelectionLogic", + "keywordlist": [ + "policy", + "state", + "selecttasklogic", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + }, + { + "argumentName": "logicFlavour", + "nullable": true, + "description": "the task selection logic flavour for the state, omit to use the default task logic flavour" + }, + { + "argumentName": "logic", + "nullable": false, + "description": "the source code for the logic of the state" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createPolicyStateTaskSelectionLogic", + "description": "Create task selection logic for a state." + }, + { + "name": "updatePolicyStateTaskSelectionLogic", + "keywordlist": [ + "policy", + "state", + "selecttasklogic", + "update" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + }, + { + "argumentName": "logicFlavour", + "nullable": true, + "description": "the task selection logic flavour for the state, omit to not update" + }, + { + "argumentName": "logic", + "nullable": true, + "description": "the source code for the logic of the state, omit to not update" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.updatePolicyStateTaskSelectionLogic", + "description": "Update task selection logic for a state." + }, + { + "name": "listPolicyStateTaskSelectionLogic", + "keywordlist": [ + "policy", + "state", + "selecttasklogic", + "list" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.listPolicyStateTaskSelectionLogic", + "description": "List task selection logic for a state." + }, + { + "name": "deletePolicyStateTaskSelectionLogic", + "keywordlist": [ + "policy", + "state", + "selecttasklogic", + "delete" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deletePolicyStateTaskSelectionLogic", + "description": "Delete task selection logic for a state." + }, + { + "name": "createPolicyStateOutput", + "keywordlist": [ + "policy", + "state", + "output", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + }, + { + "argumentName": "outputName", + "nullable": false, + "description": "of the state output" + }, + { + "argumentName": "eventName", + "nullable": false, + "description": "name of the output event for this state output" + }, + { + "argumentName": "eventVersion", + "nullable": true, + "description": "version of the output event for this state output, omit to use the latest version" + }, + { + "argumentName": "nextState", + "nullable": true, + "description": "for this state to transition to, omit if this is the last state that the policy transitions to on this branch" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createPolicyStateOutput", + "description": "Create a policy state output." + }, + { + "name": "listPolicyStateOutput", + "keywordlist": [ + "policy", + "state", + "output", + "list" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + }, + { + "argumentName": "outputName", + "nullable": true, + "description": "of the state output, omit to list all outputs of the state" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.listPolicyStateOutput", + "description": "List policy state outputs." + }, + { + "name": "deletePolicyStateOutput", + "keywordlist": [ + "policy", + "state", + "output", + "delete" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + }, + { + "argumentName": "outputName", + "nullable": true, + "description": "of the state output, omit to delete all state outputs" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deletePolicyStateOutput", + "description": "Delete a policy state output." + }, + { + "name": "createPolicyStateFinalizerLogic", + "keywordlist": [ + "policy", + "state", + "finalizerlogic", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + }, + { + "argumentName": "finalizerLogicName", + "nullable": false, + "description": "name of the state finalizer logic" + }, + { + "argumentName": "logicFlavour", + "nullable": true, + "description": "the policy finalizer logic flavour for the state, omit to use the default task logic flavour" + }, + { + "argumentName": "logic", + "nullable": false, + "description": "the source code for the logic of the state" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createPolicyStateFinalizerLogic", + "description": "Create policy finalizer logic for a state." + }, + { + "name": "updatePolicyStateFinalizerLogic", + "keywordlist": [ + "policy", + "state", + "finalizerlogic", + "update" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + }, + { + "argumentName": "finalizerLogicName", + "nullable": false, + "description": "name of the state finalizer logic" + }, + { + "argumentName": "logicFlavour", + "nullable": true, + "description": "the policy finalizer logic flavour for the state, omit to not update" + }, + { + "argumentName": "logic", + "nullable": true, + "description": "the source code for the logic of the state, omit to not update" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.updatePolicyStateFinalizerLogic", + "description": "Update policy finalizer logic for a state." + }, + { + "name": "listPolicyStateFinalizerLogic", + "keywordlist": [ + "policy", + "state", + "finalizerlogic", + "list" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + }, + { + "argumentName": "finalizerLogicName", + "nullable": false, + "description": "name of the state finalizer logic" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.listPolicyStateFinalizerLogic", + "description": "List policy finalizer logic for a state." + }, + { + "name": "deletePolicyStateFinalizerLogic", + "keywordlist": [ + "policy", + "state", + "finalizerlogic", + "delete" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + }, + { + "argumentName": "finalizerLogicName", + "nullable": false, + "description": "name of the state finalizer logic" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deletePolicyStateFinalizerLogic", + "description": "Delete policy finalizer logic for a state." + }, + { + "name": "createPolicyStateTaskRef", + "keywordlist": [ + "policy", + "state", + "taskref", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + }, + { + "argumentName": "taskLocalName", + "nullable": true, + "description": "local name of the task in the state, omit to use the task name" + }, + { + "argumentName": "taskName", + "nullable": false, + "description": "name of the task" + }, + { + "argumentName": "taskVersion", + "nullable": true, + "description": "version of the task, omit to use the latest version" + }, + { + "argumentName": "outputType", + "nullable": false, + "description": "Type of output for the task, must be DIRECT for direct output to a state output or LOGIC for output to state finalizer logic" + }, + { + "argumentName": "outputName", + "nullable": false, + "description": "the name of the state output or state state finalizer logic to handle the task output" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createPolicyStateTaskRef", + "description": "Create a policy state task reference." + }, + { + "name": "listPolicyStateTaskRef", + "keywordlist": [ + "policy", + "state", + "taskref", + "list" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + }, + { + "argumentName": "taskName", + "nullable": true, + "description": "name of the task, omit to list all task references" + }, + { + "argumentName": "taskVersion", + "nullable": true, + "description": "version of the task, omit to use the latest version" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.listPolicyStateTaskRef", + "description": "List policy state task references." + }, + { + "name": "deletePolicyStateTaskRef", + "keywordlist": [ + "policy", + "state", + "taskref", + "delete" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + }, + { + "argumentName": "taskName", + "nullable": true, + "description": "name of the task, omit to delete all task references" + }, + { + "argumentName": "taskVersion", + "nullable": true, + "description": "version of the task, omit to use the latest version" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deletePolicyStateTaskRef", + "description": "Delete a policy state task reference." + }, + { + "name": "createPolicyStateContextRef", + "keywordlist": [ + "policy", + "state", + "contextref", + "create" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + }, + { + "argumentName": "albumName", + "nullable": false, + "description": "name of the context album for the context reference" + }, + { + "argumentName": "albumVersion", + "nullable": true, + "description": "version of the context album for the context reference, omit to use the latest version" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.createPolicyStateContextRef", + "description": "Create a policy state context reference." + }, + { + "name": "listPolicyStateContextRef", + "keywordlist": [ + "policy", + "state", + "contextref", + "list" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the latest version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + }, + { + "argumentName": "albumName", + "nullable": true, + "description": "name of the context album for the context reference, omit to list all task context references" + }, + { + "argumentName": "albumVersion", + "nullable": true, + "description": "version of the context album for the context reference, omit to use the latest version" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.listPolicyStateContextRef", + "description": "List policy state context references." + }, + { + "name": "deletePolicyStateContextRef", + "keywordlist": [ + "policy", + "state", + "contextref", + "delete" + ], + "argumentList": [ + { + "argumentName": "name", + "nullable": false, + "description": "name of the policy" + }, + { + "argumentName": "version", + "nullable": true, + "description": "version of the policy, omit to use the default version" + }, + { + "argumentName": "stateName", + "nullable": false, + "description": "of the state" + }, + { + "argumentName": "albumName", + "nullable": true, + "description": "name of the context album for the context reference, omit to delete all task context references" + }, + { + "argumentName": "albumVersion", + "nullable": true, + "description": "version of the context album for the context reference, omit to use the latest version" + } + ], + "apiMethod": "org.onap.policy.apex.model.modelapi.ApexEditorAPI.deletePolicyStateContextRef", + "description": "Delete a policy state context reference." + } + ] +} diff --git a/auth/cli-editor/src/main/resources/examples/scripts/ShellPolicyModel.apex b/auth/cli-editor/src/main/resources/examples/scripts/ShellPolicyModel.apex new file mode 100644 index 000000000..1b4507fc7 --- /dev/null +++ b/auth/cli-editor/src/main/resources/examples/scripts/ShellPolicyModel.apex @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------- +# ============LICENSE_START======================================================= +# Copyright (C) 2016-2018 Ericsson. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= +#------------------------------------------------------------------------------- + +model create name=ShellPolicyModel + +schema create name=Test_type flavour=Java schema=java.lang.String
\ No newline at end of file diff --git a/auth/cli-editor/src/main/resources/examples/scripts/ShellPolicyModelAddSchema.apex b/auth/cli-editor/src/main/resources/examples/scripts/ShellPolicyModelAddSchema.apex new file mode 100644 index 000000000..ed1b4e437 --- /dev/null +++ b/auth/cli-editor/src/main/resources/examples/scripts/ShellPolicyModelAddSchema.apex @@ -0,0 +1,21 @@ +#------------------------------------------------------------------------------- +# ============LICENSE_START======================================================= +# Copyright (C) 2016-2018 Ericsson. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= +#------------------------------------------------------------------------------- + +schema create name=Another_Test_type flavour=Java schema=java.lang.String
\ No newline at end of file diff --git a/auth/cli-editor/src/main/resources/examples/scripts/TestPolicyAvroEventContext.apex b/auth/cli-editor/src/main/resources/examples/scripts/TestPolicyAvroEventContext.apex new file mode 100644 index 000000000..f333a3e9a --- /dev/null +++ b/auth/cli-editor/src/main/resources/examples/scripts/TestPolicyAvroEventContext.apex @@ -0,0 +1,569 @@ +#------------------------------------------------------------------------------- +# ============LICENSE_START======================================================= +# Copyright (C) 2016-2018 Ericsson. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= +#------------------------------------------------------------------------------- + +model create name=Test_PolicyModel + +schema create name=AvroBoolean_type flavour=Avro schema=LS +{ + "type" : "boolean" +} +LE + +schema create name=AvroByte_type flavour=Avro schema=LS +{ + "type" : "int" +} +LE + +schema create name=AvroShort_type flavour=Avro schema=LS +{ + "type" : "int" +} +LE + +schema create name=AvroInteger_type flavour=Avro schema=LS +{ + "type" : "int" +} +LE + +schema create name=AvroLong_type flavour=Avro schema=LS +{ + "type" : "long" +} +LE + +schema create name=AvroFloat_type flavour=Avro schema=LS +{ + "type" : "float" +} +LE + +schema create name=AvroDouble_type flavour=Avro schema=LS +{ + "type" : "double" +} +LE + +schema create name=AvroString_type flavour=Avro schema=LS +{ + "type" : "string"} +LE + +schema create name=AvroMap_type flavour=Avro schema=LS +{ + "type": "map", "values": "string" +} +LE + +schema create name=AvroArray_type flavour=Avro schema=LS +{ + "type": "array", "items": "string" +} +LE + +schema create name=CustomBoolean_type flavour=Avro schema=LS +{ + "type" : "record", + "name" : "TestContextItem000", + "namespace" : "com.ericsson.apex.context.test.avro.concepts", + "fields" : [ + {"name": "flag", "type": "boolean"} + ] +} +LE + +schema create name=CustomByte_type flavour=Avro schema=LS +{ + "type" : "record", + "name" : "TestContextItem001", + "namespace" : "com.ericsson.apex.context.test.avro.concepts", + "fields" : [ + {"name": "byteValue", "type": "int"} + ] +} +LE + +schema create name=CustomInteger_type flavour=Avro schema=LS +{ + "type" : "record", + "name" : "TestContextItem002", + "namespace" : "com.ericsson.apex.context.test.avro.concepts", + "fields" : [ + {"name": "intValue", "type": "int"} + ] +} +LE + +schema create name=CustomLong_type flavour=Avro schema=LS +{ + "type" : "record", + "name" : "TestContextItem003", + "namespace" : "com.ericsson.apex.context.test.avro.concepts", + "fields" : [ + {"name": "longValue", "type": "long"} + ] +} +LE + +schema create name=CustomFloat_type flavour=Avro schema=LS +{ + "type" : "record", + "name" : "TestContextItem004", + "namespace" : "com.ericsson.apex.context.test.avro.concepts", + "fields" : [ + {"name": "floatValue", "type": "float"} + ] +} +LE + +schema create name=CustomDouble_type flavour=Avro schema=LS +{ + "type" : "record", + "name" : "TestContextItem005", + "namespace" : "com.ericsson.apex.context.test.avro.concepts", + "fields" : [ + {"name": "doubleValue", "type": "double"} + ] +} +LE + +schema create name=CustomString_type flavour=Avro schema=LS +{ + "type" : "record", + "name" : "TestContextItem006", + "namespace" : "com.ericsson.apex.context.test.avro.concepts", + "fields" : [ + {"name": "stringValue", "type": "string"} + ] +} +LE + +schema create name=CustomALong_type flavour=Avro schema=LS +{ + "type" : "record", + "name" : "TestContextItem007", + "namespace" : "com.ericsson.apex.context.test.avro.concepts", + "fields" : [ + {"name": "longValue", "type": "long"} + ] +} +LE + +schema create name=CustomDate0_type flavour=Avro schema=LS +{ + "type" : "record", + "name" : "TestContextItem008", + "namespace" : "com.ericsson.apex.context.test.avro.concepts", + "fields" : [ + {"name": "time" , "type": "long"}, + {"name": "year" , "type": "int"}, + {"name": "month" , "type": "int"}, + {"name": "day" , "type": "int"}, + {"name": "hour" , "type": "int"}, + {"name": "minute" , "type": "int"}, + {"name": "second" , "type": "int"}, + {"name": "milliSecond", "type": "int"} + ] +} +LE + +schema create name=CustomDate1_type flavour=Avro schema=LS +{ + "type" : "record", + "name" : "TestContextItem009", + "namespace" : "com.ericsson.apex.context.test.avro.concepts", + "fields" : [ + {"name": "dateValue" , "type": { + "type" : "record", + "name" : "TestContextItem008", + "namespace" : "com.ericsson.apex.context.test.avro.concepts", + "fields" : [ + {"name": "time" , "type": "long"}, + {"name": "year" , "type": "int"}, + {"name": "month" , "type": "int"}, + {"name": "day" , "type": "int"}, + {"name": "hour" , "type": "int"}, + {"name": "minute" , "type": "int"}, + {"name": "second" , "type": "int"}, + {"name": "milliSecond", "type": "int"} + ] + } + }, + {"name": "dst" , "type": "boolean"}, + {"name": "timeZoneString", "type": "string"} + ] +} +LE + +schema create name=CustomDate2_type flavour=Avro schema=LS +{ + "type" : "record", + "name" : "TestContextItem00A", + "namespace" : "com.ericsson.apex.context.test.avro.concepts", + "fields" : [ + {"name": "dateValue" , "type": { + "type" : "record", + "name" : "TestContextItem008", + "namespace" : "com.ericsson.apex.context.test.avro.concepts", + "fields" : [ + {"name": "time" , "type": "long"}, + {"name": "year" , "type": "int"}, + {"name": "month" , "type": "int"}, + {"name": "day" , "type": "int"}, + {"name": "hour" , "type": "int"}, + {"name": "minute" , "type": "int"}, + {"name": "second" , "type": "int"}, + {"name": "milliSecond", "type": "int"} + ] + } + }, + {"name": "dst" , "type": "boolean"}, + {"name": "timeZoneString", "type": "string"}, + {"name": "utcOffset" , "type": "int"}, + {"name": "localeLanguage", "type": "string"}, + {"name": "localeCountry" , "type": "string"} + ] +} +LE + +schema create name=CustomSet_type flavour=Avro schema=LS +{ + "type" : "record", + "name" : "TestContextItem00B", + "namespace" : "com.ericsson.apex.context.test.avro.concepts", + "fields" : [ + {"name": "setValue", "type": { + "type": "array", "items": "string" + } + } + ] +} +LE + +schema create name=CustomMap_type flavour=Avro schema=LS +{ + "type" : "record", + "name" : "TestContextItem00C", + "namespace" : "com.ericsson.apex.context.test.avro.concepts", + "fields" : [ + {"name": "mapValue", "type": { + "type": "map", "values": "string" + } + } + ] +} +LE + +event create name=Test_InputEvent nameSpace=com.ericsson.apex.test source=External target=Apex + +event parameter create name=Test_InputEvent parName=AvroBoolean schemaName=AvroBoolean_type optional=false +event parameter create name=Test_InputEvent parName=AvroByte schemaName=AvroByte_type optional=false +event parameter create name=Test_InputEvent parName=AvroShort schemaName=AvroShort_type +event parameter create name=Test_InputEvent parName=AvroInteger schemaName=AvroInteger_type optional=false +event parameter create name=Test_InputEvent parName=AvroLong schemaName=AvroLong_type +event parameter create name=Test_InputEvent parName=AvroFloat schemaName=AvroFloat_type +event parameter create name=Test_InputEvent parName=AvroDouble schemaName=AvroDouble_type optional=false +event parameter create name=Test_InputEvent parName=AvroString schemaName=AvroString_type +event parameter create name=Test_InputEvent parName=AvroMap schemaName=AvroMap_type +event parameter create name=Test_InputEvent parName=AvroArray schemaName=AvroArray_type +event parameter create name=Test_InputEvent parName=CustomBoolean schemaName=CustomBoolean_type +event parameter create name=Test_InputEvent parName=CustomByte schemaName=CustomByte_type +event parameter create name=Test_InputEvent parName=CustomInteger schemaName=CustomInteger_type +event parameter create name=Test_InputEvent parName=CustomLong schemaName=CustomLong_type +event parameter create name=Test_InputEvent parName=CustomFloat schemaName=CustomFloat_type +event parameter create name=Test_InputEvent parName=CustomDouble schemaName=CustomDouble_type +event parameter create name=Test_InputEvent parName=CustomString schemaName=CustomString_type +event parameter create name=Test_InputEvent parName=CustomALong schemaName=CustomALong_type +event parameter create name=Test_InputEvent parName=CustomDate0 schemaName=CustomDate0_type +event parameter create name=Test_InputEvent parName=CustomDate1 schemaName=CustomDate1_type +event parameter create name=Test_InputEvent parName=CustomDate2 schemaName=CustomDate2_type +event parameter create name=Test_InputEvent parName=CustomSet schemaName=CustomSet_type +event parameter create name=Test_InputEvent parName=CustomMap schemaName=CustomMap_type + +event create name=Test_OutputEvent nameSpace=com.ericsson.apex.test source=External target=Apex + +event parameter create name=Test_OutputEvent parName=AvroBoolean schemaName=AvroBoolean_type +event parameter create name=Test_OutputEvent parName=AvroByte schemaName=AvroByte_type +event parameter create name=Test_OutputEvent parName=AvroShort schemaName=AvroShort_type +event parameter create name=Test_OutputEvent parName=AvroInteger schemaName=AvroInteger_type +event parameter create name=Test_OutputEvent parName=AvroLong schemaName=AvroLong_type +event parameter create name=Test_OutputEvent parName=AvroFloat schemaName=AvroFloat_type +event parameter create name=Test_OutputEvent parName=AvroDouble schemaName=AvroDouble_type +event parameter create name=Test_OutputEvent parName=AvroString schemaName=AvroString_type +event parameter create name=Test_OutputEvent parName=AvroMap schemaName=AvroMap_type +event parameter create name=Test_OutputEvent parName=AvroArray schemaName=AvroArray_type +event parameter create name=Test_OutputEvent parName=CustomBoolean schemaName=CustomBoolean_type +event parameter create name=Test_OutputEvent parName=CustomByte schemaName=CustomByte_type +event parameter create name=Test_OutputEvent parName=CustomInteger schemaName=CustomInteger_type +event parameter create name=Test_OutputEvent parName=CustomLong schemaName=CustomLong_type +event parameter create name=Test_OutputEvent parName=CustomFloat schemaName=CustomFloat_type +event parameter create name=Test_OutputEvent parName=CustomDouble schemaName=CustomDouble_type +event parameter create name=Test_OutputEvent parName=CustomString schemaName=CustomString_type +event parameter create name=Test_OutputEvent parName=CustomALong schemaName=CustomALong_type +event parameter create name=Test_OutputEvent parName=CustomDate0 schemaName=CustomDate0_type +event parameter create name=Test_OutputEvent parName=CustomDate1 schemaName=CustomDate1_type +event parameter create name=Test_OutputEvent parName=CustomDate2 schemaName=CustomDate2_type +event parameter create name=Test_OutputEvent parName=CustomSet schemaName=CustomSet_type +event parameter create name=Test_OutputEvent parName=CustomMap schemaName=CustomMap_type + +album create name=AvroBooleanAlbum scope=policy writable=true schemaName=AvroBoolean_type +album create name=AvroByteAlbum scope=policy writable=true schemaName=AvroByte_type +album create name=AvroShortAlbum scope=policy writable=true schemaName=AvroShort_type +album create name=AvroIntegerAlbum scope=policy writable=true schemaName=AvroInteger_type +album create name=AvroLongAlbum scope=policy writable=true schemaName=AvroLong_type +album create name=AvroFloatAlbum scope=policy writable=true schemaName=AvroFloat_type +album create name=AvroDoubleAlbum scope=policy writable=true schemaName=AvroDouble_type +album create name=AvroStringAlbum scope=policy writable=true schemaName=AvroString_type +album create name=AvroMapAlbum scope=policy writable=true schemaName=AvroMap_type +album create name=AvroArrayAlbum scope=policy writable=true schemaName=AvroArray_type +album create name=CustomBooleanAlbum scope=policy writable=true schemaName=CustomBoolean_type +album create name=CustomByteAlbum scope=policy writable=true schemaName=CustomByte_type +album create name=CustomIntegerAlbum scope=policy writable=true schemaName=CustomInteger_type +album create name=CustomLongAlbum scope=policy writable=true schemaName=CustomLong_type +album create name=CustomFloatAlbum scope=policy writable=true schemaName=CustomFloat_type +album create name=CustomDoubleAlbum scope=policy writable=true schemaName=CustomDouble_type +album create name=CustomStringAlbum scope=policy writable=true schemaName=CustomString_type +album create name=CustomALongAlbum scope=policy writable=true schemaName=CustomALong_type +album create name=CustomDate0Album scope=policy writable=true schemaName=CustomDate0_type +album create name=CustomDate1Album scope=policy writable=true schemaName=CustomDate1_type +album create name=CustomDate2Album scope=policy writable=true schemaName=CustomDate2_type +album create name=CustomSetAlbum scope=policy writable=true schemaName=CustomSet_type +album create name=CustomMapAlbum scope=policy writable=true schemaName=CustomMap_type + +task create name=Test_Task + +task inputfield create name=Test_Task fieldName=AvroBoolean schemaName=AvroBoolean_type +task inputfield create name=Test_Task fieldName=AvroByte schemaName=AvroByte_type +task inputfield create name=Test_Task fieldName=AvroShort schemaName=AvroShort_type +task inputfield create name=Test_Task fieldName=AvroInteger schemaName=AvroInteger_type +task inputfield create name=Test_Task fieldName=AvroLong schemaName=AvroLong_type +task inputfield create name=Test_Task fieldName=AvroFloat schemaName=AvroFloat_type +task inputfield create name=Test_Task fieldName=AvroDouble schemaName=AvroDouble_type +task inputfield create name=Test_Task fieldName=AvroString schemaName=AvroString_type +task inputfield create name=Test_Task fieldName=AvroMap schemaName=AvroMap_type +task inputfield create name=Test_Task fieldName=AvroArray schemaName=AvroArray_type +task inputfield create name=Test_Task fieldName=CustomBoolean schemaName=CustomBoolean_type +task inputfield create name=Test_Task fieldName=CustomByte schemaName=CustomByte_type +task inputfield create name=Test_Task fieldName=CustomInteger schemaName=CustomInteger_type +task inputfield create name=Test_Task fieldName=CustomLong schemaName=CustomLong_type +task inputfield create name=Test_Task fieldName=CustomFloat schemaName=CustomFloat_type +task inputfield create name=Test_Task fieldName=CustomDouble schemaName=CustomDouble_type +task inputfield create name=Test_Task fieldName=CustomString schemaName=CustomString_type +task inputfield create name=Test_Task fieldName=CustomALong schemaName=CustomALong_type +task inputfield create name=Test_Task fieldName=CustomDate0 schemaName=CustomDate0_type +task inputfield create name=Test_Task fieldName=CustomDate1 schemaName=CustomDate1_type +task inputfield create name=Test_Task fieldName=CustomDate2 schemaName=CustomDate2_type +task inputfield create name=Test_Task fieldName=CustomSet schemaName=CustomSet_type +task inputfield create name=Test_Task fieldName=CustomMap schemaName=CustomMap_type + +task outputfield create name=Test_Task fieldName=AvroBoolean schemaName=AvroBoolean_type +task outputfield create name=Test_Task fieldName=AvroByte schemaName=AvroByte_type +task outputfield create name=Test_Task fieldName=AvroShort schemaName=AvroShort_type +task outputfield create name=Test_Task fieldName=AvroInteger schemaName=AvroInteger_type +task outputfield create name=Test_Task fieldName=AvroLong schemaName=AvroLong_type +task outputfield create name=Test_Task fieldName=AvroFloat schemaName=AvroFloat_type +task outputfield create name=Test_Task fieldName=AvroDouble schemaName=AvroDouble_type +task outputfield create name=Test_Task fieldName=AvroString schemaName=AvroString_type +task outputfield create name=Test_Task fieldName=AvroMap schemaName=AvroMap_type +task outputfield create name=Test_Task fieldName=AvroArray schemaName=AvroArray_type +task outputfield create name=Test_Task fieldName=CustomBoolean schemaName=CustomBoolean_type +task outputfield create name=Test_Task fieldName=CustomByte schemaName=CustomByte_type +task outputfield create name=Test_Task fieldName=CustomInteger schemaName=CustomInteger_type +task outputfield create name=Test_Task fieldName=CustomLong schemaName=CustomLong_type +task outputfield create name=Test_Task fieldName=CustomFloat schemaName=CustomFloat_type +task outputfield create name=Test_Task fieldName=CustomDouble schemaName=CustomDouble_type +task outputfield create name=Test_Task fieldName=CustomString schemaName=CustomString_type +task outputfield create name=Test_Task fieldName=CustomALong schemaName=CustomALong_type +task outputfield create name=Test_Task fieldName=CustomDate0 schemaName=CustomDate0_type +task outputfield create name=Test_Task fieldName=CustomDate1 schemaName=CustomDate1_type +task outputfield create name=Test_Task fieldName=CustomDate2 schemaName=CustomDate2_type +task outputfield create name=Test_Task fieldName=CustomSet schemaName=CustomSet_type +task outputfield create name=Test_Task fieldName=CustomMap schemaName=CustomMap_type + +task contextref create name=Test_Task albumName=AvroBooleanAlbum +task contextref create name=Test_Task albumName=AvroByteAlbum +task contextref create name=Test_Task albumName=AvroShortAlbum +task contextref create name=Test_Task albumName=AvroIntegerAlbum +task contextref create name=Test_Task albumName=AvroLongAlbum +task contextref create name=Test_Task albumName=AvroFloatAlbum +task contextref create name=Test_Task albumName=AvroDoubleAlbum +task contextref create name=Test_Task albumName=AvroStringAlbum +task contextref create name=Test_Task albumName=AvroMapAlbum +task contextref create name=Test_Task albumName=AvroArrayAlbum +task contextref create name=Test_Task albumName=CustomBooleanAlbum +task contextref create name=Test_Task albumName=CustomByteAlbum +task contextref create name=Test_Task albumName=CustomIntegerAlbum +task contextref create name=Test_Task albumName=CustomLongAlbum +task contextref create name=Test_Task albumName=CustomFloatAlbum +task contextref create name=Test_Task albumName=CustomDoubleAlbum +task contextref create name=Test_Task albumName=CustomStringAlbum +task contextref create name=Test_Task albumName=CustomALongAlbum +task contextref create name=Test_Task albumName=CustomDate0Album +task contextref create name=Test_Task albumName=CustomDate1Album +task contextref create name=Test_Task albumName=CustomDate2Album +task contextref create name=Test_Task albumName=CustomSetAlbum +task contextref create name=Test_Task albumName=CustomMapAlbum + +task logic create name=Test_Task logicFlavour=JAVASCRIPT logic=LS +executor.logger.debug(executor.subject.id); + +executor.logger.debug(executor.inFields); + +executor.getContextAlbum("AvroBooleanAlbum" ).put("AvroBoolean" , executor.inFields.get("AvroBoolean")); +executor.getContextAlbum("AvroByteAlbum" ).put("AvroByte" , executor.inFields.get("AvroByte" )); +executor.getContextAlbum("AvroShortAlbum" ).put("AvroShort" , executor.inFields.get("AvroShort" )); +executor.getContextAlbum("AvroIntegerAlbum" ).put("AvroInteger" , executor.inFields.get("AvroInteger")); +executor.getContextAlbum("AvroLongAlbum" ).put("AvroLong" , executor.inFields.get("AvroLong" )); +executor.getContextAlbum("AvroFloatAlbum" ).put("AvroFloat" , executor.inFields.get("AvroFloat" )); +executor.getContextAlbum("AvroDoubleAlbum" ).put("AvroDouble" , executor.inFields.get("AvroDouble" )); +executor.getContextAlbum("AvroStringAlbum" ).put("AvroString" , executor.inFields.get("AvroString" )); +executor.getContextAlbum("AvroMapAlbum" ).put("AvroMap" , executor.inFields.get("AvroMap" )); +executor.getContextAlbum("AvroArrayAlbum" ).put("AvroArray" , executor.inFields.get("AvroArray" )); +executor.getContextAlbum("CustomBooleanAlbum").put("CustomBoolean", executor.inFields.get("CustomBoolean")); +executor.getContextAlbum("CustomByteAlbum" ).put("CustomByte" , executor.inFields.get("CustomByte" )); +executor.getContextAlbum("CustomIntegerAlbum").put("CustomInteger", executor.inFields.get("CustomInteger")); +executor.getContextAlbum("CustomLongAlbum" ).put("CustomLong" , executor.inFields.get("CustomLong" )); +executor.getContextAlbum("CustomFloatAlbum" ).put("CustomFloat" , executor.inFields.get("CustomFloat" )); +executor.getContextAlbum("CustomDoubleAlbum" ).put("CustomDouble" , executor.inFields.get("CustomDouble" )); +executor.getContextAlbum("CustomStringAlbum" ).put("CustomString" , executor.inFields.get("CustomString" )); +executor.getContextAlbum("CustomALongAlbum" ).put("CustomALong" , executor.inFields.get("CustomALong" )); +executor.getContextAlbum("CustomDate0Album" ).put("CustomDate0" , executor.inFields.get("CustomDate0" )); +executor.getContextAlbum("CustomDate1Album" ).put("CustomDate1" , executor.inFields.get("CustomDate1" )); +executor.getContextAlbum("CustomDate2Album" ).put("CustomDate2" , executor.inFields.get("CustomDate2" )); +executor.getContextAlbum("CustomSetAlbum" ).put("CustomSet" , executor.inFields.get("CustomSet" )); +executor.getContextAlbum("CustomMapAlbum" ).put("CustomMap" , executor.inFields.get("CustomMap" )); + +var avroBoolean = executor.getContextAlbum("AvroBooleanAlbum" ).get("AvroBoolean" ); +var avroByte = executor.getContextAlbum("AvroByteAlbum" ).get("AvroByte" ); +var avroShort = executor.getContextAlbum("AvroShortAlbum" ).get("AvroShort" ); +var avroInteger = executor.getContextAlbum("AvroIntegerAlbum" ).get("AvroInteger" ); +var avroLong = executor.getContextAlbum("AvroLongAlbum" ).get("AvroLong" ); +var avroFloat = executor.getContextAlbum("AvroFloatAlbum" ).get("AvroFloat" ); +var avroDouble = executor.getContextAlbum("AvroDoubleAlbum" ).get("AvroDouble" ); +var avroString = executor.getContextAlbum("AvroStringAlbum" ).get("AvroString" ); +var customBoolean = executor.getContextAlbum("CustomBooleanAlbum").get("CustomBoolean"); +var customByte = executor.getContextAlbum("CustomByteAlbum" ).get("CustomByte" ); +var customInteger = executor.getContextAlbum("CustomIntegerAlbum").get("CustomInteger"); +var customLong = executor.getContextAlbum("CustomLongAlbum" ).get("CustomLong" ); +var customFloat = executor.getContextAlbum("CustomFloatAlbum" ).get("CustomFloat" ); +var customDouble = executor.getContextAlbum("CustomDoubleAlbum" ).get("CustomDouble" ); +var customString = executor.getContextAlbum("CustomStringAlbum" ).get("CustomString" ); +var customALong = executor.getContextAlbum("CustomALongAlbum" ).get("CustomALong" ); +var customDate0 = executor.getContextAlbum("CustomDate0Album" ).get("CustomDate0" ); +var customDate1 = executor.getContextAlbum("CustomDate1Album" ).get("CustomDate1" ); +var customDate2 = executor.getContextAlbum("CustomDate2Album" ).get("CustomDate2" ); +var customSet = executor.getContextAlbum("CustomSetAlbum" ).get("CustomSet" ); +var customMap = executor.getContextAlbum("CustomMapAlbum" ).get("CustomMap" ); + +javaIntegerType = Java.type("java.lang.Integer"); +javaLongType = Java.type("java.lang.Long"); +javaFloatType = Java.type("java.lang.Float"); + +avroBoolean = !avroBoolean; +avroByte = new javaIntegerType(avroByte + 1); +avroShort = new javaIntegerType(avroShort + 1); +avroInteger = new javaIntegerType(avroInteger + 1); +avroLong = new javaLongType (avroLong + 1); +avroFloat = new javaFloatType (avroFloat + 0.99); +avroDouble += 0.99; +avroString = avroString + " added to end of string"; +customBoolean.put("flag", !customBoolean.get("flag")); +customByte .put("byteValue" , customByte .get("byteValue" ) + 1); +customInteger.put("intValue" , customInteger.get("intValue" ) + 1); +customLong .put("longValue" , new javaLongType (customLong .get("longValue" ) + 1)); +customFloat .put("floatValue" , new javaFloatType(customFloat.get("floatValue") + 1.0)); +customDouble .put("doubleValue", customDouble .get("doubleValue") + 1.0); +customString .put("stringValue", customString .get("stringValue") + " added to end of string"); +customALong .put("longValue" , new javaLongType (customALong.get("longValue" ) + 1)); + +customDate0.put("year", 1922); +customDate0.put("month", 12); +customDate0.put("day", 6); + +customDate1.put("dateValue", customDate0); +customDate2.put("dateValue", customDate0); + +customSet.get("setValue").add("with"); +customSet.get("setValue").add("a"); +customSet.get("setValue").add("beard"); + +customMap.get("mapValue").put("love", "hate"); +customMap.get("mapValue").put("summer", "winter"); +customMap.get("mapValue").put("good", "bad"); + +executor.getContextAlbum("AvroBooleanAlbum" ).put("AvroBoolean" , avroBoolean); +executor.getContextAlbum("AvroByteAlbum" ).put("AvroByte" , avroByte); +executor.getContextAlbum("AvroShortAlbum" ).put("AvroShort" , avroShort); +executor.getContextAlbum("AvroIntegerAlbum" ).put("AvroInteger" , avroInteger); +executor.getContextAlbum("AvroLongAlbum" ).put("AvroLong" , avroLong); +executor.getContextAlbum("AvroFloatAlbum" ).put("AvroFloat" , avroFloat); +executor.getContextAlbum("AvroDoubleAlbum" ).put("AvroDouble" , avroDouble); +executor.getContextAlbum("AvroStringAlbum" ).put("AvroString" , avroString); +executor.getContextAlbum("CustomBooleanAlbum").put("CustomBoolean", customBoolean); +executor.getContextAlbum("CustomByteAlbum" ).put("CustomByte" , customByte); +executor.getContextAlbum("CustomIntegerAlbum").put("CustomInteger", customInteger); +executor.getContextAlbum("CustomLongAlbum" ).put("CustomLong" , customLong); +executor.getContextAlbum("CustomFloatAlbum" ).put("CustomFloat" , customFloat); +executor.getContextAlbum("CustomDoubleAlbum" ).put("CustomDouble" , customDouble); +executor.getContextAlbum("CustomStringAlbum" ).put("CustomString" , customString); +executor.getContextAlbum("CustomALongAlbum" ).put("CustomALong" , customALong); +executor.getContextAlbum("CustomDate0Album" ).put("CustomDate0" , customDate0); +executor.getContextAlbum("CustomDate1Album" ).put("CustomDate1" , customDate1); +executor.getContextAlbum("CustomDate2Album" ).put("CustomDate2" , customDate2); +executor.getContextAlbum("CustomSetAlbum" ).put("CustomSet" , customSet); +executor.getContextAlbum("CustomMapAlbum" ).put("CustomMap" , customMap); + +executor.outFields.put("AvroBoolean" , executor.getContextAlbum("AvroBooleanAlbum" ).get("AvroBoolean" )); +executor.outFields.put("AvroByte" , executor.getContextAlbum("AvroByteAlbum" ).get("AvroByte" )); +executor.outFields.put("AvroShort" , executor.getContextAlbum("AvroShortAlbum" ).get("AvroShort" )); +executor.outFields.put("AvroInteger" , executor.getContextAlbum("AvroIntegerAlbum" ).get("AvroInteger" )); +executor.outFields.put("AvroLong" , executor.getContextAlbum("AvroLongAlbum" ).get("AvroLong" )); +executor.outFields.put("AvroFloat" , executor.getContextAlbum("AvroFloatAlbum" ).get("AvroFloat" )); +executor.outFields.put("AvroDouble" , executor.getContextAlbum("AvroDoubleAlbum" ).get("AvroDouble" )); +executor.outFields.put("AvroString" , executor.getContextAlbum("AvroStringAlbum" ).get("AvroString" )); +executor.outFields.put("AvroMap" , executor.getContextAlbum("AvroMapAlbum" ).get("AvroMap" )); +executor.outFields.put("AvroArray" , executor.getContextAlbum("AvroArrayAlbum" ).get("AvroArray" )); +executor.outFields.put("CustomBoolean", executor.getContextAlbum("CustomBooleanAlbum").get("CustomBoolean")); +executor.outFields.put("CustomByte" , executor.getContextAlbum("CustomByteAlbum" ).get("CustomByte" )); +executor.outFields.put("CustomInteger", executor.getContextAlbum("CustomIntegerAlbum").get("CustomInteger")); +executor.outFields.put("CustomLong" , executor.getContextAlbum("CustomLongAlbum" ).get("CustomLong" )); +executor.outFields.put("CustomFloat" , executor.getContextAlbum("CustomFloatAlbum" ).get("CustomFloat" )); +executor.outFields.put("CustomDouble" , executor.getContextAlbum("CustomDoubleAlbum" ).get("CustomDouble" )); +executor.outFields.put("CustomString" , executor.getContextAlbum("CustomStringAlbum" ).get("CustomString" )); +executor.outFields.put("CustomALong" , executor.getContextAlbum("CustomALongAlbum" ).get("CustomALong" )); +executor.outFields.put("CustomDate0" , executor.getContextAlbum("CustomDate0Album" ).get("CustomDate0" )); +executor.outFields.put("CustomDate1" , executor.getContextAlbum("CustomDate1Album" ).get("CustomDate1" )); +executor.outFields.put("CustomDate2" , executor.getContextAlbum("CustomDate2Album" ).get("CustomDate2" )); +executor.outFields.put("CustomSet" , executor.getContextAlbum("CustomSetAlbum" ).get("CustomSet" )); +executor.outFields.put("CustomMap" , executor.getContextAlbum("CustomMapAlbum" ).get("CustomMap" )); + +executor.logger.debug(executor.outFields); + +var returnValueType = Java.type("java.lang.Boolean"); +var returnValue = new returnValueType(true); + +LE + +policy create name=Test_Policy template=FREEFORM firstState=OnlyState + +policy state create name=Test_Policy stateName=OnlyState triggerName=Test_InputEvent defaultTaskName=Test_Task +policy state output create name=Test_Policy stateName=OnlyState outputName=OnlyState2Out eventName=Test_OutputEvent +policy state taskref create name=Test_Policy stateName=OnlyState taskName=Test_Task outputType=DIRECT outputName=OnlyState2Out diff --git a/auth/cli-editor/src/main/resources/examples/scripts/TestPolicyJavaEventContext.apex b/auth/cli-editor/src/main/resources/examples/scripts/TestPolicyJavaEventContext.apex new file mode 100644 index 000000000..8d1711638 --- /dev/null +++ b/auth/cli-editor/src/main/resources/examples/scripts/TestPolicyJavaEventContext.apex @@ -0,0 +1,324 @@ +#------------------------------------------------------------------------------- +# ============LICENSE_START======================================================= +# Copyright (C) 2016-2018 Ericsson. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= +#------------------------------------------------------------------------------- + +model create name=Test_PolicyModel + +schema create name=JavaBoolean_type flavour=Java schema=java.lang.Boolean +schema create name=JavaByte_type flavour=Java schema=java.lang.Byte +schema create name=JavaShort_type flavour=Java schema=java.lang.Short +schema create name=JavaInteger_type flavour=Java schema=java.lang.Integer +schema create name=JavaLong_type flavour=Java schema=java.lang.Long +schema create name=JavaFloat_type flavour=Java schema=java.lang.Float +schema create name=JavaDouble_type flavour=Java schema=java.lang.Double +schema create name=JavaString_type flavour=Java schema=java.lang.String +schema create name=CustomBoolean_type flavour=Java schema=org.onap.policy.apex.context.test.concepts.TestContextItem000 +schema create name=CustomByte_type flavour=Java schema=org.onap.policy.apex.context.test.concepts.TestContextItem001 +schema create name=CustomInteger_type flavour=Java schema=org.onap.policy.apex.context.test.concepts.TestContextItem002 +schema create name=CustomLong_type flavour=Java schema=org.onap.policy.apex.context.test.concepts.TestContextItem003 +schema create name=CustomFloat_type flavour=Java schema=org.onap.policy.apex.context.test.concepts.TestContextItem004 +schema create name=CustomDouble_type flavour=Java schema=org.onap.policy.apex.context.test.concepts.TestContextItem005 +schema create name=CustomString_type flavour=Java schema=org.onap.policy.apex.context.test.concepts.TestContextItem006 +schema create name=CustomJLong_type flavour=Java schema=org.onap.policy.apex.context.test.concepts.TestContextItem007 +schema create name=CustomDate0_type flavour=Java schema=org.onap.policy.apex.context.test.concepts.TestContextItem008 +schema create name=CustomDate1_type flavour=Java schema=org.onap.policy.apex.context.test.concepts.TestContextItem009 +schema create name=CustomDate2_type flavour=Java schema=org.onap.policy.apex.context.test.concepts.TestContextItem00A +schema create name=CustomSet_type flavour=Java schema=org.onap.policy.apex.context.test.concepts.TestContextItem00B +schema create name=CustomMap_type flavour=Java schema=org.onap.policy.apex.context.test.concepts.TestContextItem00C + +event create name=Test_InputEvent nameSpace=org.onap.policy.apex.test source=External target=Apex + +event parameter create name=Test_InputEvent parName=JavaBoolean schemaName=JavaBoolean_type +event parameter create name=Test_InputEvent parName=JavaByte schemaName=JavaByte_type +event parameter create name=Test_InputEvent parName=JavaShort schemaName=JavaShort_type +event parameter create name=Test_InputEvent parName=JavaInteger schemaName=JavaInteger_type +event parameter create name=Test_InputEvent parName=JavaLong schemaName=JavaLong_type +event parameter create name=Test_InputEvent parName=JavaFloat schemaName=JavaFloat_type +event parameter create name=Test_InputEvent parName=JavaDouble schemaName=JavaDouble_type +event parameter create name=Test_InputEvent parName=JavaString schemaName=JavaString_type +event parameter create name=Test_InputEvent parName=CustomBoolean schemaName=CustomBoolean_type +event parameter create name=Test_InputEvent parName=CustomByte schemaName=CustomByte_type +event parameter create name=Test_InputEvent parName=CustomInteger schemaName=CustomInteger_type +event parameter create name=Test_InputEvent parName=CustomLong schemaName=CustomLong_type +event parameter create name=Test_InputEvent parName=CustomFloat schemaName=CustomFloat_type +event parameter create name=Test_InputEvent parName=CustomDouble schemaName=CustomDouble_type +event parameter create name=Test_InputEvent parName=CustomString schemaName=CustomString_type +event parameter create name=Test_InputEvent parName=CustomJLong schemaName=CustomJLong_type +event parameter create name=Test_InputEvent parName=CustomDate0 schemaName=CustomDate0_type +event parameter create name=Test_InputEvent parName=CustomDate1 schemaName=CustomDate1_type +event parameter create name=Test_InputEvent parName=CustomDate2 schemaName=CustomDate2_type +event parameter create name=Test_InputEvent parName=CustomSet schemaName=CustomSet_type +event parameter create name=Test_InputEvent parName=CustomMap schemaName=CustomMap_type + +event create name=Test_OutputEvent nameSpace=org.onap.policy.apex.test source=External target=Apex + +event parameter create name=Test_OutputEvent parName=JavaBoolean schemaName=JavaBoolean_type +event parameter create name=Test_OutputEvent parName=JavaByte schemaName=JavaByte_type +event parameter create name=Test_OutputEvent parName=JavaShort schemaName=JavaShort_type +event parameter create name=Test_OutputEvent parName=JavaInteger schemaName=JavaInteger_type +event parameter create name=Test_OutputEvent parName=JavaLong schemaName=JavaLong_type +event parameter create name=Test_OutputEvent parName=JavaFloat schemaName=JavaFloat_type +event parameter create name=Test_OutputEvent parName=JavaDouble schemaName=JavaDouble_type +event parameter create name=Test_OutputEvent parName=JavaString schemaName=JavaString_type +event parameter create name=Test_OutputEvent parName=CustomBoolean schemaName=CustomBoolean_type +event parameter create name=Test_OutputEvent parName=CustomByte schemaName=CustomByte_type +event parameter create name=Test_OutputEvent parName=CustomInteger schemaName=CustomInteger_type +event parameter create name=Test_OutputEvent parName=CustomLong schemaName=CustomLong_type +event parameter create name=Test_OutputEvent parName=CustomFloat schemaName=CustomFloat_type +event parameter create name=Test_OutputEvent parName=CustomDouble schemaName=CustomDouble_type +event parameter create name=Test_OutputEvent parName=CustomString schemaName=CustomString_type +event parameter create name=Test_OutputEvent parName=CustomJLong schemaName=CustomJLong_type +event parameter create name=Test_OutputEvent parName=CustomDate0 schemaName=CustomDate0_type +event parameter create name=Test_OutputEvent parName=CustomDate1 schemaName=CustomDate1_type +event parameter create name=Test_OutputEvent parName=CustomDate2 schemaName=CustomDate2_type +event parameter create name=Test_OutputEvent parName=CustomSet schemaName=CustomSet_type +event parameter create name=Test_OutputEvent parName=CustomMap schemaName=CustomMap_type + +album create name=JavaBooleanAlbum scope=policy writable=true schemaName=JavaBoolean_type +album create name=JavaByteAlbum scope=policy writable=true schemaName=JavaByte_type +album create name=JavaShortAlbum scope=policy writable=true schemaName=JavaShort_type +album create name=JavaIntegerAlbum scope=policy writable=true schemaName=JavaInteger_type +album create name=JavaLongAlbum scope=policy writable=true schemaName=JavaLong_type +album create name=JavaFloatAlbum scope=policy writable=true schemaName=JavaFloat_type +album create name=JavaDoubleAlbum scope=policy writable=true schemaName=JavaDouble_type +album create name=JavaStringAlbum scope=policy writable=true schemaName=JavaString_type +album create name=CustomBooleanAlbum scope=policy writable=true schemaName=CustomBoolean_type +album create name=CustomByteAlbum scope=policy writable=true schemaName=CustomByte_type +album create name=CustomIntegerAlbum scope=policy writable=true schemaName=CustomInteger_type +album create name=CustomLongAlbum scope=policy writable=true schemaName=CustomLong_type +album create name=CustomFloatAlbum scope=policy writable=true schemaName=CustomFloat_type +album create name=CustomDoubleAlbum scope=policy writable=true schemaName=CustomDouble_type +album create name=CustomStringAlbum scope=policy writable=true schemaName=CustomString_type +album create name=CustomJLongAlbum scope=policy writable=true schemaName=CustomJLong_type +album create name=CustomDate0Album scope=policy writable=true schemaName=CustomDate0_type +album create name=CustomDate1Album scope=policy writable=true schemaName=CustomDate1_type +album create name=CustomDate2Album scope=policy writable=true schemaName=CustomDate2_type +album create name=CustomSetAlbum scope=policy writable=true schemaName=CustomSet_type +album create name=CustomMapAlbum scope=policy writable=true schemaName=CustomMap_type + +task create name=Test_Task + +task inputfield create name=Test_Task fieldName=JavaBoolean schemaName=JavaBoolean_type +task inputfield create name=Test_Task fieldName=JavaByte schemaName=JavaByte_type +task inputfield create name=Test_Task fieldName=JavaShort schemaName=JavaShort_type +task inputfield create name=Test_Task fieldName=JavaInteger schemaName=JavaInteger_type +task inputfield create name=Test_Task fieldName=JavaLong schemaName=JavaLong_type +task inputfield create name=Test_Task fieldName=JavaFloat schemaName=JavaFloat_type +task inputfield create name=Test_Task fieldName=JavaDouble schemaName=JavaDouble_type +task inputfield create name=Test_Task fieldName=JavaString schemaName=JavaString_type +task inputfield create name=Test_Task fieldName=CustomBoolean schemaName=CustomBoolean_type +task inputfield create name=Test_Task fieldName=CustomByte schemaName=CustomByte_type +task inputfield create name=Test_Task fieldName=CustomInteger schemaName=CustomInteger_type +task inputfield create name=Test_Task fieldName=CustomLong schemaName=CustomLong_type +task inputfield create name=Test_Task fieldName=CustomFloat schemaName=CustomFloat_type +task inputfield create name=Test_Task fieldName=CustomDouble schemaName=CustomDouble_type +task inputfield create name=Test_Task fieldName=CustomString schemaName=CustomString_type +task inputfield create name=Test_Task fieldName=CustomJLong schemaName=CustomJLong_type +task inputfield create name=Test_Task fieldName=CustomDate0 schemaName=CustomDate0_type +task inputfield create name=Test_Task fieldName=CustomDate1 schemaName=CustomDate1_type +task inputfield create name=Test_Task fieldName=CustomDate2 schemaName=CustomDate2_type +task inputfield create name=Test_Task fieldName=CustomSet schemaName=CustomSet_type +task inputfield create name=Test_Task fieldName=CustomMap schemaName=CustomMap_type + +task outputfield create name=Test_Task fieldName=JavaBoolean schemaName=JavaBoolean_type +task outputfield create name=Test_Task fieldName=JavaByte schemaName=JavaByte_type +task outputfield create name=Test_Task fieldName=JavaShort schemaName=JavaShort_type +task outputfield create name=Test_Task fieldName=JavaInteger schemaName=JavaInteger_type +task outputfield create name=Test_Task fieldName=JavaLong schemaName=JavaLong_type +task outputfield create name=Test_Task fieldName=JavaFloat schemaName=JavaFloat_type +task outputfield create name=Test_Task fieldName=JavaDouble schemaName=JavaDouble_type +task outputfield create name=Test_Task fieldName=JavaString schemaName=JavaString_type +task outputfield create name=Test_Task fieldName=CustomBoolean schemaName=CustomBoolean_type +task outputfield create name=Test_Task fieldName=CustomByte schemaName=CustomByte_type +task outputfield create name=Test_Task fieldName=CustomInteger schemaName=CustomInteger_type +task outputfield create name=Test_Task fieldName=CustomLong schemaName=CustomLong_type +task outputfield create name=Test_Task fieldName=CustomFloat schemaName=CustomFloat_type +task outputfield create name=Test_Task fieldName=CustomDouble schemaName=CustomDouble_type +task outputfield create name=Test_Task fieldName=CustomString schemaName=CustomString_type +task outputfield create name=Test_Task fieldName=CustomJLong schemaName=CustomJLong_type +task outputfield create name=Test_Task fieldName=CustomDate0 schemaName=CustomDate0_type +task outputfield create name=Test_Task fieldName=CustomDate1 schemaName=CustomDate1_type +task outputfield create name=Test_Task fieldName=CustomDate2 schemaName=CustomDate2_type +task outputfield create name=Test_Task fieldName=CustomSet schemaName=CustomSet_type +task outputfield create name=Test_Task fieldName=CustomMap schemaName=CustomMap_type + +task contextref create name=Test_Task albumName=JavaBooleanAlbum +task contextref create name=Test_Task albumName=JavaByteAlbum +task contextref create name=Test_Task albumName=JavaShortAlbum +task contextref create name=Test_Task albumName=JavaIntegerAlbum +task contextref create name=Test_Task albumName=JavaLongAlbum +task contextref create name=Test_Task albumName=JavaFloatAlbum +task contextref create name=Test_Task albumName=JavaDoubleAlbum +task contextref create name=Test_Task albumName=JavaStringAlbum +task contextref create name=Test_Task albumName=CustomBooleanAlbum +task contextref create name=Test_Task albumName=CustomByteAlbum +task contextref create name=Test_Task albumName=CustomIntegerAlbum +task contextref create name=Test_Task albumName=CustomLongAlbum +task contextref create name=Test_Task albumName=CustomFloatAlbum +task contextref create name=Test_Task albumName=CustomDoubleAlbum +task contextref create name=Test_Task albumName=CustomStringAlbum +task contextref create name=Test_Task albumName=CustomJLongAlbum +task contextref create name=Test_Task albumName=CustomDate0Album +task contextref create name=Test_Task albumName=CustomDate1Album +task contextref create name=Test_Task albumName=CustomDate2Album +task contextref create name=Test_Task albumName=CustomSetAlbum +task contextref create name=Test_Task albumName=CustomMapAlbum + +task logic create name=Test_Task logicFlavour=JAVASCRIPT logic=LS +executor.logger.debug(executor.subject.id); + +executor.logger.debug(executor.inFields); + +executor.getContextAlbum("JavaBooleanAlbum" ).put("JavaBoolean" , executor.inFields.get("JavaBoolean" )); +executor.getContextAlbum("JavaByteAlbum" ).put("JavaByte" , executor.inFields.get("JavaByte" )); +executor.getContextAlbum("JavaShortAlbum" ).put("JavaShort" , executor.inFields.get("JavaShort" )); +executor.getContextAlbum("JavaIntegerAlbum" ).put("JavaInteger" , executor.inFields.get("JavaInteger" )); +executor.getContextAlbum("JavaLongAlbum" ).put("JavaLong" , executor.inFields.get("JavaLong" )); +executor.getContextAlbum("JavaFloatAlbum" ).put("JavaFloat" , executor.inFields.get("JavaFloat" )); +executor.getContextAlbum("JavaDoubleAlbum" ).put("JavaDouble" , executor.inFields.get("JavaDouble" )); +executor.getContextAlbum("JavaStringAlbum" ).put("JavaString" , executor.inFields.get("JavaString" )); +executor.getContextAlbum("CustomBooleanAlbum").put("CustomBoolean", executor.inFields.get("CustomBoolean")); +executor.getContextAlbum("CustomByteAlbum" ).put("CustomByte" , executor.inFields.get("CustomByte" )); +executor.getContextAlbum("CustomIntegerAlbum").put("CustomInteger", executor.inFields.get("CustomInteger")); +executor.getContextAlbum("CustomLongAlbum" ).put("CustomLong" , executor.inFields.get("CustomLong" )); +executor.getContextAlbum("CustomFloatAlbum" ).put("CustomFloat" , executor.inFields.get("CustomFloat" )); +executor.getContextAlbum("CustomDoubleAlbum" ).put("CustomDouble" , executor.inFields.get("CustomDouble" )); +executor.getContextAlbum("CustomStringAlbum" ).put("CustomString" , executor.inFields.get("CustomString" )); +executor.getContextAlbum("CustomJLongAlbum" ).put("CustomJLong" , executor.inFields.get("CustomJLong" )); +executor.getContextAlbum("CustomDate0Album" ).put("CustomDate0" , executor.inFields.get("CustomDate0" )); +executor.getContextAlbum("CustomDate1Album" ).put("CustomDate1" , executor.inFields.get("CustomDate1" )); +executor.getContextAlbum("CustomDate2Album" ).put("CustomDate2" , executor.inFields.get("CustomDate2" )); +executor.getContextAlbum("CustomSetAlbum" ).put("CustomSet" , executor.inFields.get("CustomSet" )); +executor.getContextAlbum("CustomMapAlbum" ).put("CustomMap" , executor.inFields.get("CustomMap" )); + +var javaBoolean = executor.getContextAlbum("JavaBooleanAlbum" ).get("JavaBoolean" ); +var javaByte = executor.getContextAlbum("JavaByteAlbum" ).get("JavaByte" ); +var javaShort = executor.getContextAlbum("JavaShortAlbum" ).get("JavaShort" ); +var javaInteger = executor.getContextAlbum("JavaIntegerAlbum" ).get("JavaInteger" ); +var javaLong = executor.getContextAlbum("JavaLongAlbum" ).get("JavaLong" ); +var javaFloat = executor.getContextAlbum("JavaFloatAlbum" ).get("JavaFloat" ); +var javaDouble = executor.getContextAlbum("JavaDoubleAlbum" ).get("JavaDouble" ); +var javaString = executor.getContextAlbum("JavaStringAlbum" ).get("JavaString" ); +var customBoolean = executor.getContextAlbum("CustomBooleanAlbum").get("CustomBoolean"); +var customByte = executor.getContextAlbum("CustomByteAlbum" ).get("CustomByte" ); +var customInteger = executor.getContextAlbum("CustomIntegerAlbum").get("CustomInteger"); +var customLong = executor.getContextAlbum("CustomLongAlbum" ).get("CustomLong" ); +var customFloat = executor.getContextAlbum("CustomFloatAlbum" ).get("CustomFloat" ); +var customDouble = executor.getContextAlbum("CustomDoubleAlbum" ).get("CustomDouble" ); +var customString = executor.getContextAlbum("CustomStringAlbum" ).get("CustomString" ); +var customJLong = executor.getContextAlbum("CustomJLongAlbum" ).get("CustomJLong" ); +var customDate0 = executor.getContextAlbum("CustomDate0Album" ).get("CustomDate0" ); +var customDate1 = executor.getContextAlbum("CustomDate1Album" ).get("CustomDate1" ); +var customDate2 = executor.getContextAlbum("CustomDate2Album" ).get("CustomDate2" ); +var customSet = executor.getContextAlbum("CustomSetAlbum" ).get("CustomSet" ); +var customMap = executor.getContextAlbum("CustomMapAlbum" ).get("CustomMap" ); + +javaBoolean = !javaBoolean; +javaByte += 1; +javaShortType = Java.type("java.lang.Short"); +javaShort = new javaShortType(javaShort + 1); +javaInteger += 1; +javaLong += 1; +javaFloat += 0.99; +javaDouble += 0.99; +javaString = javaString + " added to end of string"; +customBoolean.setFlag(!customBoolean); +customByte .setByteValue (customByte .getByteValue() + 1); +customInteger.setIntValue (customInteger.getIntValue() + 1); +customLong .setLongValue (customLong .getLongValue() + 1); +customFloat .setFloatValue (customFloat .getFloatValue() + 1); +customDouble .setDoubleValue(customDouble .getDoubleValue() + 1); +customString .setStringValue(customString .getStringValue() + " added to end of string"); +customJLong .setLongValue (customJLong .getLongValue() + 1); + +customDate0Type = Java.type("org.onap.policy.apex.context.test.concepts.TestContextItem008"); +customDate0 = new customDate0Type(1499868391); + +customDate1Type = Java.type("org.onap.policy.apex.context.test.concepts.TestContextItem009"); +customDate1 = new customDate1Type(); +customDate1.setDateValue(customDate0); + +customDate2Type = Java.type("org.onap.policy.apex.context.test.concepts.TestContextItem00A"); +customDate2 = new customDate2Type(); +customDate2.setDateValue(customDate0); + +customSet.getSetValue().add("with"); +customSet.getSetValue().add("a"); +customSet.getSetValue().add("beard"); + +customMap.getMapValue().put("love", "hate"); +customMap.getMapValue().put("summer", "winter"); +customMap.getMapValue().put("good", "bad"); + +executor.getContextAlbum("JavaBooleanAlbum" ).put("JavaBoolean" , javaBoolean); +executor.getContextAlbum("JavaByteAlbum" ).put("JavaByte" , javaByte); +executor.getContextAlbum("JavaShortAlbum" ).put("JavaShort" , javaShort); +executor.getContextAlbum("JavaIntegerAlbum" ).put("JavaInteger" , javaInteger); +executor.getContextAlbum("JavaLongAlbum" ).put("JavaLong" , javaLong); +executor.getContextAlbum("JavaFloatAlbum" ).put("JavaFloat" , javaFloat); +executor.getContextAlbum("JavaDoubleAlbum" ).put("JavaDouble" , javaDouble); +executor.getContextAlbum("JavaStringAlbum" ).put("JavaString" , javaString); +executor.getContextAlbum("CustomBooleanAlbum").put("CustomBoolean", customBoolean); +executor.getContextAlbum("CustomByteAlbum" ).put("CustomByte" , customByte); +executor.getContextAlbum("CustomIntegerAlbum").put("CustomInteger", customInteger); +executor.getContextAlbum("CustomLongAlbum" ).put("CustomLong" , customLong); +executor.getContextAlbum("CustomFloatAlbum" ).put("CustomFloat" , customFloat); +executor.getContextAlbum("CustomDoubleAlbum" ).put("CustomDouble" , customDouble); +executor.getContextAlbum("CustomStringAlbum" ).put("CustomString" , customString); +executor.getContextAlbum("CustomJLongAlbum" ).put("CustomJLong" , customJLong); +executor.getContextAlbum("CustomDate0Album" ).put("CustomDate0" , customDate0); +executor.getContextAlbum("CustomDate1Album" ).put("CustomDate1" , customDate1); +executor.getContextAlbum("CustomDate2Album" ).put("CustomDate2" , customDate2); +executor.getContextAlbum("CustomSetAlbum" ).put("CustomSet" , customSet); +executor.getContextAlbum("CustomMapAlbum" ).put("CustomMap" , customMap); + +executor.outFields.put("JavaBoolean" , executor.getContextAlbum("JavaBooleanAlbum" ).get("JavaBoolean" )); +executor.outFields.put("JavaByte" , executor.getContextAlbum("JavaByteAlbum" ).get("JavaByte" )); +executor.outFields.put("JavaShort" , executor.getContextAlbum("JavaShortAlbum" ).get("JavaShort" )); +executor.outFields.put("JavaInteger" , executor.getContextAlbum("JavaIntegerAlbum" ).get("JavaInteger" )); +executor.outFields.put("JavaLong" , executor.getContextAlbum("JavaLongAlbum" ).get("JavaLong" )); +executor.outFields.put("JavaFloat" , executor.getContextAlbum("JavaFloatAlbum" ).get("JavaFloat" )); +executor.outFields.put("JavaDouble" , executor.getContextAlbum("JavaDoubleAlbum" ).get("JavaDouble" )); +executor.outFields.put("JavaString" , executor.getContextAlbum("JavaStringAlbum" ).get("JavaString" )); +executor.outFields.put("CustomBoolean", executor.getContextAlbum("CustomBooleanAlbum").get("CustomBoolean")); +executor.outFields.put("CustomByte" , executor.getContextAlbum("CustomByteAlbum" ).get("CustomByte" )); +executor.outFields.put("CustomInteger", executor.getContextAlbum("CustomIntegerAlbum").get("CustomInteger")); +executor.outFields.put("CustomLong" , executor.getContextAlbum("CustomLongAlbum" ).get("CustomLong" )); +executor.outFields.put("CustomFloat" , executor.getContextAlbum("CustomFloatAlbum" ).get("CustomFloat" )); +executor.outFields.put("CustomDouble" , executor.getContextAlbum("CustomDoubleAlbum" ).get("CustomDouble" )); +executor.outFields.put("CustomString" , executor.getContextAlbum("CustomStringAlbum" ).get("CustomString" )); +executor.outFields.put("CustomJLong" , executor.getContextAlbum("CustomJLongAlbum" ).get("CustomJLong" )); +executor.outFields.put("CustomDate0" , executor.getContextAlbum("CustomDate0Album" ).get("CustomDate0" )); +executor.outFields.put("CustomDate1" , executor.getContextAlbum("CustomDate1Album" ).get("CustomDate1" )); +executor.outFields.put("CustomDate2" , executor.getContextAlbum("CustomDate2Album" ).get("CustomDate2" )); +executor.outFields.put("CustomSet" , executor.getContextAlbum("CustomSetAlbum" ).get("CustomSet" )); +executor.outFields.put("CustomMap" , executor.getContextAlbum("CustomMapAlbum" ).get("CustomMap" )); + +executor.logger.debug(executor.outFields); + +var returnValueType = Java.type("java.lang.Boolean"); +var returnValue = new returnValueType(true); + +LE + +policy create name=Test_Policy template=FREEFORM firstState=OnlyState + +policy state create name=Test_Policy stateName=OnlyState triggerName=Test_InputEvent defaultTaskName=Test_Task +policy state output create name=Test_Policy stateName=OnlyState outputName=OnlyState2Out eventName=Test_OutputEvent +policy state taskref create name=Test_Policy stateName=OnlyState taskName=Test_Task outputType=DIRECT outputName=OnlyState2Out |