CommandEntry lastFragmentCommandEntry = lastFragmentInteraction.getCommandEntry();
if (lastFragmentCommandEntry instanceof BreakCommandEntry){
breakLabel = sortLabel;
}
interaction.setToolTip(lastFragmentInteraction.getToolTip()); // behave like last fragment interaction concerning tool tip and conditions
CommandEntryExtender lastFragmentCommandEntryExtender = commandEntryManager.createCommandEntryExtender(lastFragmentCommandEntry);
commandMap.put(interaction.getIndentation(), lastFragmentCommandEntryExtender);
if (!contactAvailable && lastFragmentCommandEntryExtender.assignsContact()){
contactAssignLabel = sortLabel;
}
}
}
}
}
}
// check for outer loops and current user set access outside of loops
if (commandEntry instanceof IterateCommandEntry){
if (!withinLoop){
loopLabel = sortLabel;
}
} else if (!interaction.isError() && !withinLoop && commandEntryExtender.requiresCurrentUserSet()){
interaction.setError(true);
interaction.setErrorDescription(messages.getString("smssvc.AccessedCurrentUserSetIsNotAvailable"));
}
// check for available contact user; no checks and prefix setting if contact already available
if (!contactAvailable){ // both contact user assigning interactions return "a" in case of success
if (!interaction.isError() && commandEntryExtender.requiresContactUser()){
interaction.setError(true);
interaction.setErrorDescription(messages.getString("smssvc.AccessedContactMayNotBeAvailable"));
}
if (commandEntryExtender.assignsContact()){
contactAssignLabel = sortLabel;
}
}
// check if command not usuable in this list by creating a command entry with the dummy event parameters
if (!interaction.isError() && eventParameters != null && commandEntryExtender.createCommand(eventParameters, new EventVariables(eventParameters), null) == null){
interaction.setError(true);
interaction.setErrorDescription(messages.getString("InteractionNotAllowedInThisInteractionList"));
}
// add condition entries if appropriate
if (previousCommandEntry != null) {
String condString = commandEntryManager.getCondition(previousCommandEntry, commandEntry);
String baseStringRepresentation = sortLabel.getBaseStringRepresentation();
if (condString != null && !labelsUsedForCondition.contains(baseStringRepresentation)) {
DisplayableInteractionContent condition = new DisplayableInteractionContent();
condition.setIndentation(interaction.getIndentation() - 1); // indent one less than statement itself
condition.setCondition(true);
CommandEntryExtender parentCommand = commandMap.get(interaction.getIndentation()-1);
if (parentCommand != null) {
if (parentCommand instanceof UpcallCommandEntryExtender){
condition.setInteractionDescription(messages.getString(parentCommand.getTooltipKey())+" '"+condString+"':");
} else if (parentCommand instanceof HttpCommandEntryExtender) {
if (condString.startsWith("a")){
condition.setInteractionDescription(messages.getString(parentCommand.getTooltipKey() + "_a___") + (condString.length() >= 2 ? (" (" + condString.substring(1) + ")") : ""));
if (((HttpCommandEntryExtender)parentCommand).getCommandEntry().getNofEvaluatedResponseLetters() < condString.length() - 1) {
condition.setError(true);
condition.setErrorDescription(messages.getString("smssvc.unreachableBranch"));
}
} else if (condString.equals("b")){
condition.setInteractionDescription(messages.getString(parentCommand.getTooltipKey() + "_b"));
} else {
condition.setInteractionDescription( messages.getString("smssvc.unreachableBranch"));
condition.setError(true);
condition.setErrorDescription(messages.getString("smssvc.unreachableBranch"));
}
} else if (parentCommand instanceof ImageRecognitionCommandEntryExtender) {
try {
condition.setInteractionDescription(messages.getString("smssvc.imageRecognition." + condString) + ":");
} catch (Exception e) {
condition.setInteractionDescription( messages.getString("smssvc.unreachableBranch"));
condition.setError(true);
condition.setErrorDescription(messages.getString("smssvc.unreachableBranch"));
}
} else {
String conditionKeyBase = parentCommand.getTooltipKey();
String conditionKey = conditionKeyBase + "_" + condString;
String conditionDescription = condString;
try {
conditionDescription = messages.getString(conditionKey);
} catch (Exception e) {