Automatic text and format for a Work Instruction - Label

This document is intended to provide a detailed guide and example on how to customize a Business Rule for opening id DELWKIDMULabelProperties_BL_ID to automatically set the text and format for each Text Annotation (Label) work instruction created.

Introduction

As part of the work instruction definition, we use to create Text Annotation (Label) in order to provide additional information. If we want to change the OOTB behavior and automatically add some string or an attribute (OOTB or custom) value of the linked object in the text then it can be done using this business rule.

Version – 2022x FD03 (FP.CFA.2223), 2023x FD04 (FP.CFA.2333), 2024x FD04 (FP.CFA.2432), 2025x FD01 (FP.CFA.2506) & 2026x GA.

Pre-requisites:

Licenses –

  • PWD(Work Instruction Author): required to create Text Annotation work instructions (Label).

Disclaimer: Licenses mentioned above are as per 2022x, 2023x, 2024x, 2025x and 2026x documentation.

PLM Opening IDDELWKIDMULabelProperties_BL_ID
Customization intentExecution
Execution contextClient
Usage

Using this BL we can set the text and text format of the text annotation work instruction (Label).

 

Example: Automatically Copy the Eng. Item instance attributes - Torque and Title to Label and Format the Label Text.

In this example the OOTB Business Rule DELWKIDMULabelPropertiesForMfgItem.CATRule is customized to automatically:

  • add instance title
  • add custom attribute (Torque Value of the Eng. Item implemented by the corresponding Mfg. item linked to that operation).
  • set the text format.

This business rule gets invoked when you use Label from the Instructions Authoring section of the action bar.

Logical Flow

 

Business Rule

 

DELWKIDMULabelProperties_BL_ID_DELFmiFunctionReference.CATRule​​​​​​​

 

Detail Description:

Using this business rule we can set the annotation text with any text and/or any required attribute value added to it.

The format of that text can be modified by choosing the font Name, font Size, font Color, background Color, border Color, border Thickness, border Line Type , border End Type.

We can change the text or format automatically according to the required conditions.

Logic to get linked Eng. Item occurrence from Mfg. item occurrence

listOfProdOcc    = MfgItemOcc.AssignedProduct

oProdOcc         = listOfProdOcc[1]

From the input Mfg. item we can get the linked Eng. item occurrence.

Here, it is assumed that only one Eng. Item is implemented by the Mfg. Item. We can select one Eng. item from the list as per requirement.

Now, we need to get the Eng. item instance to get the Torque attribute value associated with it.

Logic to get Eng. Item instance from Eng. Item occurrence

oVPMInstance     = oProdOcc.Instance

We can get the required Eng. item instance from the occurrence using above method.

Logic to prepare the label text

//OutputTextList will contain lines of text within the Label we are defining           

OutputTextList.Append("EngItemInstance: " + oVPMInstance.PLM_ExternalID )

// the "DDE_Torque" attribute on the Eng Item Instance

strInstanceTorque  = oDDEVPMInstance.DDE_Torque

OutputTextList.Append( "Torque: " + strInstanceTorque ) //Add torque to label text 

Here we have added a string "EngItemInstance:" followed by Eng. item instance title to the label text.

On the next line in the label text we have added a string "Torque:" followed by the torque value in custom attribute "DDE_Torque".

In similar way we can add any other custom/OOTB attribute value to the label text.

Logic to set the background color according to the buildup type

if (BuildupType == "Current")
{
   BackgroundColor = "255, 255, 0"     //yellow color
}
else if (BuildupType == "Parallel")
{
   BackgroundColor = "255, 165, 0"    //orange color
}
else /* Previous */
{
   BackgroundColor = "0, 128, 255"    //light blue color
}

We have changed the background color according to the buildup type. Like it's yellow for buildup type "Current".

In similar way we can set the required background color by changing the RGB values (like "255, 255, 0" for yellow and "255, 255, 255" for white)

Logic to prepare the format for label

OutputFormatList.Append(List("fontName", "Arial.ttf")) //Default

OutputFormatList.Append(List("fontSize", "2"))

OutputFormatList.Append(List("fontColor", "0, 0, 255"))

OutputFormatList.Append(List("backgroundColor", BackgroundColor))

OutputFormatList.Append(List("borderColor", "0, 0, 255"))

Here we have changed the font size to 2 from 4, font color to blue from the default black.

We can set any font name, font color we need.

It is possible to change the border color, border thickness, border End Type as well.

Scenario

Consider a Turbo Fan Assembly and we need to create the work instructions of the Rotor installation.

In the process plan we have the loading operation named ‘LoadSpin’ to load the spinner object.

We need to create a text annotation (Label) for the ‘LoadSpin’ operation to display the details of spinner part.

 

Open the work instruction app and select the ‘LoadSpin’ operation from Operation sequencer as shown in above image.

Run Activate Views for Operation command to activate the view for ‘LoadSpin’ operation.

Once the view is activated the Label gets enabled.

To create a new label click on Label from the Instructions Authoring section of the action bar.

Select the spinner.

A new label gets created which contains Title and Torque value of the Eng. Item instance linked with the LoadSpin operation.

We can see the format of the text. We have set the background color to yellow (for buildup type: "Current") and the border color, font color to blue.

 

Similarly we can add any required text/ attribute value to the label or change its format automatically as per requirement by making use of this business rule.

Business Rule Deployment

The below page can be referred for Business Rule deployment.

How to Deploy Business Rule

For deployment using Data Setup app following Resource set and Opening needs to be used

Resource Set:

NotePlease note that the Resource set ID for this Business Rule opening is ‘Business Logic for Manufacturing Workplans, Systems and Operations (and not ‘Business Logic for Work Instructions’).

Opening:

Reference

Documentation: CATRule to Format Labels for Items​​​​​​​

Author

Author: @JJ 

Person of Contact - @JJ & @KA