@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; }
@Override public boolean isConform(IDiagramElementView diagramElementView) { IParticipantBean participant = (IParticipantBean) diagramElementView.getDiagramElement().getModelElement(); if (participant.getInterfaces()==null){ return false; }else{ if (participant.getInterfaces().size()==0){ return false; } } return true; }
@Override public void bind(DefaultParticipantEditorModel watchedModel, CollaborationBean modelToBind) { if(this.initialized) { participant.setDocumentation(watchedModel.getDocumentation()); participant.setInterfaces(watchedModel.getInterfaces()); participant.setMaximumMultiplicity(watchedModel.getMaximumMultiplicity()); participant.setMinimumMultiplicity(watchedModel.getMinimumMultiplicity()); participant.setName(watchedModel.getName()); } }
@Override public void visitParticipant(IParticipantBean pool){ if(pool.getProcess()==null){ validationErrors.put(pool.getId(), BPMNValidationErrorMessage.EMPTY_POOL.getMessage()); } }
public void addParticipant(IParticipantBean participant){ if (participants.contains(participant)==false){ participant.setParentCollaborationBean(this); participants.add(participant); if (getParentDefinitions()!=null) getParentDefinitions().addProcess(participant.getProcess()); } }
@Override public void initializeWatchedModel( DefaultParticipantEditorModel watchedModel, CollaborationBean modelToBind) { this.initialized = false; if(!modelToBind.getParticipants().isEmpty()) { for(IParticipantBean p : modelToBind.getParticipants()) { if(p.getProcess()!=null && !p.getProcess().getFlowNodes().isEmpty()) { this.participant = p; break; } } } modelToBind.addParticipant(participant); DefaultParticipants.setDefaultParticipant(modelToBind, participant); watchedModel.setName(participant.getName()); watchedModel.setDocumentation(participant.getDocumentation()); watchedModel.setInterfaces(participant.getInterfaces()); this.initialized = true; }
public IParticipantBean getParticipantByProcess(IProcessBean process){ for(IParticipantBean p:participants){ if (p.getProcess()!=null){ if (p.getProcess().equals(process)){ return p; } } } return null; }
@Override public void visitParticipant(IParticipantBean participant) { if(participant.getId().equals(this.id) && bean==null){bean = participant;} } @Override
this.visitParticipant(p); if(p.getProcess()!=null){ IProcessBean proc = p.getProcess(); this.visitParticipantProcess(proc,p); if(p.getInterfaces()!=null){ for(IInterfaceBean itf : p.getInterfaces()){ this.visitParticipantInterface(itf); if(p.getEndPoints()!=null){ for(IEndPointBean ep : p.getEndPoints()){ this.visitParticipantEndPoint(ep,p);
public List<IFlowElementBean> getFlowNodes(){ List<IFlowElementBean> result = null; if(participants!=null && participants.size()!=0){ result = new ArrayList<IFlowElementBean>(); for(IParticipantBean Participant : participants){ if(Participant.getProcess()!=null){ result.addAll(Participant.getProcess().getFlowNodes()); } } } return result; } public IFlowElementBean getFlowNode(String id){
public IParticipantBean getParticipantById(String id) { for(IParticipantBean p: getParticipants()){ if(p.getId().equals(id)){ return p; } } return null; }
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); }
private IParticipantBean findEnclosingPool(IInteractionNodeBean iInteractionNodeBean){ for(IParticipantBean pool : currentCollab.getParticipants()){ if(pool.getProcess()!=null && pool.getProcess().getFlowNodes().contains(iInteractionNodeBean)){ return pool; } } return null; }
@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()); } } } }
public IFlowElementBean getFlowNode(String id){ if(participants!=null && participants.size()!=0){ for(IParticipantBean Participant : participants){ if(Participant.getProcess()!=null){ IFlowElementBean node = searchNodeById(Participant.getProcess().getFlowNodes(),id); if(node!=null){ return node; } } } } return null; }
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); } } }
public void sync(ICollaborationBean c){ for(IParticipantBean p:c.getParticipants()){ if(p.getProcess()!=null) { addProcess(p.getProcess()); } } for(IMessageBean m:c.getMessages()){ addMessage(m); } }
@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); }
private void initModel(){ IWatchedModelProxy<CollaborationBean> proxy = (IWatchedModelProxy<CollaborationBean>) defaultParticipantEditorModel; CollaborationBean collaboration = proxy.getBindedModel(); this.defaultParticipant = DefaultParticipants.getDefaultParticipant(collaboration); this.defaultLane = new LaneBean(); this.defaultParticipant.getProcess().getLanes().clear(); this.defaultParticipant.getProcess().addLane(defaultLane); }
@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); }