/* 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.
 */
package org.flowable.dmn.api;

import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public class DecisionServiceExecutionAuditContainer extends DecisionExecutionAuditContainer {

    protected Map<String, List<Map<String, Object>>> decisionServiceResult = new HashMap<>();
    protected Map<String, DecisionExecutionAuditContainer> childDecisionExecutions = new LinkedHashMap<>();

    public DecisionServiceExecutionAuditContainer() {
    }

    public DecisionServiceExecutionAuditContainer(String id, String name, int decisionVersion, boolean strictMode, 
            Map<String, Object> variables, Date startTime) {
        
        super(id, name, decisionVersion, strictMode, variables, startTime);
    }

    public Map<String, List<Map<String, Object>>> getDecisionServiceResult() {
        return decisionServiceResult;
    }
    public void setDecisionServiceResult(Map<String, List<Map<String, Object>>> decisionServiceResult) {
        this.decisionServiceResult = decisionServiceResult;
    }
    public void addDecisionServiceResult(String decisionKey, List<Map<String, Object>> decisionResult) {
        decisionServiceResult.put(decisionKey, decisionResult);
    }
    public List<Map<String, Object>> getDecisionServiceResultForDecision(String decisionKey) {
        return decisionServiceResult.get(decisionKey);
    }

    public DecisionExecutionAuditContainer getChildDecisionExecution(String decisionKey) {
        return childDecisionExecutions.get(decisionKey);
    }
    public void addChildDecisionExecution(String decisionKey, DecisionExecutionAuditContainer decisionResult) {
        childDecisionExecutions.put(decisionKey, decisionResult);
    }
    public Map<String, DecisionExecutionAuditContainer> getChildDecisionExecutions() {
        return childDecisionExecutions;
    }
    public void setChildDecisionExecutions(Map<String, DecisionExecutionAuditContainer> childDecisionExecutions) {
        this.childDecisionExecutions = childDecisionExecutions;
    }

}
