if (selectedToken != -1) {
controller.handleEvent(
new Event(SignalExecutionAction.ID,
new SignalInstanceEvent(getCurrentDefinition(), getSelection(), listBoxTokens.getItem(selectedToken), eventData.getText(), selectedToken)));
} else if (signalRef.getText().length() > 0) {
TokenReference token = new TokenReference();
token.setId(getSelection().getId());
token.setName(signalRef.getText());
int foundMatch = -1;
int index = 0;
// try to find matching element from the list to avoid double signal problems
for (TokenReference ref : tokensToSignal)
{
if (ref.getName().equals(token.getName())) {
foundMatch = index;
break;
}
index++;
}
controller.handleEvent(
new Event(SignalExecutionAction.ID,
new SignalInstanceEvent(getCurrentDefinition(), getSelection(), token, eventData.getText(), foundMatch)));
} else {
MessageBox.alert("Incomplete selection", "Please select element you want to signal");
}