Ejemplo n.º 1
0
  private OpenAcdRecipeActionRestInfo createRecipeActionRestInfo(OpenAcdRecipeStep step) {
    OpenAcdRecipeActionRestInfo recipeActionRestInfo;
    List<OpenAcdSkillRestInfo> skillsRestInfo;

    // get skills associated with action
    skillsRestInfo = createSkillsRestInfo(step.getAction().getSkills());
    recipeActionRestInfo = new OpenAcdRecipeActionRestInfo(step.getAction(), skillsRestInfo);

    return recipeActionRestInfo;
  }
Ejemplo n.º 2
0
  private List<OpenAcdRecipeConditionRestInfo> createRecipeConditionsRestInfo(
      OpenAcdRecipeStep step) {
    List<OpenAcdRecipeConditionRestInfo> recipeConditionsRestInfo;
    OpenAcdRecipeConditionRestInfo recipeConditionRestInfo;

    List<OpenAcdRecipeCondition> groupRecipeConditions = step.getConditions();
    recipeConditionsRestInfo =
        new ArrayList<OpenAcdRecipeConditionRestInfo>(groupRecipeConditions.size());

    for (OpenAcdRecipeCondition groupRecipeCondition : groupRecipeConditions) {
      recipeConditionRestInfo = new OpenAcdRecipeConditionRestInfo(groupRecipeCondition);
      recipeConditionsRestInfo.add(recipeConditionRestInfo);
    }

    return recipeConditionsRestInfo;
  }
Ejemplo n.º 3
0
  private void addLists(
      OpenAcdQueueGroup queueGroup, OpenAcdQueueGroupRestInfoFull queueGroupRestInfo) {
    // remove all skills
    queueGroup.getSkills().clear();

    // set skills
    OpenAcdSkill skill;
    List<OpenAcdSkillRestInfo> skillsRestInfo = queueGroupRestInfo.getSkills();
    for (OpenAcdSkillRestInfo skillRestInfo : skillsRestInfo) {
      skill = m_openAcdContext.getSkillById(skillRestInfo.getId());
      queueGroup.addSkill(skill);
    }

    // remove all agent groups
    queueGroup.getAgentGroups().clear();

    // set agent groups
    OpenAcdAgentGroup agentGroup;
    List<OpenAcdAgentGroupRestInfo> agentGroupsRestInfo = queueGroupRestInfo.getAgentGroups();
    for (OpenAcdAgentGroupRestInfo agentGroupRestInfo : agentGroupsRestInfo) {
      agentGroup = m_openAcdContext.getAgentGroupById(agentGroupRestInfo.getId());
      queueGroup.addAgentGroup(agentGroup);
    }

    // remove all current steps
    queueGroup.getSteps().clear();

    // set steps
    OpenAcdRecipeStep step;
    OpenAcdRecipeCondition condition;
    OpenAcdRecipeAction action;
    OpenAcdRecipeActionRestInfo actionRestInfo;

    List<OpenAcdRecipeStepRestInfo> recipeStepsRestInfo = queueGroupRestInfo.getSteps();
    for (OpenAcdRecipeStepRestInfo recipeStepRestInfo : recipeStepsRestInfo) {
      step = new OpenAcdRecipeStep();
      step.setFrequency(recipeStepRestInfo.getFrequency());

      // add conditions
      step.getConditions().clear();
      for (OpenAcdRecipeConditionRestInfo recipeConditionRestInfo :
          recipeStepRestInfo.getConditions()) {
        condition = new OpenAcdRecipeCondition();
        condition.setCondition(recipeConditionRestInfo.getCondition());
        condition.setRelation(recipeConditionRestInfo.getRelation());
        condition.setValueCondition(recipeConditionRestInfo.getValueCondition());

        step.addCondition(condition);
      }

      // add action
      action = new OpenAcdRecipeAction();
      actionRestInfo = recipeStepRestInfo.getAction();
      action.setAction(actionRestInfo.getAction());
      action.setActionValue(actionRestInfo.getActionValue());

      // set action skills (separate from skills assigned to queue
      for (OpenAcdSkillRestInfo skillRestInfo : actionRestInfo.getSkills()) {
        skill = m_openAcdContext.getSkillById(skillRestInfo.getId());
        action.addSkill(skill);
      }

      step.setAction(action);

      queueGroup.addStep(step);
    }
  }