Lifecycle Operation Propagation (compute_DefaultPropagationScope)

An opening ID is an entry point used to customize business logic. Lifecycle Operation Propagation (compute_DefaultPropagationScope) allows you to define whether an operation can be applied on objects according to a context.

Note: For more information about customization by business rules, see Customization by Business Rules.

This page discusses:

General Information

This opening ID is a compute opening. For more information, see Compute Openings.

This opening ID is integrated to the Duplicate, Advanced Duplicate, New Branch, and Advanced New Branch commands in web app. It is also integrated in the New Branch command in desktop apps.

Recommendation:
  • To customize the behavior of the commands in web apps, use the Lifecycle Operation Propagation (compute_DefaultPropagationScope) business logic. This business logic is available both on the cloud and on premises, and for all object types.

    Use the Operation Propagation (PLMAuthoringDefaultPropagationScope) business logic for desktop apps only.

  • To ensure a consistent behavior on the cloud and on premises, implement both business logics.

    In that case, Lifecycle Operation Propagation (compute_DefaultPropagationScope) business logic is used for the commands in web apps, and the New Branch command in desktop apps.

For more information, see Operation Propagation (PLMAuthoringDefaultPropagationScope).

You can specify whether objects are copied or reused:

  • During a Duplicate or New Branch operation, the object is copied if the opening ID execution returns true. Otherwise, the object is reused in the resulting duplicate or branch.
  • During an Advanced Duplicate or Advanced New Branch operation, you can automatically specify the reuse action for the object, instead of duplicate. Users can modify this default action afterward.

Definition Description
PLM Opening ID compute_DefaultPropagationScope
Environment Availability:
  • On the cloud
  • On premises
Customization intent Computation
Execution context Server

Input Objects

Input objects must be of the following types:

  • ThisObject
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter Names Types Read/Write Comments
OperationId String Read

Parameter used to identify the context execution. The value must be Cloning.

OperationDetail String Read

The possible OperationDetail values are:

  • "None" for Duplicate and Advanced Duplicate operations.
  • "NewEvolution" for New Branch and Advanced New Branch operation.

RootContext DatabaseObjectType Read For each object, the parent of the highest level among the selected objects.
Propagate Boolean Write The result of opening ID execution. If true, the object is copied. If false, the object is reused.

Sample

The following example shows how to specify that:

  • During a Duplicate or New Branch operation, objects that are not in the same collaborative space as their root context are excluded from the scope of the operation, and are reused.
  • During an Advanced Duplicate or Advanced New Branch operation, objects that are not in the same collaborative space as their root context are assigned the reuse action instead of duplicate or branch.
Note: This corresponds to the default implementation of Operation Propagation (PLMAuthoringDefaultPropagationScope) business logic for desktop apps. For more information, see Operation Propagation (PLMAuthoringDefaultPropagationScope).

Let FromValidatedObject(PLMEntity)
Let ProjectContext (STRING)
Let ProjectIntent (STRING)
Let ProjectObject (STRING)

Let DefaultPropagation(BOOLEAN)

/* variable set-up */

ProjectContext = ""
ProjectIntent =  ""
ProjectObject =  ""
FromValidatedObject=NULL

DefaultPropagation=true

/* checking calling context */

if ( Parameters->HasAttribute("OperationId") == true ) {
    Trace (1, "ENOST_OperationValidation ", Parameters->GetAttributeString("OperationId"))
}

/* reading projects info */

if ( Parameters->HasAttribute("Project") == true ) {
    ProjectContext=Parameters->GetAttributeString("Project")
}

if ( Parameters->HasAttribute("RootContext") == true ) {
    set FromValidatedObject=Parameters->GetAttributeObject("RootContext")
}

if ( FromValidatedObject<>NULL) { 
    if ( FromValidatedObject->HasAttribute("project") ==true ) {
        ProjectIntent=FromValidatedObject->GetAttributeString("project")
    }
    if (ProjectIntent==NULL) { ProjectIntent="" }
}

if ( ProjectIntent=="" ) {
    ProjectIntent=ProjectContext
}
  
ProjectObject=ThisObject.project

/* across projects, object is not valid for a default operation propagation */

if ( ProjectObject <> ProjectIntent ) {
    DefaultPropagation=false
}

/* output Propagation status */

if ( Parameters->HasAttribute("Propagate") == true ) {
    Parameters->SetAttributeBoolean("Propagate",DefaultPropagation)
}