Package cn.edu.pku.dr.requirement.elicitation.data

Examples of cn.edu.pku.dr.requirement.elicitation.data.ScenarioRoleRelation


                topFilter.addFilter(filter);
                scmd.setFilter(topFilter);
                ArrayList relationList=dp.query(scmd);
               
                for(int i=0;i<relationList.size();i++) {
                    ScenarioRoleRelation relation=(ScenarioRoleRelation)relationList.get(i);
                    Scenario scenario=new Scenario();
                    scenario.setScenarioId(relation.getScenarioId());
                    scenario.setScenarioName(relation.getScenarioName());
                    sourceList.add(scenario);
                }
            }
            //得到用户可以查看的场景
           
            UserScenarioRelation relation=new UserScenarioRelation();
            relation.setUserId(userId);
            ArrayList relationList=dp.query(relation);
            for(int i=0;i<relationList.size();i++) {
                relation=(UserScenarioRelation)relationList.get(i);
                Scenario scenario=new Scenario();
                scenario.setScenarioId(relation.getScenarioId());
                scenario.setScenarioName(relation.getScenarioName());
                sourceList.add(scenario);
            }
        }
       
        StringBuffer buffer= HtmlClientComponentService.getMultiSelect(sourceList, new ArrayList(), "scenarioName",Scenario.class);
View Full Code Here


            }
        }
       
        size=scenarioRoleList.size();
        for(int i=0;i<size;i++) {
            ScenarioRoleRelation relation=(ScenarioRoleRelation)scenarioRoleList.get(i);
            String scenarioName=relation.getScenarioName();
            if(sbuffer.indexOf(scenarioName)<0) {
                sbuffer.append(scenarioName);
                sbuffer.append("\n");
            }
           
            String roleName=relation.getRoleName();
            if(rbuffer.indexOf(roleName) <0) {
                rbuffer.append(roleName);
                rbuffer.append("\n");
            }
           
            String roleScenario=roleName+","+scenarioName;
           
            if(srbuffer.indexOf(roleScenario)<0) {
                srbuffer.append(relation.getScenarioName()).append(",");
                srbuffer.append(relation.getRoleName());
                srbuffer.append(",");
                srbuffer.append("solid");
                srbuffer.append("\n");
            }
        }
       
        size=scenarioDataList.size();
        HashMap<String,String> dataScenario=new HashMap<String,String>();
       
       
       
        //找场景之间的数据关系,因为还没有数据传递关系的抽取,所以这里把所有的关系输出,将来需要修改
        for(int i=0;i<size;i++) {
            ScenarioDataRelation relation=(ScenarioDataRelation)scenarioDataList.get(i);
            String data=relation.getDataName();
            if (dbuffer.indexOf(data) < 0)
                dbuffer.append(data).append("\n");
            String scenarioName = relation.getScenarioName();
            sdbuffer.append(scenarioName).append(",").append(data).append(",").append("solid\n");
        }
       

       
View Full Code Here

            }
        }
       
        size=scenarioRoleList.size();
        for(int i=0;i<size;i++) {
            ScenarioRoleRelation relation=(ScenarioRoleRelation)scenarioRoleList.get(i);
            String scenarioName=relation.getScenarioName();
            if(sbuffer.indexOf(scenarioName)<0) {
                sbuffer.append(scenarioName);
                sbuffer.append("\n");
            }
           
            String roleName=relation.getRoleName();
            if(rbuffer.indexOf(roleName) <0) {
                rbuffer.append(roleName);
                rbuffer.append("\n");
            }
           
            String roleScenario=roleName+","+scenarioName;
           
            if(srbuffer.indexOf(roleScenario)<0) {
                srbuffer.append(relation.getRoleName());
                srbuffer.append(",");
                srbuffer.append(relation.getScenarioName());
                srbuffer.append("\n");
            }
        }
       
        size=scenarioDataList.size();
        HashMap<String,String> dataScenario=new HashMap<String,String>();
       
        //找场景之间的数据关系,因为还没有数据传递关系的抽取,所以这里把所有的关系输出,将来需要修改
        for(int i=0;i<size;i++) {
            ScenarioDataRelation relation=(ScenarioDataRelation)scenarioDataList.get(i);
            String data=relation.getDataName();
            String scenarioRelations=(String)dataScenario.get(data);
            if(scenarioRelations==null) {
                dataScenario.put(data, relation.getScenarioName());
            } else {
                dataScenario.put(data, scenarioRelations+","+relation.getScenarioName());
            }
        }
       
        for(Entry<String, String> entry: dataScenario.entrySet()) {
            String scenarioRelations=entry.getValue();
View Full Code Here

            else
                descriptions += descriptionVersion.getDescriptionId();
        }

        for (int i = 0; i < roleList.size(); i++) {
            ScenarioRoleRelation role = (ScenarioRoleRelation) roleList.get(i);
            if ("participant".equals(role.getRoleType()))
                participants += role.getRoleId() + ",";
            if ("observer".equals(role.getRoleType()))
                observers += role.getRoleId() + ",";
            if ("communicator".equals(role.getRoleType()))
                communicators += role.getRoleId() + ",";
        }

        ScenarioVersion version = new ScenarioVersion();
        version.setScenarioId(description.getScenarioId());
        version.setCommunicators(communicators);
View Full Code Here

            ArrayList roles = scenario.getRoles();
            int roleSize = scenario.getRoles().size();
            // 找出所有的参与者
            String participants = ",";
            for (int j = 0; j < roleSize; j++) {
                ScenarioRoleRelation role = (ScenarioRoleRelation) roles.get(j);
                if ("participant".equals(role.getRoleType())) {
                    participants = participants + role.getRoleId() + ",";
                }
            }
            for (int i = 0; i < descriptions.size(); i++) {
                Description description = (Description) descriptions.get(i);
                if (participants.indexOf("," + description.getRoleId() + ",") >= 0) {
View Full Code Here

TOP

Related Classes of cn.edu.pku.dr.requirement.elicitation.data.ScenarioRoleRelation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.