Custom Component Interaction with Renderer

Digital Twin Action Metadata: Customizing Your DigitalTwin LWC Component Experience

As you dive deep into the immersive world of asset visualization with the RenderDraw Digital Twin package, we understand that customization is crucial. That's why we've introduced the Digital Twin Action custom metadata, allowing Salesforce administrators to tailor the DigitalTwin component's UI to meet specific business needs. Here's a quick guide to understanding and utilizing these settings:

Fields Overview:

  1. RenderDraw Digital Twin Action Name: Assign a unique name to the action. This will be your reference point.

  2. Display in Popup: Decide where you want the action to display. If set to true, your action will appear in a pop-up window that overlays the drawing. If set to false, it will be neatly integrated into a sidebar alongside the drawing.

  3. Flow Name: Input the API name of the Lightning flow you wish to display. This is typically a screen flow tailored for the chosen action.

  4. Action Label: Craft a user-friendly label. This is what your users will see in the action menu when they wish to invoke your flow.

  5. Action Icon: Define the look of your action using any Salesforce icon name. This icon will be showcased in the action menu.

  6. Order: Determine the sequence of your action in the context menu. A lower order will prioritize its position.

  7. RenderDraw Digital Twin Settings: Link your action to a specific digital twin setting. This dictates when your action will be displayed.

Interacting with the DigitalTwin Component:

When designing your custom flows, remember to set up string input parameters for both recordId and contextId. These parameters are essential to retrieve relevant data and ensure seamless interaction between the flow and the DigitalTwin component.

Advanced: Interacting with the Renderer

For those looking to create even more dynamic interactions, our renderer's public API is at your disposal. Utilize the following format to call any of our public API methods:

const payload = {
	contextId: this.contextId,
	name: "showToastNotification",
	parameters: {
		title: this.title,
		mode: this.mode,
		message: this.message,
		messageTemplate: this.messageTemplate,
		iconName: this.iconName,
		type: this.type,
		duration: this.duration,
		messageTemplateData: this.messageTemplateData
	}
};
publish(this.messageContext, CANVAS_INTERACTION_CHANNEL, payload);

To facilitate these interactions, ensure you have the necessary imports in your module:

import { publish, subscribe, MessageContext } from "lightning/messageService";
import CANVAS_INTERACTION_CHANNEL from "@salesforce/messageChannel/RDraw__Canvas_Interaction__c";

The RenderDraw Digital Twin package offers you a world of customizability. By understanding and leveraging the Digital Twin Action metadata, you can enhance the user experience and meet the unique demands of your business. Dive in, customize, and let your DigitalTwin component truly reflect your vision.

Last updated