// EPF -> LIB;CONF | |
// OpenCert -> ART;PRO;AA | |
pre { | |
'Running ETL'.println(); | |
var processComponent : LIB!ProcessComponent; | |
processComponent = LIB!ProcessComponent.allInstances().first; | |
var name = "ProcessComponent: "+processComponent.name; | |
name.println(); | |
} | |
//PC to PM, AM | |
rule ProcessComponent2ProcessModel | |
transform pc : LIB!ProcessComponent | |
to process : PRO!ProcessModel,artm:ART!ArtefactModel{ | |
guard : pc.process.isTypeOf(LIB!DeliveryProcess) | |
process.name="ProcessComponent: "+pc.name; | |
process.id="pc"+pc.id; | |
process.description="ProcessComponent: "+pc.briefDescription; | |
artm.id="pc"+pc.id; | |
artm.name="ProcessComponent: "+pc.name; | |
artm.description="ProcessComponent"+pc.briefDescription; | |
var strar = "ArtefactModel: " + artm.name; | |
//strar.println(); | |
var strp = "ProcessComponent: " + process.name; | |
//strp.println(); | |
for (cap in LIB!CapabilityPattern.allInstances()){ | |
process.ownedActivity.add(cap.equivalent()); | |
} | |
} | |
rule CapabilityPattern2Activity | |
transform cap : LIB!CapabilityPattern | |
to act:PRO!Activity{ | |
act.id="cap"+cap.id; | |
act.name="CapabilityPattern: " +cap.name; | |
act.description=cap.briefDescription; | |
var strcap = "CapabilityPattern: " + cap.name; | |
//strcap.println(); | |
if(cap.breakdownElements.selectOne(ite|ite.isTypeOf(LIB!Iteration))<>null){ | |
for (ite in cap.breakdownElements.selectOne(ite|ite.isTypeOf(LIB!Iteration))){ | |
var strite = "Iteration: " + ite.name; | |
//strite.println(); | |
var actt = new PRO!Activity; | |
actt.id="ite"+ite.id; | |
actt.name="Iteration: "+ite.name; | |
actt.description="Iteration: "+ite.briefDescription; | |
act.subActivity.add(actt); | |
if(ite.getMilestones(ite.breakdownElements) <>null){ | |
for(mil in ite.getMilestones(ite.breakdownElements)){ | |
var strmil = "Milestone: " + mil.name; | |
//strmil.println(); | |
var actmil = new PRO!Activity; | |
actmil.id="mil"+ite.id; | |
actmil.name="Milestone: "+mil.name; | |
actmil.description="Milestone"+mil.briefDescription; | |
actt.subActivity.add(actmil); | |
} | |
} | |
if(ite.getTeamProfile(ite.breakdownElements) <>null){ | |
for(tp in ite.getTeamProfile(ite.breakdownElements)){ | |
var strmil = "TeamProfile: " + tp.name; | |
//strmil.println(); | |
var orgtp = new PRO!Organization; | |
orgtp.id="tp"+tp.id; | |
orgtp.name="TeamProfile: "+tp.name; | |
orgtp.description="TeamProfile"+tp.briefDescription; | |
process.ownedParticipant.add(orgtp); | |
} | |
} | |
} | |
} | |
if(cap.breakdownElements.select(ph|ph.isTypeOf(LIB!Phase))<>null){ | |
for (ph in cap.breakdownElements.select(ph|ph.isTypeOf(LIB!Phase))){ | |
var strph = "Phase: " + ph.name; | |
//strph.println(); | |
var act1 = new PRO!Activity; | |
act1.id="Ph"+ph.id; | |
act1.name="Phase: "+ph.name; | |
act1.description="Phase"+ph.briefDescription; | |
act.subActivity.add(act1); | |
if(ph.getActivities(ph.breakdownElements)<>null){ | |
for(act in ph.getActivities(ph.breakdownElements)){ | |
var strph = "Activity: " + act.name; | |
//strph.println(); | |
var act2 = new PRO!Activity; | |
act2.id="Ac"+act.id; | |
act2.name="Activity: "+ act.name; | |
act2.description="Activity: "+ act.briefDescription; | |
act1.subActivity.add(act2); | |
if(act.getTaskDescriptors(act.breakdownElements) <>null){ | |
var stra1 = "Task name: " + act.name; | |
//stra1.println(); | |
for (td in act.getTaskDescriptors(act.breakdownElements)){ | |
var stratd = "TaskDescriptor: " + td.name; | |
//stratd.println(); | |
var actd = new PRO!Activity; | |
actd.id="Td"+td.id; | |
actd.name="TaskDescriptor: "+td.name; | |
actd.description="TaskDescriptor"+td.briefDescription; | |
act2.subActivity.add(actd); | |
/*Role Descriptors -> attached to Task Descriptor*/ | |
if(td.getTaskParticipants() <> null){ | |
var strrrd1 = " td.name: " + td.name; | |
//strrrd1.println(); | |
for(rd in td.getTaskParticipants()){ | |
var strrd = "Role Descriptor: " + rd.name; | |
//strrd.println(); | |
var pr = new PRO!Person; | |
pr.id="Rd "+rd.id; | |
pr.name="RoleDescriptor: "+rd.name; | |
pr.description="RoleDescriptor: "+rd.briefDescription; | |
process.ownedParticipant.add(pr); | |
// WorkProduct Descriptors -> attached to Task Descriptor | |
if(td.getWorkProducts() <>null){ | |
for(wp in td.getWorkProducts()){ | |
var strr2 = "WorkProduct Descriptor: " + wp.name; | |
//strr2.println(); | |
var artd = new ART!ArtefactDefinition; | |
//var art = new ART!Artefact; | |
artd.id="Wp"+wp.id; | |
artd.name="WorkProductDescriptor: "+wp.name; | |
artd.description="WorkProductDescriptor: "+wp.briefDescription; | |
artm.artefact.add(artd); | |
var art = new ART!Artefact; | |
art.id="Wp"+wp.id; | |
art.name="WorkProductDescriptor: "+wp.name; | |
art.description="WorkProductDescriptor: "+wp.briefDescription; | |
//artm.artefact.add(art); | |
} | |
} | |
if(td.Task<>null){ | |
var task = REQ!Task.allInstances.selectOne(task|task.name=td.name); | |
var strrtask = "Task: " + task.name; | |
//strrtask.println(); | |
//Guideline -> attached to Tasks | |
if(task.guidelines <> null){ | |
for(gu in task.guidelines){ | |
var strrgu = "Guideline: " + gu.name; | |
//strrgu.println(); | |
var tech = new PRO!Technique; | |
tech.id="gu"+gu.id; | |
tech.name="Guideline: "+gu.name; | |
tech.description="Guideline: "+gu.briefDescription; | |
process.ownedTechnique.add(tech); | |
} | |
} | |
// ToolMentor -> attached to Task | |
if(task.toolMentors <> null){ | |
for(tm in task.toolMentors){ | |
var strrtm = "toolMentor: " + tm.name; | |
//strrtm.println(); | |
var tool = new PRO!Tool; | |
tool.id="gu"+tm.id; | |
tool.name="ToolMentor: "+tm.name; | |
tool.description=" ToolMentor: "+tm.briefDescription; | |
process.ownedParticipant.add(tool); | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
//Getting practices | |
if(REQ!Practice.allInstances()<>null){//.selectOne(pra|pra.isTypeOf(LIB!Practice))<>null){ | |
for (pra in REQ!Practice.allInstances()){//.selectOne(pra|pra.isTypeOf(LIB!Practice))){ | |
var strrpra = "Practices: " +pra.name; | |
//strrpra.println(); | |
var techp = new PRO!Technique; | |
techp.id="pra"+pra.id; | |
techp.name="Practice: "+pra.name; | |
techp.description="Practice: "+pra.briefDescription; | |
process.ownedTechnique.add(techp); | |
/* for(sp in pra.subPractices){ | |
var strrpra = "Sub Practices: " +sp.name; | |
//strrpra.println(); | |
var techsp = new PRO!Technique; | |
techsp.id="pra"+sp.id; | |
techsp.name="Sub-Practice: "+sp.name; | |
techsp.description="Practice: "+sp.briefDescription; | |
process.ownedTechnique.add(techsp); | |
} */ | |
} | |
} | |
if(REQ!RoleSet.allInstances.selectOne(roleset|roleset.isTypeOf(LIB!RoleSet))<>null){ | |
for (roleset in REQ!RoleSet.allInstances.selectOne(roleset|roleset.isTypeOf(LIB!RoleSet))){ | |
var strr = "RoleSet: " +roleset.name; | |
//strr.println(); | |
var org = new PRO!Organization; | |
org.name="RoleSet: "+roleset.name; | |
org.id="rs"+roleset.id; | |
org.description="RoleSet: "+roleset.briefDescription; | |
process.ownedParticipant.add(org); | |
} | |
} | |
}//Rule End | |
operation Any getActivities(source : Set(LIB!BreakdownElement)):Set(LIB!Activity){ | |
return source.select(act|act.isTypeOf(LIB!Activity)); | |
//act.id.println(); | |
} | |
operation Any getTaskDescriptors(source : Set(LIB!BreakdownElement)):Set(LIB!TaskDescriptor){ | |
return source.select(td|td.isTypeOf(LIB!TaskDescriptor)); | |
//td.id.println(); | |
} | |
operation LIB!TaskDescriptor getTaskParticipants():Set(LIB!RoleDescriptor){ | |
var res=new Set(LIB!RoleDescriptor); | |
// performedPrimarilyBy; additionallyPerformedBy; assistedBy | |
for(p in self.performedPrimarilyBy){ | |
res.add(LIB!RoleDescriptor.allInstances.selectOne(role|role.id=p.id)); | |
} | |
for(a in self.additionallyPerformedBy){ | |
res.add(LIB!RoleDescriptor.allInstances.selectOne(role|role.id=a.id)); | |
//var strr3 = "a = " + a; | |
//strr3.println(); | |
} | |
for(asi in self.assistedBy){ | |
res.add(LIB!RoleDescriptor.allInstances.selectOne(role|role.id=asi.id)); | |
//var strr4 = "asi = " + asi; | |
//strr4.println(); | |
} | |
return res; | |
} | |
operation LIB!RoleDescriptor getSkills(name:String):Sequence{ | |
var rolesDescriptions : Sequence = ROL!RoleDescription.allInstances(); | |
} | |
operation LIB!TaskDescriptor getGuidelines():Set(LIB!Guideline){ | |
var res=new Set(LIB!Guideline); | |
for(gu in self.guideline){ | |
res.add(LIB!Guideline.allInstances.selectOne(guideline|guideline.id=gu)); | |
//var strr6 = "guid = " + gu; | |
//strr6.println(); | |
} | |
return res; | |
} | |
operation LIB!TaskDescriptor getWorkProducts():Set(LIB!WorkProductDescriptor){ | |
var res=new Set(LIB!WorkProductDescriptor); | |
// externalInput; optionalInput; mandatoryInput; output | |
for(ei in self.externalInput){ | |
res.add(LIB!WorkProductDescriptor.allInstances.selectOne(workProduct|workProduct.id=ei)); | |
//var strr6 = "ei = " + ei; | |
//strr6.println(); | |
} | |
for(oi in self.optionalInput){ | |
res.add(LIB!WorkProductDescriptor.allInstances.selectOne(workProduct|workProduct.id=oi)); | |
//var strr3 = "oi = " + oi; | |
//strr3.println(); | |
} | |
for(mi in self.mandatoryInput){ | |
res.add(LIB!WorkProductDescriptor.allInstances.selectOne(workProduct|workProduct.id=mi)); | |
//var strr4 = "mi = " + mi; | |
//strr4.println(); | |
} | |
for(o in self.output){ | |
res.add(LIB!WorkProductDescriptor.allInstances.selectOne(workProduct|workProduct.id=o.id)); | |
//var strr5 = "o = " + o; | |
//strr5.println(); | |
} | |
return res; | |
} | |
operation LIB!Task gettoolMentors():Set(LIB!ToolMentor){ | |
var res=new Set(LIB!ToolMentor); | |
for(tm in self.toolMentor){ | |
res.add(LIB!ToolMentor.allInstances.selectOne(toolMentor|toolMentor.id=tm)); | |
//var strt6 = "TM = " + tm; | |
//strt6.println(); | |
} | |
return res; | |
//res.printlin(); | |
} | |
operation LIB!Task gettoolMentors():Set(LIB!ToolMentor){ | |
var res=new Set(LIB!ToolMentor); | |
for(tm in self.toolMentor){ | |
res.add(LIB!ToolMentor.allInstances.selectOne(toolMentor|toolMentor.id=tm)); | |
} | |
return res; | |
//res.printlin(); | |
} | |
operation LIB!Task getPractices():Set(REQ!Practice){ | |
var res=new Set(REQ!Practice); | |
for(sp in self.subPractices){ | |
res.add(REQ!Practice.allInstances.selectOne(subPractices|subPractices.id=sp)); | |
//var strt6 = "Practice " + sp; | |
//strt6.println(); | |
} | |
return res; | |
//res.printlin(); | |
} | |
operation Any getMilestones(source : Set(LIB!BreakdownElement)):Set(LIB!Milestone){ | |
return source.select(mil|mil.isTypeOf(LIB!Milestone)); | |
//mil.id.println(); | |
} | |
operation Any getTeamProfile(source : Set(LIB!BreakdownElement)):Set(LIB!TeamProfile){ | |
return source.select(tp|tp.isTypeOf(LIB!TeamProfile)); | |
//tp.id.println(); | |
} | |
post{ | |
"End of transformation".println(); | |
} | |