ramverma | af74a62 | 2018-07-31 18:25:39 +0100 | [diff] [blame] | 1 | // |
| 2 | // ============LICENSE_START======================================================= |
| 3 | // Copyright (C) 2016-2018 Ericsson. All rights reserved. |
| 4 | // ================================================================================ |
| 5 | // This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE |
| 6 | // Full license text at https://creativecommons.org/licenses/by/4.0/legalcode |
| 7 | // |
| 8 | // SPDX-License-Identifier: CC-BY-4.0 |
| 9 | // ============LICENSE_END========================================================= |
| 10 | // |
| 11 | // @author Sven van der Meer (sven.van.der.meer@ericsson.com) |
| 12 | // |
| 13 | |
| 14 | == Application: Convert a Policy Model to CLI Editor Commands |
| 15 | |
| 16 | **Status: Experimental** |
| 17 | |
| 18 | This application takes a policy model (JSON or XML encoded) and generates commands for the APEX CLI Editor. |
| 19 | This effectively reverses a policy specification realized with the CLI Editor. |
| 20 | |
| 21 | [width="100%",options="header",cols="5a,5a"] |
| 22 | |==================== |
| 23 | | Unix, Cygwin | Windows |
| 24 | | |
| 25 | [source%nowrap,sh] |
| 26 | ---- |
| 27 | # $APEX_HOME/bin/apexApps.sh model-2-cli [args] |
| 28 | ---- |
| 29 | | |
| 30 | [source%nowrap,bat] |
| 31 | ---- |
| 32 | > %APEX_HOME%\bin\apexApps.bat model-2-cli [args] |
| 33 | ---- |
| 34 | |==================== |
| 35 | |
| 36 | The option `-h` provides a help screen. |
| 37 | |
| 38 | [source%nowrap,sh] |
| 39 | ---- |
| 40 | usage: gen-model2cli |
| 41 | -h,--help prints this help and usage screen |
| 42 | -m,--model <MODEL-FILE> set the input policy model file |
| 43 | -sv,--skip-validation switch of validation of the input file |
| 44 | -v,--version prints the application version |
| 45 | ---- |
| 46 | |
| 47 | For instance, running the tool with the __Sample Domain__ policy model as: |
| 48 | [source%nowrap,sh] |
| 49 | ---- |
| 50 | apexApps.sh tpl-event-json -m $APEX_HOME/examples/models/SampleDomain/SamplePolicyModelJAVA.json -t stimuli |
| 51 | ---- |
| 52 | |
| 53 | will produce the following status messages: |
| 54 | |
| 55 | [source%nowrap,sh] |
| 56 | ---- |
| 57 | gen-model2cli: starting CLI generator |
| 58 | --> model file: examples/models/SampleDomain/SamplePolicyModelJAVA.json |
| 59 | ---- |
| 60 | |
| 61 | and then run the generator application producing all CLI Editor commands and printing them to standard out. |
| 62 | |