Skip to content

Commit

Permalink
Fix #501
Browse files Browse the repository at this point in the history
  • Loading branch information
failys committed Jan 8, 2020
1 parent 0ab9ad5 commit ae931d3
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion cairis/sql/procs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4241,8 +4241,12 @@ begin
union
select 'role',r.name from role r,rolegoalrole_dependency rgr where rgr.environment_id = environmentId and rgr.depender_id = r.id and r.id = roleId
union
select 'role',r.name from role r,rolegoalrole_dependency rgr where rgr.environment_id = environmentId and rgr.depender_id = roleId and rgr.dependee.id and r.id = roleId
union
select 'goal',g.name from goal g,rolegoalrole_dependency rgr where rgr.environment_id = environmentId and rgr.dependency_id = g.id and rgr.depender_id = roleId
union
select 'goal',g.name from goal g,rolegoalrole_dependency rgr where rgr.environment_id = environmentId and rgr.dependency_id = g.id and rgr.dependee_id = roleId
union
select 'role',r.name from role r,rolegoalrole_dependency rgr where rgr.environment_id = environmentId and rgr.dependee_id = r.id and r.id = roleId
union
select 'role',r.name from role r,roletaskrole_dependency rtr where rtr.environment_id = environmentId and rtr.depender_id = r.id and r.id = roleId
Expand Down Expand Up @@ -7319,15 +7323,27 @@ begin
union
select rg.id id,e.name environment,hg.name goal_name,'role' goal_dim,'depender' ref_type, tg.name subgoal_name,'goal' subgoal_dim,'0',rg.rationale from rolegoalrole_dependency rg, role hg, goal tg, environment e where rg.environment_id = environmentId and rg.depender_id = hg.id and rg.dependency_id = tg.id and rg.environment_id = e.id and hg.id = roleId
union
select rg.id id,e.name environment,hg.name goal_name,'role' goal_dim,'depender' ref_type, tg.name subgoal_name,'goal' subgoal_dim,'0',rg.rationale from rolegoalrole_dependency rg, role hg, goal tg, environment e where rg.environment_id = environmentId and rg.depender_id = hg.id and rg.dependency_id = tg.id and rg.environment_id = e.id and rg.dependee_id = roleId
union
select rt.id id,e.name environment,hg.name goal_name,'role' goal_dim,'depender' ref_type, tg.name subgoal_name,'task' subgoal_dim,'0',rt.rationale from roletaskrole_dependency rt, role hg, task tg, environment e where rt.environment_id = environmentId and rt.depender_id = hg.id and rt.dependency_id = tg.id and rt.environment_id = e.id and hg.id = roleId
union
select rt.id id,e.name environment,hg.name goal_name,'role' goal_dim,'depender' ref_type, tg.name subgoal_name,'task' subgoal_dim,'0',rt.rationale from roletaskrole_dependency rt, role hg, task tg, environment e where rt.environment_id = environmentId and rt.depender_id = hg.id and rt.dependency_id = tg.id and rt.environment_id = e.id and rt.dependee_id = roleId
union
select ra.id id,e.name environment,hg.name goal_name,'role' goal_dim,'depender' ref_type, tg.name subgoal_name,'asset' subgoal_dim,'0',ra.rationale from roleassetrole_dependency ra, role hg, asset tg, environment e where ra.environment_id = environmentId and ra.depender_id = hg.id and ra.dependency_id = tg.id and ra.environment_id = e.id and hg.id = roleId
union
select ra.id id,e.name environment,hg.name goal_name,'role' goal_dim,'depender' ref_type, tg.name subgoal_name,'asset' subgoal_dim,'0',ra.rationale from roleassetrole_dependency ra, role hg, asset tg, environment e where ra.environment_id = environmentId and ra.depender_id = hg.id and ra.dependency_id = tg.id and ra.environment_id = e.id and ra.dependee_id = roleId
union
select gr.id id,e.name environment,hg.name goal_name,'goal' goal_dim,'dependee' ref_type, tg.name subgoal_name,'role' subgoal_dim,'0',gr.rationale from rolegoalrole_dependency gr, goal hg, role tg, environment e where gr.environment_id = environmentId and gr.dependency_id = hg.id and gr.dependee_id = tg.id and gr.environment_id = e.id and tg.id = roleId
union
select gr.id id,e.name environment,hg.name goal_name,'goal' goal_dim,'dependee' ref_type, tg.name subgoal_name,'role' subgoal_dim,'0',gr.rationale from rolegoalrole_dependency gr, goal hg, role tg, environment e where gr.environment_id = environmentId and gr.dependency_id = hg.id and gr.dependee_id = tg.id and gr.environment_id = e.id and gr.depender_id = roleId
union
select tr.id id,e.name environment,hg.name goal_name,'task' goal_dim,'dependee' ref_type, tg.name subgoal_name,'role' subgoal_dim,'0',tr.rationale from roletaskrole_dependency tr, task hg, role tg, environment e where tr.environment_id = environmentId and tr.dependency_id = hg.id and tr.dependee_id = tg.id and tr.environment_id = e.id and tg.id = roleId
union
select ar.id id,e.name environment,hg.name goal_name,'asset' goal_dim,'dependee' ref_type, tg.name subgoal_name,'role' subgoal_dim,'0',ar.rationale from roleassetrole_dependency ar, asset hg, role tg, environment e where ar.environment_id = environmentId and ar.dependency_id = hg.id and ar.dependee_id = tg.id and ar.environment_id = e.id and tg.id = roleId;
select tr.id id,e.name environment,hg.name goal_name,'task' goal_dim,'dependee' ref_type, tg.name subgoal_name,'role' subgoal_dim,'0',tr.rationale from roletaskrole_dependency tr, task hg, role tg, environment e where tr.environment_id = environmentId and tr.dependency_id = hg.id and tr.dependee_id = tg.id and tr.environment_id = e.id and tr.depender_id = roleId
union
select ar.id id,e.name environment,hg.name goal_name,'asset' goal_dim,'dependee' ref_type, tg.name subgoal_name,'role' subgoal_dim,'0',ar.rationale from roleassetrole_dependency ar, asset hg, role tg, environment e where ar.environment_id = environmentId and ar.dependency_id = hg.id and ar.dependee_id = tg.id and ar.environment_id = e.id and tg.id = roleId
union
select ar.id id,e.name environment,hg.name goal_name,'asset' goal_dim,'dependee' ref_type, tg.name subgoal_name,'role' subgoal_dim,'0',ar.rationale from roleassetrole_dependency ar, asset hg, role tg, environment e where ar.environment_id = environmentId and ar.dependency_id = hg.id and ar.dependee_id = tg.id and ar.environment_id = e.id and ar.depender_id = roleId;
else
select ga.id id,e.name environment,hg.name goal_name,'goal' goal_dim,rt.name ref_type,tg.name subgoal_name,'role' subgoal_dim,ga.alternative_id alternative_id,ga.rationale from goalrole_goalassociation ga, environment e, goal hg, reference_type rt, role tg where ga.environment_id in (select environment_id from composite_environment where composite_environment_id = environmentId) and ga.goal_id = hg.id and ga.ref_type_id = rt.id and ga.subgoal_id = tg.id and ga.environment_id = e.id
union
Expand Down

0 comments on commit ae931d3

Please sign in to comment.