public IParticipantBean getParticipantByProcess(IProcessBean process){ for(IParticipantBean p:participants){ if (p.getProcess()!=null){ if (p.getProcess().equals(process)){ return p; } } } return null; }
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){
private IParticipantBean findEnclosingPool(IInteractionNodeBean iInteractionNodeBean){ for(IParticipantBean pool : currentCollab.getParticipants()){ if(pool.getProcess()!=null && pool.getProcess().getFlowNodes().contains(iInteractionNodeBean)){ return pool; } } return null; }
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; }
@Override public void visitParticipant(IParticipantBean pool){ if(pool.getProcess()==null){ validationErrors.put(pool.getId(), BPMNValidationErrorMessage.EMPTY_POOL.getMessage()); } }
public void sync(ICollaborationBean c){ for(IParticipantBean p:c.getParticipants()){ if(p.getProcess()!=null) { addProcess(p.getProcess()); } } for(IMessageBean m:c.getMessages()){ addMessage(m); } }
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); }
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 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 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; }
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); }
this.visitParticipant(p); if(p.getProcess()!=null){ IProcessBean proc = p.getProcess(); this.visitParticipantProcess(proc,p);
defaultParticipant.getProcess().clearFlowElements(); defaultParticipant.getProcess().clearIOSpec(); s.setTargetNode((IFlowElementBean) ((IEdge)di).getTarget().getModelElement()); defaultParticipant.getProcess().addSequenceFlow(s);
if(((IParticipantBean) shape.getModelElement()).getProcess()!=null) { pools.put((IParticipantBean) shape.getModelElement(), shape.getBounds()); if(p.getProcess().getLanes().contains(shape.getModelElement())) { IBounds poolBounds = pools.get(p); Bounds laneBounds = result.getBounds();