import { judge } from "@/model/Process";
import NodeHelper from "@/common/nodeHelper";
export default class SwtionJudge {
  public appendProcess(
    value: IJudge,
    nodeId: string,
    source: Array<judge>
  ): IJudge {
    // value.id = this.createId(nodeId, source);
    value.id = NodeHelper.createId();
    
    source.push(value);
    return value;
  }
  // public createId(nodeId: string, source: Array<any>) {
  //   let key = 0;
  //   if (source.length > 0) {
  //     let lastId = source[source.length - 1].id;
  //     let splitIds = lastId.split("-");
  //     key = Number(splitIds[splitIds.length - 1]) + 1;
  //   }
  //   return nodeId + "-judge-" + key;
  // }
  // public removeJudge(id: string, source?: ICondition) {
  //   const swtionProcess = new SwtionProcess();
  //   if (!source) {
  //     source = swtionProcess.loadProcessLineById().condition;
  //   }
  //   JsonHelper.removeDataByKey(source, "id", id, "judge");
  // }
}
