053e053495cac36903c2026044563ee44a0d6c20
[policy/apex-pdp.git] /
1 #-------------------------------------------------------------------------------
2 # ============LICENSE_START=======================================================
3 #  Copyright (C) 2019 Nordix Foundation.
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #      http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 # SPDX-License-Identifier: Apache-2.0
18 # ============LICENSE_END=========================================================
19 #-------------------------------------------------------------------------------
20
21 model create name=ExecutionPropertiesRestTestPolicyModel
22
23 schema create name=SimpleStringType  flavour=Java schema=java.lang.String
24
25 event create name=Event0200 nameSpace=org.onap.policy.apex.domains.test source=Junit target=Decide
26 event parameter create name=Event0200 parName=testToRun schemaName=SimpleStringType
27
28 event create name=Event0201 nameSpace=org.onap.policy.apex.domains.test source=Decide target=OutSide
29 event parameter create name=Event0201 parName=testToRun schemaName=SimpleStringType
30
31
32 task create name=TaskFetchHttpCode
33
34 task inputfield create name=TaskFetchHttpCode fieldName=testToRun schemaName=SimpleStringType
35 task outputfield create name=TaskFetchHttpCode fieldName=testToRun schemaName=SimpleStringType
36
37 task logic create name=TaskFetchHttpCode logicFlavour=JAVASCRIPT logic=LS
38 #MACROFILE:"src/test/resources/policies/executionproperties/logic/TaskFetchHttpCode.js"
39 LE
40
41 task create name=TaskTagUrl
42
43 task inputfield create name=TaskTagUrl fieldName=testToRun schemaName=SimpleStringType
44 task outputfield create name=TaskTagUrl fieldName=testToRun schemaName=SimpleStringType
45
46 task logic create name=TaskTagUrl logicFlavour=JAVASCRIPT logic=LS
47 #MACROFILE:"src/test/resources/policies/executionproperties/logic/TaskTagUrl.js"
48 LE
49
50
51 policy create name=Policy2 template=freestyle firstState=Junit
52
53 policy state create name=Policy2 stateName=Decide triggerName=Event0201 defaultTaskName=TaskTagUrl
54 policy state output create name=Policy2 stateName=Decide  outputName=TagUrlOut eventName=Event0201 nextState=NULL
55 policy state taskref create name=Policy2 stateName=Decide taskLocalName=tag taskName=TaskTagUrl outputType=DIRECT outputName=TagUrlOut
56
57 policy state create name=Policy2 stateName=Junit triggerName=Event0200 defaultTaskName=TaskFetchHttpCode
58 policy state output create name=Policy2 stateName=Junit  outputName=HttpCodeOut eventName=Event0201 nextState=Decide
59 policy state taskref create name=Policy2 stateName=Junit taskLocalName=check taskName=TaskFetchHttpCode outputType=DIRECT outputName=HttpCodeOut
60
61
62
63 validate
64