Skip to content

Commit

Permalink
Remove redundant suffix from "Create..." workflows of root objects.
Browse files Browse the repository at this point in the history
Change-Id: I7f596f9a19459acaffdaa0c12542a6e5a47b02a5
Closes-Bug: #1770567
  • Loading branch information
danieljasinski committed Jun 18, 2018
1 parent 3970a78 commit ee55942
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -54,7 +54,8 @@ fun createWorkflows(clazz: ObjectClass, refs: List<ObjectClass>, schema: Schema)
fun createWorkflow(clazz: ObjectClass, parentClazz: ObjectClass, parentsInModel: Int, hasRootParents: Boolean, refs: List<ObjectClass>, schema: Schema): WorkflowDefinition {

val nonRootParents = parentsInModel > 0
val addInParent = (hasRootParents || parentsInModel > 1) && ! parentClazz.isPolicyManagement
val addInParent = (hasRootParents || parentsInModel > 1) &&
! parentClazz.isPolicyManagement && ! parentClazz.isDefaultRoot
val addGlobal = (parentClazz.isDefaultRoot && nonRootParents) || parentClazz.isPolicyManagement

val workflowBaseName = "Create " + if (addGlobal) "global " else ""
Expand Down

0 comments on commit ee55942

Please sign in to comment.