tokenGameStats.numActiveSubprocesses++;
}
}
} else
if (transition.getType() == AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE) {
OperatorTransitionModel operator = (OperatorTransitionModel) transition;
if (operator.getOperatorType() == OperatorTransitionModel.AND_JOIN_TYPE
|| operator.getOperatorType() == OperatorTransitionModel.AND_SPLIT_TYPE
|| operator.getOperatorType() == OperatorTransitionModel.AND_SPLITJOIN_TYPE) {
if (transition.isActivated()) {
// This will add the AND-X-Transition to the OccurenceList
RemoteControl.addFollowingItem(transition);
tokenGameStats.numActiveTransitions++;
}
} else
if ((operator.getOperatorType() == OperatorTransitionModel.XOR_SPLIT_TYPE)
|| (operator.getOperatorType() == OperatorTransitionModel.ANDJOIN_XORSPLIT_TYPE)) {
if (transition.isActivated()) {
String XorName, ID;
Iterator<String> outArcs = outgoingArcs.keySet().iterator();
TransitionModel virtualTransition; // needed to build virtual Transitions.
AbstractPetriNetElementModel helpPlace;
/*
* In this while-loop, Virtual Transitions will be build which represent the Arcs in the OccurenceList. If a virtual Transition is
* chosen by the user, it will be identified by its ID as Arc and the depending Arc will be taken instead to be occured
*/
while (outArcs.hasNext()) {
ID = outArcs.next(); // get the Arc's ID
// Use a new CreationMap with the arcs id to create the virtual transition
CreationMap map = CreationMap.createMap();
map.setId(ID);
virtualTransition = new TransitionModel(map);
helpPlace = getPetriNet().getElementContainer().getElementById(
getPetriNet().getElementContainer().getArcById(ID).getTargetId());
XorName = transition.getNameValue() + " -> (" + helpPlace.getNameValue() + ")";
virtualTransition.setNameValue(XorName);
RemoteControl.addFollowingItem(virtualTransition);
tokenGameStats.numActiveTransitions++;
virtualTransition = null;
XorName = "";
}
setOutgoingArcsActive(transition.getId(), true);
}
} else
if ((operator.getOperatorType() == OperatorTransitionModel.XOR_JOIN_TYPE)
|| (operator.getOperatorType() == OperatorTransitionModel.XORJOIN_ANDSPLIT_TYPE)) {
if (transition.getNumIncomingActivePlaces() > 0) {
String XorName, ID;
Iterator<String> inArcs = incomingArcs.keySet().iterator();
TransitionModel virtualTransition; // needed to build virtual Transitions.
AbstractPetriNetElementModel helpPlace;
// ArcModel activeArc;
/*
* In this while-loop, Virtual Transitions will be build which represent the Arcs in the OccurenceList. If a virtual Transition
* is chosen by the user, it will be identified by its ID as Arc and the depending Arc will be taken instead to be occured
*/
setIncomingArcsActive(transition.getId(), true);
while (inArcs.hasNext()) {
ID = inArcs.next(); // Get Arcs ID
// List all activated Arcs in the occur List
if (getPetriNet().getElementContainer().getArcById(ID).isActivated()) {
// Use a new CreationMap with the arcs id to create the virtual transition
CreationMap map = CreationMap.createMap();
map.setId(ID);
virtualTransition = new TransitionModel(map);
helpPlace = getPetriNet().getElementContainer().getElementById(
getPetriNet().getElementContainer().getArcById(ID).getSourceId());
XorName = "(" + helpPlace.getNameValue() + ")-> " + transition.getNameValue();
virtualTransition.setNameValue(XorName);
RemoteControl.addFollowingItem(virtualTransition);
tokenGameStats.numActiveTransitions++;
virtualTransition = null;
XorName = "";
}
}
}
} else
if (operator.getOperatorType() == OperatorTransitionModel.XOR_SPLITJOIN_TYPE) {
// This is the XOR split-join combination type.
// Check whether the center place already contains (a) token(s)
if ((operator.getCenterPlace() != null)
&& (operator.getCenterPlace().getVirtualTokenCount() > 0)) {
String XorName, ID;
Iterator<String> outArcs = outgoingArcs.keySet().iterator();
TransitionModel virtualTransition; // needed to build virtual Transitions.
AbstractPetriNetElementModel helpPlace;