You are here:
Create a Cockpit Card to Show the Competitor Rate Chart
The Competitor Rate chart on the Your Day screen of the CG offline mobile app shows the percentage of competitor products from the displayed products in a store. In the Modeler workspace, integrate the UIPluginV2 contract into the cockpit card to show the Competitor Rate chart.
Required Editions
| Available in: Professional, Enterprise, and Unlimited Editions that have Consumer Goods Cloud enabled |
| User Permissions Needed | |
|---|---|
| To create a cockpit card to show the competitor rate chart: | CG Cloud Developer, Admin |
-
In your Modeler workspace, add a CardContainer control called
CardDisplayReportto the Card Area in the Application_CockpitUI.userinterface.xml contract.<!-- Reporting Card START --> <CardContainer name="CardDisplayReport"> <Bindings> <Resource target="Title" type="Label" id="ReportingDislpayCardTitle" defaultLabel="Displays" /> <Resource target="Information" type="Label" id="ReportingDisplayCardInformation" defaultLabel="Competitor Rate" /> <Binding target="IsReadyToLoad" type="Text" binding="ProcessContext::CardDisplayReport_DataLoaded" bindingMode="ONE_WAY" /> </Bindings> <VisibilityRoles allRoles="true" /> <Events> <LoadContainerData event="CardDisplayReport_loadData" /> </Events> <UIPluginV2 name="MyCardDisplayReportUiPluginV2" uiPlugin="MyCardDisplayReportUiPluginV2"> <Bindings> <Binding target="competitorRate" type="Text" binding="ProcessContext::CardDisplayReport_CompetitorRate" bindingMode="ONE_WAY" /> </Bindings> </UIPluginV2> </CardContainer> <!-- Reporting Card END --> -
Define the declarations for Competitor Rate Cockpit Card in the
Application_CockpitProcess.processflow.xml contract.
<!-- Card DisplayReport --> <Declaration name="CardDisplayReport_DisplayList" type="LoMyDisplays"/> <Declaration name="CardDisplayReport_DataLoaded" type="DomBool"/> <Declaration name="CardDisplayReport_CompetitorRate" type="DomDecimal" /> -
To load data to the report, configure Event handler in the ShowCockpit action section
of the Application_CockpitProcess.processflow.xml contract.
<!-- Card: DisplayReport --> <Event name="CardDisplayReport_loadData" action="CardDisplayReport_loadData" /> -
To load the list object and calculate the competitor rate, define the required actions
in the Application_CockpitProcess.processflow.xml contract.
<!-- Card: Display Reports START--> <Action name="CardDisplayReport_loadData" actionType="LOAD" type="LoMyDisplays" > <Return name="ProcessContext::CardDisplayReport_DisplayList" /> <TransitionTo action="CardDisplayReport_getCompetitorRate"/> </Action> <Action name="CardDisplayReport_getCompetitorRate" actionType="LOGIC" call="ProcessContext::CardDisplayReport_DisplayList.myGetCompetitorRate"> <Parameters/> <Return name="ProcessContext::CardDisplayReport_CompetitorRate" /> <TransitionTo action="CardDisplayReport_setDataLoaded"/> </Action> <Action name="CardDisplayReport_setDataLoaded" actionType="LOGIC" call="Utils.identity"> <Parameters> <Input name="value" value="1" type="Literal" /> </Parameters> <Return name="ProcessContext::CardDisplayReport_DataLoaded" /> </Action> <!-- Card: Display Reports END→ - Save your changes.
Did this article solve your issue?
Let us know so we can improve!

