/root> #-------------------------------------------------------------------------------
/root> # ============LICENSE_START=======================================================
/root> #  Copyright (C) 2016-2018 Ericsson. All rights reserved.
/root> # ================================================================================
/root> # Licensed under the Apache License, Version 2.0 (the "License");
/root> # you may not use this file except in compliance with the License.
/root> # You may obtain a copy of the License at
/root> # 
/root> #      http://www.apache.org/licenses/LICENSE-2.0
/root> # 
/root> # Unless required by applicable law or agreed to in writing, software
/root> # distributed under the License is distributed on an "AS IS" BASIS,
/root> # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/root> # See the License for the specific language governing permissions and
/root> # limitations under the License.
/root> # 
/root> # SPDX-License-Identifier: Apache-2.0
/root> # ============LICENSE_END=========================================================
/root> #-------------------------------------------------------------------------------
/root> 
/root> model create name=HealthCheckPolicyModel
result: SUCCESS

/root> 
/root> schema create name=SimpleStringType  flavour=Java schema=java.lang.String
result: SUCCESS

/root> schema create name=SimpleIntegerType flavour=Java schema=java.lang.Integer
result: SUCCESS

/root> schema create name=SimpleBooleanType flavour=Java schema=java.lang.Boolean
result: SUCCESS

/root> 
/root> event create name=HealthCheckEvent nameSpace=org.onap.policy.apex.domains.HealthCheck source=Distribution target=Apex
result: SUCCESS

/root> event parameter create name=HealthCheckEvent parName=name schemaName=SimpleStringType
result: SUCCESS

/root> event parameter create name=HealthCheckEvent parName=url schemaName=SimpleStringType
result: SUCCESS

/root> event parameter create name=HealthCheckEvent parName=healthy schemaName=SimpleBooleanType
result: SUCCESS

/root> event parameter create name=HealthCheckEvent parName=code schemaName=SimpleIntegerType
result: SUCCESS

/root> event parameter create name=HealthCheckEvent parName=message schemaName=SimpleStringType
result: SUCCESS

/root> 
/root> task create name=HealthCheckTask
result: SUCCESS

/root> task inputfield create name=HealthCheckTask fieldName=name schemaName=SimpleStringType
result: SUCCESS
inputFields and outputFields are deprecated from Task definition and will be removed. Instead, inputEvent and outputEvents are automatically populated to Tasks based on State definition

/root> task inputfield create name=HealthCheckTask fieldName=url schemaName=SimpleStringType
result: SUCCESS
inputFields and outputFields are deprecated from Task definition and will be removed. Instead, inputEvent and outputEvents are automatically populated to Tasks based on State definition

/root> task inputfield create name=HealthCheckTask fieldName=healthy schemaName=SimpleBooleanType
result: SUCCESS
inputFields and outputFields are deprecated from Task definition and will be removed. Instead, inputEvent and outputEvents are automatically populated to Tasks based on State definition

/root> task inputfield create name=HealthCheckTask fieldName=code schemaName=SimpleIntegerType
result: SUCCESS
inputFields and outputFields are deprecated from Task definition and will be removed. Instead, inputEvent and outputEvents are automatically populated to Tasks based on State definition

/root> task inputfield create name=HealthCheckTask fieldName=message schemaName=SimpleStringType
result: SUCCESS
inputFields and outputFields are deprecated from Task definition and will be removed. Instead, inputEvent and outputEvents are automatically populated to Tasks based on State definition

/root> 
/root> task outputfield create name=HealthCheckTask fieldName=name schemaName=SimpleStringType
result: SUCCESS
inputFields and outputFields are deprecated from Task definition and will be removed. Instead, inputEvent and outputEvents are automatically populated to Tasks based on State definition

/root> task outputfield create name=HealthCheckTask fieldName=url schemaName=SimpleStringType
result: SUCCESS
inputFields and outputFields are deprecated from Task definition and will be removed. Instead, inputEvent and outputEvents are automatically populated to Tasks based on State definition

/root> task outputfield create name=HealthCheckTask fieldName=healthy schemaName=SimpleBooleanType
result: SUCCESS
inputFields and outputFields are deprecated from Task definition and will be removed. Instead, inputEvent and outputEvents are automatically populated to Tasks based on State definition

/root> task outputfield create name=HealthCheckTask fieldName=code schemaName=SimpleIntegerType
result: SUCCESS
inputFields and outputFields are deprecated from Task definition and will be removed. Instead, inputEvent and outputEvents are automatically populated to Tasks based on State definition

/root> task outputfield create name=HealthCheckTask fieldName=message schemaName=SimpleStringType
result: SUCCESS
inputFields and outputFields are deprecated from Task definition and will be removed. Instead, inputEvent and outputEvents are automatically populated to Tasks based on State definition

/root> 
/root> task logic create name=HealthCheckTask logicFlavour=JAVASCRIPT logic=LS
/*
 * ============LICENSE_START=======================================================
 *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
 *  Modifications Copyright (C) 2020 Nordix Foundation.
 * ================================================================================
 * 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=========================================================
 */

executor.logger.info(executor.subject.id);
executor.logger.info(executor.inFields);

executor.logger.info(executor.outFields);

true;

LE
result: SUCCESS

/root> 
/root> policy create name=HealthCheckPolicy template=freestyle firstState=HealthCheckState
result: SUCCESS

/root> 
/root> policy state create name=HealthCheckPolicy stateName=HealthCheckState triggerName=HealthCheckEvent defaultTaskName=HealthCheckTask
result: SUCCESS

/root> policy state output create name=HealthCheckPolicy stateName=HealthCheckState outputName=HealthCheckOutput eventName=HealthCheckEvent
result: SUCCESS

/root> policy state taskref create name=HealthCheckPolicy stateName=HealthCheckState taskName=HealthCheckTask outputType=DIRECT outputName=HealthCheckOutput
result: SUCCESS

/root> 
/root> validate
result: SUCCESS
{
  "name": "HealthCheckPolicyModel",
  "version": "0.0.1"
}

***observations noted during validation of model***
AxArtifactKey:(name=HealthCheckPolicyModel_Albums,version=0.0.1):org.onap.policy.apex.model.contextmodel.concepts.AxContextAlbums:OBSERVATION:albums are empty
********************************

/root> 
/root> 