protected void receiveEvent(WorkflowDataToken token, String portName) { int portIndex = inputPortNameToIndex(portName); if (portIndex == -1) { throw new WorkflowStructureException( "Received event on a port that doesn't exist, huh?"); } int[] currentIndex = token.getIndex(); int[] newIndex = new int[currentIndex.length + 1]; newIndex[0] = portIndex; for (int i = 0; i < currentIndex.length; i++) { newIndex[i + 1] = currentIndex[i]; } output.sendEvent(new WorkflowDataToken(token.getOwningProcess(), newIndex, token.getData(), token.getContext())); }