// for transitions so we use it at this point to do so
PetriNetModelProcessor processor = new PetriNetModelProcessor();
processor.setElementContainer(currentContainer);
TransitionType transitions[] = currentNet.getTransitionArray();
CreationMap map;
for (int i = 0; i < transitions.length; i++) {
map = CreationMap.createMap();
map.setEditOnCreation(false);
map.setType(AbstractPetriNetElementModel.TRANS_SIMPLE_TYPE);
try {
importNameAndLayout(transitions[i], map);
try {
if (ConfigurationManager.getConfiguration()
.isImportToolspecific()) {
for (int j = 0; j < transitions[i]
.getToolspecificArray().length; j++) {
if (transitions[i].getToolspecificArray(j)
.getTool().equals("WoPeD")) {
if (transitions[i].getToolspecificArray(j)
.isSetTime()) {
map.setTransitionTime(transitions[i]
.getToolspecificArray(j).getTime());
}
if (transitions[i].getToolspecificArray(j)
.isSetTimeUnit()) {
map.setTransitionTimeUnit(transitions[i]
.getToolspecificArray(j)
.getTimeUnit());
}
//set operatorOrientation
if (transitions[i].getToolspecificArray(j)
.isSetOrientation()) {
map.setOperatorPosition(transitions[i]
.getToolspecificArray(j)
.getOrientation());
}
if (transitions[i].getToolspecificArray(j)
.isSetOperator()) {
map.setOperatorType(transitions[i]
.getToolspecificArray(j)
.getOperator().getType());
map
.setType(TransitionModel.TRANS_OPERATOR_TYPE);
map.setId(transitions[i]
.getToolspecificArray(j)
.getOperator().getId());
} else if (transitions[i].getToolspecificArray(
j).isSetSubprocess()) {
map.setType(AbstractPetriNetElementModel.SUBP_TYPE);
}
if (transitions[i].getToolspecificArray(j)
.isSetTrigger()) {
map.setTriggerType(transitions[i]
.getToolspecificArray(j)
.getTrigger().getType());
map.setTriggerPosition(transitions[i]
.getToolspecificArray(j)
.getTrigger().getGraphics()
.getPosition().getX().intValue(),
transitions[i]
.getToolspecificArray(j)
.getTrigger().getGraphics()
.getPosition().getY()
.intValue());
}
if (transitions[i].getToolspecificArray(j)
.isSetTransitionResource()) {
// &&
// transitions[i].getToolspecificArray(j).getTrigger().getType()
// == 200
map.setResourceOrgUnit(transitions[i]
.getToolspecificArray(j)
.getTransitionResource()
.getOrganizationalUnitName());
map.setResourceRole(transitions[i]
.getToolspecificArray(j)
.getTransitionResource()
.getRoleName());
map.setResourcePosition(transitions[i]
.getToolspecificArray(j)
.getTransitionResource()
.getGraphics().getPosition().getX()
.intValue(), transitions[i]
.getToolspecificArray(j)
.getTransitionResource()
.getGraphics().getPosition().getY()
.intValue());
}
if (transitions[i].getToolspecificArray(j)
.isSetEmpty()) {
TEmpty empty = transitions[i]
.getToolspecificArray(j).getEmpty();
Empty bpel = new Empty(empty.getName());
map.setBpeldata(bpel);
}
if (transitions[i].getToolspecificArray(j)
.isSetAssign()) {
TAssign assign = transitions[i]
.getToolspecificArray(j)
.getAssign();
Assign bpel = new Assign(assign.getName(),
assign.getCopyArray(0).getFrom()
.getVariable(), assign
.getCopyArray(0).getTo()
.getVariable());
map.setBpeldata(bpel);
}
if (transitions[i].getToolspecificArray(j)
.isSetInvoke()) {
TInvoke invoke = transitions[i]
.getToolspecificArray(j)
.getInvoke();
Invoke bpel = new Invoke(invoke.getName(),
invoke.getPartnerLink(), invoke
.getOperation(), "", invoke
.getInputVariable(), invoke
.getOutputVariable());
map.setBpeldata(bpel);
}
if (transitions[i].getToolspecificArray(j)
.isSetReceive()) {
TReceive receive = transitions[i]
.getToolspecificArray(j)
.getReceive();
Receive bpel = new Receive(receive
.getName(), receive
.getPartnerLink(), receive
.getOperation(), receive
.getVariable());
map.setBpeldata(bpel);
}
if (transitions[i].getToolspecificArray(j)
.isSetReply()) {
TReply reply = transitions[i]
.getToolspecificArray(j).getReply();
Reply bpel = new Reply(reply.getName(),
reply.getPartnerLink(), reply
.getOperation(), reply
.getVariable());
map.setBpeldata(bpel);
}
if (transitions[i].getToolspecificArray(j)
.isSetWait()) {
TWait wait = transitions[i]
.getToolspecificArray(j).getWait();
Wait bpel = new Wait(wait.getName(), wait
.getTyp(), wait.getYear(), wait
.getMonth(), wait.getDay(), wait
.getHour(), wait.getMinute(), wait
.getSecond());
map.setBpeldata(bpel);
}
} else {
map.addUnknownToolSpec(transitions[i]
.getToolspecificArray(j));
}
}
}
} catch (Exception e) {
warnings
.add("- TRANSITION LOST INFORMATION ("
+ transitions[i].getId()
+ "): Exception while importing lesser important information.");
}
if (!currentContainer.containsElement(map.getId())) {
// There is one fun thing about transitions:
// They may be inner transitions which are treated specially
// by carrying
// some tool-specific information as to which operator they
// belong.
// Now, instead of the transition, an operator is created
// for each of those inner transitions
// and all but the first such instance are discarded here
// because an element
// with the same id already exists at this point
AbstractPetriNetElementModel element = processor.createElement(map);
currentContainer.addElement(element);
LoggerManager.debug(Constants.FILE_LOGGER,
" ... Transition (ID:" + map.getId() + ")imported");
// increaseCurrent();
if (element.getType() == AbstractPetriNetElementModel.SUBP_TYPE) {
// The element we just created is a sub-process element
// Get the corresponding page from the PNML document