package ua.be.wee.controller;

import java.util.List;
import java.util.Map;
import java.util.ArrayList;

public class BranchContext {
    private String pmName;
    private String branchId;
    private String invokingActivityName;
    private List<PMTrigger> availableActs;
    private List<Map<String, Object>> endableActs;
    
    public BranchContext(String pmName, String branchId, String invokingActivityName) {
        this.pmName = pmName;
        this.branchId = branchId;
        this.invokingActivityName = invokingActivityName;
        this.availableActs = new ArrayList<>();
        this.endableActs = new ArrayList<>();
    }

    public String getDisplayName() {
        if (invokingActivityName != null && !invokingActivityName.trim().isEmpty()) {
            return pmName + " (Invoked by " + invokingActivityName + ")";
        }
        return pmName;
    }

    // Getters e Setters
    public String getPmName() { return pmName; }
    public void setPmName(String pmName) { this.pmName = pmName; }
    public String getBranchId() { return branchId; }
    public void setBranchId(String branchId) { this.branchId = branchId; }
    public String getInvokingActivityName() { return invokingActivityName; }
    public void setInvokingActivityName(String invokingActivityName) { this.invokingActivityName = invokingActivityName; }
    public List<PMTrigger> getAvailableActs() { return availableActs; }
    public void setAvailableActs(List<PMTrigger> availableActs) { this.availableActs = availableActs; }
    public List<Map<String, Object>> getEndableActs() { return endableActs; }
    public void setEndableActs(List<Map<String, Object>> endableActs) { this.endableActs = endableActs; }
}