blob: 9a3904da8481ccb0d77991e8836933fa26aecc0d [file] [log] [blame]
// EPF - Process -> OpenCert - ARG
pre {
'Running ETL'.println();
//var arg:= new ARG!Case;
var processComponent : LIB!ProcessComponent;
processComponent = LIB!ProcessComponent.allInstances().first;
}
rule ProcessComponent2Case
transform l : LIB!ProcessComponent
to arg : ARG!Case{
guard : l.process.isTypeOf(LIB!DeliveryProcess)
var str = "Process = " + l.name;
str.println();
for (act in LIB!Activity.allInstances.select(act|act.isTypeOf(LIB!Activity))){//l.getTaskDescriptors(l.process.breakdownElement)) {
arg.argument.add(act.equivalent());
}
}
/*Transform Activity to Claim*/
rule Activity2Claim
transform act : LIB!Activity
to acl:ARG!Claim{
//guard :conSelection.contains(act.getContainerProcessComponent().id)
acl.id="G.Act"+act.id;
acl.name="Activity: "+ act.name;
acl.description="Activity: "+ act.name;
//act.name.println();
if(act.getTaskDescriptors(act.breakdownElement) <>null){
//var stra1 = "Activity name = " + act.name;
//stra1.println();
/*Task Descriptors -> linked to Activity*/
for(td in act.getTaskDescriptors(act.breakdownElement)){//act.breakdownElement
//var stra3 = "TD = " + td.name;
//stra3.println();
var cltd = new ARG!Claim;
var cxa = new ARG!AssertedInference;
cltd.id="G.Td"+td.id;
cltd.name="TaskDescriptor: "+td.name;
cltd.description=td.briefDescription;
//var stra4 = "Claim = " + cltd.name;
//stra4.println();
cxa.name = 'Act_Td';
cxa.source.add(acl);
cxa.target.add(cltd);
//var stra5 = "Source = " + cxa.source.name;
//stra5.println();
//var stra6 = "Target = " + cxa.target.name;
//stra6.println();
arg.argument.add(cxa);
arg.argument.add(cltd);
/*Role Descriptors -> attached to Task Descriptor*/
if(td.getTaskParticipants() <>null){
var ar = new ARG!ArgumentReasoning;
arg.argument.add(ar);
ar.id="Td.Rd"+td.id;
ar.name="Argument over role descriptors";
ar.description="Argument over role descriptors";
for(rd in td.getTaskParticipants()){
//var strr1 = "ArgumentReasoning = " + rd.id;
//strr1.println();
var ca = new ARG!Claim;
var iec = new ARG!InformationElementCitation;
var x = new ARG!AssertedInference;
var y = new ARG!AssertedEvidence;
//rd -> sub-claim
ca.name="Sub-Goal-Rd: "+rd.name;
ca.id="G"+td.id+".Rd"+rd.id;
ca.description=rd.briefDescription + rd.name + " should be certified";
// is certified.
//Asserted inference links Argument to Sub-Claim
x.name = 'Ard_Crd';
x.source.add(ar);
x.target.add(ca);
//rd -> solution
iec.name= rd.name+"'s certification will be available";
iec.id="E"+rd.id;
iec.description=rd.briefDescription+rd.name + "'s certification will be available";
iec.type = ARG!InformationElementType#Solution;
//iec.toBeInstantiated =false;
//Asserted Evidence Links Sub-claim to Solution
y.name = 'Crd_Erd';
y.source.add(ca);
y.target.add(iec);
arg.argument.add(x);
arg.argument.add(y);
arg.argument.add(ca);
arg.argument.add(iec);
}
//Asserted Inference Links Claim to Argument
var z = new ARG!AssertedInference;
z.name = "Cltd_Ard";
z.source.add(cltd);
z.target.add(ar);
arg.argument.add(z);
}
/* WorkProduct Descriptors -> attached to Task Descriptor */
if(td.getWorkProducts() <>null){
var arw = new ARG!ArgumentReasoning;
arg.argument.add(arw);
arw.name="Argument over work product descriptors";
arw.description="Argument over work product descriptors";
arw.id="Td.Wp"+td.id;
for(wp in td.getWorkProducts()){
var clw = new ARG!Claim;
var iew = new ARG!InformationElementCitation;
var xw = new ARG!AssertedInference;
var yw = new ARG!AssertedEvidence;
//wp -> sub-claim
clw.name="Sub-Goal-Wp: "+wp.name;
clw.id="G"+td.id+".Wp"+wp.id;
clw.description=wp.name + " is planned";
//var strr21 = "Claim = " + wp.name;
//strr21.println();
//Asserted inference links Argument to Sub-Claim
xw.name = 'Awp_Cwp';
xw.source.add(arw);
xw.target.add(clw);
//wp -> solution
iew.name= wp.name+" should be filled-in template";
iew.id="E"+wp.id;
iew.description= wp.name + " should be filled-in template"; //"E_"+wp.name +
iew.type = ARG!InformationElementType#Solution;
//iew.toBeInstantiated =false;
//var str3 = "solution = " + iew.name;
//str3.println();
// Asserted Evidence Links Sub-claim to Solution
yw.name = 'Cwp_Ewp';
yw.source.add(clw);
yw.target.add(iew);
arg.argument.add(xw);
arg.argument.add(yw);
arg.argument.add(clw);
arg.argument.add(iew);
}
var zw = new ARG!AssertedInference;
zw.name = "Cltd_Awp";
zw.source.add(cltd);
zw.target.add(arw);
arg.argument.add(zw);
}
/* Guidline -> attached to Task Descriptor */
if(td.getGuidelines() <> null){
for(gu in td.getGuidelines()){
var aguk = new ARG!ArgumentReasoning;
arg.argument.add(aguk);
aguk.id="Td.Gu."+td.id;
aguk.name="Argument over guidelines";
aguk.description="Argument over guidelines";
//var strr21 = "gui = " + gu.name;
//strr21.println();
var clgk = new ARG!Claim;
var iegk = new ARG!InformationElementCitation;
var xgk = new ARG!AssertedInference;
var ygk = new ARG!AssertedEvidence;
clgk.id="G"+td.id+".Gu"+gu.id;
clgk.name="Sub-Goal-Gu: "+gu.name;
clgk.description=gu.name + " is planned";
//Asserted inference links Argument to Sub-Claim
xgk.name = 'Agu_Cgu';
xgk.source.add(aguk);
xgk.target.add(clgk);
iegk.id="E"+gu.id;
iegk.name=gu.name+" should be followed according to the tempalte";
iegk.description= gu.name+" should be followed according to the tempalte";
iegk.type = ARG!InformationElementType#Solution;
//iegk.toBeInstantiated =false;
//var str3 = "solution = " + ieg.name;
//str3.println();
// Asserted Evidence Links Sub-claim to Solution
ygk.name = 'Cgu_Egu';
ygk.source.add(clgk);
ygk.target.add(iegk);
arg.argument.add(xgk);
arg.argument.add(ygk);
arg.argument.add(clgk);
arg.argument.add(iegk);
var zgk = new ARG!AssertedInference;
zgk.name = "Cltd_Agu";
zgk.source.add(cltd);
zgk.target.add(aguk);
arg.argument.add(zgk);
}
}
/* Checklist -> attached to Task Descriptor */
if(td.getChecklists() <>null){
for(che in td.getChecklists()){
var arc = new ARG!ArgumentReasoning;
arg.argument.add(arc);
arc.id="Td.Ch"+td.id;
arc.name="Argument over checklists";
arc.description="Argument over checklists";
//var strc1 = "checklist = " + che.name;
//strc1.println();
var cc = new ARG!Claim;
var icc = new ARG!InformationElementCitation;
var xc = new ARG!AssertedInference;
var yc = new ARG!AssertedEvidence;
//che -> sub-claim
cc.id="G"+td.id+".Ch"+che.id;
cc.name="Sub-Goal-Ch: "+che.name;
cc.description=che.briefDescription + "is planned";
//Asserted inference links Argument to Sub-Claim
xc.name = 'Ach_Cch';
xc.source.add(arc);
xc.target.add(cc);
//checklist -> solution
icc.id="E"+che.id;
icc.name= che.name+" should be completed or verified";
icc.description= che.briefDescription;
icc.type = ARG!InformationElementType#Solution;
//icc.toBeInstantiated =false;
//var strc4 = "solution = " + icc.name;
//strc4.println();
// Asserted Evidence Links Sub-claim to Solution
yc.name = 'Cch_Ech';
yc.source.add(cc);
yc.target.add(icc);
//yc.source.println();
arg.argument.add(xc);
arg.argument.add(yc);
arg.argument.add(cc);
arg.argument.add(icc);
//Asserted Inference Links Claim to Argument
var zc = new ARG!AssertedInference;
zc.name = "Cltd_Ach";
zc.source.add(cltd);
zc.target.add(arc);
arg.argument.add(zc);
}
}
/* Example -> attached to Task Descriptor */
if(td.getExamples() <>null){
for(exp in td.getExamples()){
var are = new ARG!ArgumentReasoning;
arg.argument.add(are);
are.id="Td.Ex"+td.id;
are.name="Argument over examples";
are.description="Argument over examples";
//var stre1 = "example = " + exp.name;
//stre1.println();
var ce = new ARG!Claim;
var iee = new ARG!InformationElementCitation;
var xe = new ARG!AssertedInference;
var ye = new ARG!AssertedEvidence;
//expample -> sub-claim
ce.id="G"+td.id+".Ex"+exp.id;
ce.name="Sub-Goal-Ex: "+exp.name;
ce.description=exp.briefDescription + exp.name + " is planned";
//Asserted inference links Argument to Sub-Claim
xe.name = 'Aex_Cex';
xe.source.add(are);
xe.target.add(ce);
//var stre3 = "AssertedInference = " + xe.target;
//stre3.println();
//expample -> solution
iee.id="E"+exp.id;
iee.name= exp.name; //+" should be completed or verified";
iee.description= exp.briefDescription + exp.name;
iee.type = ARG!InformationElementType#Solution;
//iee.toBeInstantiated =false;
//var stre4 = iee.name + " should be completed or verified";
//stre4.println();
// Asserted Evidence Links Sub-claim to Solution
ye.name = 'Cex_Eex';
ye.source.add(ce);
ye.target.add(iee);
//ye.source.println();
arg.argument.add(xe);
arg.argument.add(ye);
arg.argument.add(ce);
arg.argument.add(iee);
//Asserted Inference Links Claim to Argument
var ze = new ARG!AssertedInference;
ze.name = "Cltd_Aex";
ze.source.add(cltd);
ze.target.add(are);
arg.argument.add(ze);
}
}
/* ToolMentor -> attached to Task Descriptor */
if(td.task<>null){
var task=LIB!Task.allInstances.selectOne(task|task.id=td.task);
//var strt1 = "taskname " + task.name;
//strt1.println();
//var toolMentor;
for (tm in task.gettoolMentors()){
//var strt2 = "toolMentorId " + tm.name;
//strt2.println();
//act.participant.add(LIB!ToolMentor.allInstances.selectOne(tm|tm.id=toolMentorId).equivalent());
var art = new ARG!ArgumentReasoning;
art.name="Argument over tool mentors";
art.id="Td.Tm"+td.id;
art.description="Argument over tool mentors";
arg.argument.add(art);
//var strr1 = "S = " + art.name;
//strr1.println();
var clt = new ARG!Claim;
var iet = new ARG!InformationElementCitation;
var xt = new ARG!AssertedInference;
var yt = new ARG!AssertedEvidence;
clt.id="G"+td.id+".Tm"+tm.id;
clt.name="Sub-Goal-Tm: "+tm.name;
clt.description=tm.briefDescription + tm.name + " has to be qualified";
//var strr212 = "Claim = " + tm.name;
//strr212.println();
xt.name = 'Atm_Ctm';
xt.source.add(art);
xt.target.add(clt);
iet.id="E"+tm.id;
iet.name= tm.name+"’s qualifications";
iet.description="E_"+tm.name+ "’s qualifications"; //"E_"+wp.name +
iet.type = ARG!InformationElementType#Solution;
//iec.toBeInstantiated =false;
//var stre3 = "solution = " + iet.name;
//stre3.println();
yt.name = 'Ctm_Etm';
yt.source.add(clt);
yt.target.add(iet);
var ztm = new ARG!AssertedInference;
ztm.name = "Cltd_Atm";
ztm.source.add(cltd);
ztm.target.add(art);
//var stre5 = "AssertedInference = " + ztm.target.name;
//stre5.println();
//var stre6 = "AssertedInference = " + ztm.source.name;
//stre6.println();
arg.argument.add(xt);
arg.argument.add(yt);
arg.argument.add(clt);
arg.argument.add(iet);
arg.argument.add(ztm);
}
}
}
}
arg.argument.add(acl);
}
// operation Any getActivities(source : Set(LIB!BreadkDownElement)):Set(LIB!Activity) {
//var res = source.select(act|act.isTypeOf(LIB!Activity));
//}
operation Any getTaskDescriptors(source : Set(LIB!BreadkDownElement)):Set(LIB!TaskDescriptor){
return source.select(td|td.isTypeOf(LIB!TaskDescriptor));
td.id.println();
}
operation Any getTaskDescriptor(id:String):LIB!BreakdownElement{
return LIB!TaskDescriptor.allInstance.selectOne(td|td.id=id);
}
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));
}
for(a in self.additionallyPerformedBy){
res.add(LIB!RoleDescriptor.allInstances.selectOne(role|role.id=a));
//var strr3 = "a = " + a;
//strr3.println();
}
for(asi in self.assistedBy){
res.add(LIB!RoleDescriptor.allInstances.selectOne(role|role.id=asi));
//var strr4 = "asi = " + asi;
//strr4.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));
//var strr5 = "o = " + o;
//strr5.println();
}
return res;
}
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 getChecklists():Set(LIB!Checklist){
var res=new Set(LIB!Checklist);
for(che in self.checklist){
res.add(LIB!Checklist.allInstances.selectOne(checklist|checklist.id=che));
//var strr4 = "check = " + checklist;
//strr4.println();
}
return res;
}
operation LIB!TaskDescriptor getExamples():Set(LIB!Example){
var res=new Set(LIB!Example);
for(exp in self.example){
res.add(LIB!Example.allInstances.selectOne(example|example.id=exp));
//var stre6 = "expl = " + exp;
//stre6.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!ToolMentor getTool():LIB!Tool{
return LIB!Tool.allInstances.selectOne(tool|tool.toolMentor.contains(self.id));
}
post{
"End of transformation".println();
}