2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2016-2018 Ericsson. All rights reserved.
4 * Modifications Copyright (C) 2020 Nordix Foundation.
5 * ================================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 * SPDX-License-Identifier: Apache-2.0
19 * ============LICENSE_END=========================================================
22 var returnValue = true;
24 executor.logger.info("Task Selection Execution: '"+executor.subject.id+
25 "'. Input Event: '"+executor.inFields+"'");
27 branchid = executor.inFields.get("branch_ID");
28 taskorig = executor.subject.getTaskKey("MorningBoozeCheck");
29 taskalt = executor.subject.getTaskKey("MorningBoozeCheckAlt1");
30 taskdef = executor.subject.getDefaultTaskKey();
32 if(branchid >=0 && branchid <1000){
33 taskorig.copyTo(executor.selectedTask);
35 else if (branchid >=1000 && branchid <2000){
36 taskalt.copyTo(executor.selectedTask);
39 taskdef.copyTo(executor.selectedTask);
43 This task selection logic selects task "MorningBoozeCheck" for branches with
44 0<=branch_ID<1000 and selects task "MorningBoozeCheckAlt1" for branches with
45 1000<=branch_ID<2000. Otherwise the default task is selected.
46 In this case the default task is also "MorningBoozeCheck"