Validate If Branches Can Be Merged (EHI_CanBranchesBeMerged)

An opening ID is an entry point used to customize business logic. The Validate If Branches Can Be Merged (EHI_CanBranchesBeMerged) validates the merge of two branches. This enables you to create a consistent network.

Note: For more information about customization by business rules, see Installation and Setup: Customize: Behavior: Data Setup: Customization by Business Rules.

This page discusses:

General Information

This opening ID is invoked when you select the second branch of the two branches to be merged.

DefinitionDescription
PLM Opening IDEHI_CanBranchesBeMerged
Customization intent Validation
Execution contextClient

Input Objects

Input objects must be of the following types:

  • ThisObject: the first selected branch.
  • Parameters corresponds to the context object.
  • Validation

Context Object Parameters

Parameter NameTypeRead or WriteComments
FactTypeAny EKL typeType of ThisObject in the business rule body.
FirstBranchExtremity

(input)

SegmentExtremity ReadSegment's extremity of the first selected branch for the merge.
SecondBranchExtremity

(input)

SegmentExtremityReadSegment's extremity of the second selected branch for the merge.
SecondBranch

(input)

BranchReadSecond selected branch. This branch is merged with the first selected branch.

For more information, see Electrical 3D Part Design: Using Immersive Branch Definition: Manipulating Branches: Merging Branches.

Sample

The following sample illustrates how to validate the merge of two branches by checking the compatibility of their segments' separation code.

Let ExtThisBranch(SegmentExtremity)
Let ExtSecondBranch(SegmentExtremity)
Let SegThisBranch(Segment)
Let SegSecondBranch(Segment)
Let SepCodeSegOfThisBranch(String)
Let SecondBranch(Branch)

Set Validation = true


Set ExtThisBranch = Parameters.GetAttributeObject("FirstBranchExtremity")
Set ExtSecondBranch= Parameters.GetAttributeObject("SecondBranchExtremity")
Set SecondBranch = Parameters.GetAttributeObject("SecondBranch")

Set SegThisBranch= ExtThisBranch.Owner
Set SegSecondBranch = ExtSecondBranch.Owner

Set SepCodeSegOfThisBranch = SegThisBranch.Elec_Segreg

if(SepCodeSegOfThisBranch  == SegSecondBranch.Elec_Segreg)
{
	Validation = true
}
else
{
	Validation = false
	Notify("Merge cannot be done as branches  " + ThisObject.Name + " and " + SecondBranch.Name + " are not compatible")
}