@Override public void visitParticipant(IParticipantBean participant) { if(participant.getId().equals(this.id) && bean==null){bean = participant;} } @Override
public IParticipantBean getParticipantById(String id) { for(IParticipantBean p: getParticipants()){ if(p.getId().equals(id)){ return p; } } return null; }
@Override public void visitParticipant(IParticipantBean pool){ if(pool.getProcess()==null){ validationErrors.put(pool.getId(), BPMNValidationErrorMessage.EMPTY_POOL.getMessage()); } }
@Override public void visitParticipantProcess(IProcessBean proc, IParticipantBean p){ if(proc.getLanes()==null || proc.getLanes().isEmpty()){ validationErrors.put(p.getId(), BPMNValidationErrorMessage.EMPTY_POOL.getMessage()); } else{ if(proc.getEndEvents()!=null && !proc.getEndEvents().isEmpty()){ if(proc.getStartEvents()==null || proc.getStartEvents().isEmpty()){ validationErrors.put(p.getId(), BPMNValidationErrorMessage.NO_START.getMessage()); } } } }
private void process(Set<ChoreographyTaskBean> choreoTasks){ //assign message flow to initiating participant for(ChoreographyTaskBean ct:choreoTasks){ ct.setInitiatingMessageFlow(null); if (ct.getInitiatingParticipant()!=null){ IParticipantBean source = ct.getInitiatingParticipant(); IParticipantBean target = getNonInitiatingParticipant(ct); MessageFlowBean initiatingMessageFlow = new MessageFlowBean("MsgFlow_"+source.getId()+"_"+target.getId()); initiatingMessageFlow.setSource(source); initiatingMessageFlow.setTarget(target); ct.setInitiatingMessageFlow(initiatingMessageFlow); } } }
@Override public void visitSubChoreography(ISubChoreographyBean subChor){ SubChoreography sc = newInstance(SubChoreography.class); sc.setId(subChor.getId()); setDocumentationAndExtensions(sc, subChor); sc.setLoopType(retrieveChoreographyLoopType(subChor.getChoreographyLoopType())); sc.setInitiatingParticipantRef(new QName(subChor.getInitiatingParticipant().getId())); sc.setName(subChor.getName()); if(subChor.getParticipants()!=null){ for(IParticipantBean p : subChor.getParticipants()){ sc.addParticipantRef(new QName(p.getId())); } } currentFlowElementContainer.peek().addFlowElement(sc); currentFlowElementContainer.push(sc); currentArtifactContainer.push(sc); }
@Override public void visitChoreographyTask(IChoreographyTaskBean cTask){ ChoreographyTask ct = newInstance(ChoreographyTask.class); ct.setId(cTask.getId()); ct.setName(cTask.getName()); setDocumentationAndExtensions(ct, cTask); ct.setLoopType(retrieveChoreographyLoopType(cTask.getChoreographyLoopType())); ct.setInitiatingParticipantRef(new QName(cTask.getInitiatingParticipant().getId())); if(cTask.getParticipants()!=null){ for(IParticipantBean p : cTask.getParticipants()){ ct.addParticipantRef(new QName(p.getId())); } } if(cTask.getInitiatingMessageFlow()!=null){ ct.addMessageFlowRef(new QName(cTask.getInitiatingMessageFlow().getId())); } if(cTask.getReturnMessageFlow()!=null){ ct.addMessageFlowRef(new QName(cTask.getReturnMessageFlow().getId())); } currentFlowElementContainer.peek().addFlowElement(ct); }
@Override public void visitParticipant(IParticipantBean participantBean) { Participant participant = newInstance(Participant.class); participant.setId(participantBean.getId()); participant.setName(participantBean.getName()); if(participantBean.getProcess()!=null){ participant.setProcessRef(getBaseElementRef(participantBean.getProcess())); } setDocumentationAndExtensions(participant, participantBean); currentCollaboration.addParticipant(participant); currentParticipant = participant; }
protected ProcessChoosingPanel(IDefinitionsBean defs) { setTitle("Choose the processes that will be deployed"); setAutoScroll(true); setLayout(new FitLayout()); setBorder(false); processTreeNodes = new HashSet<ProcessTreeNode>(); diagramPanel = new TreePanel("BPMN Diagram"); diagramPanel.setAutoScroll(true); diagramPanel.setBorder(false); diagramPanel.setEnableDD(true); TreeNode rootNode = new TreeNode(((defs.getName()==null || defs.getName().isEmpty()) ? "Diagram" : defs.getName())); rootNode.setExpanded(true); rootNode.setAllowDrop(false); rootNode.setAllowDrag(false); diagramPanel.setRootNode(rootNode); for(IParticipantBean participant : defs.getCollaborations().get(0).getParticipants()){ //skip empty/collapsed pools if(participant.getProcess()==null || participant.getProcess().getFlowNodes().isEmpty()) continue; TreeNode poolNode = new ProcessTreeNode(participant.getProcess()); poolNode.setChecked(false); poolNode.setAllowDrag(false); String text = (participant.getName()==null ? participant.getId() : participant.getName()); poolNode.setText(text); poolNode.setIcon(POOL_ICON); rootNode.appendChild(poolNode); } this.add(diagramPanel); }