You are here:
Define the Display Card Process
Define the process flows such as, how to load and store data, call functions and processes, and input validation within the app
Required Editions
| User Permissions Needed | |
|---|---|
| To customize CG Cloud offline mobile app: | Customizer, Developer |
-
Identify the process contract that corresponds to a UI page. Run this command in the Chrome
debugger console window:
Framework.getProcessContext().__spec.nameFor the “Your Day” page, the search returns this value:Application::CockpitProcess - Open Application::CockpitProcess.processflow.xml in VS Code based Modeler.
-
Add these process variables to the process context declarations.
ProcessContext::CardDisplay_DataLoaded- to indicate if data is loadedProcessContext::CardDisplay_SubComponentName- to store the subcomponent name.
The two bindings are defined in the UI contract. The prefixProcessContext::is a naming convention. The prefix defines that the binding variables are defined in the process context section of the process contract.<!-- Card: Display --> <Declaration name="CardDisplay_DataLoaded" type="DomBool" /> <Declaration name="CardDisplay_SubComponentName" type="String" /> -
In the
VIEWaction, registerLoadContainerData.TheCardDisplay_loadDataevent is defined in theLoadContainerDatanode in the UI contract. The process contract uses theCardDisplay_loadDataevent, to start a control flow when an event is triggered and calls theCardDisplay_loadDataaction.<!-- Card: Display--> <Event name="CardDisplay_loadData" action="CardDisplay_loadData" /> -
Define actions to fill the process context variables for
CardDisplay_DataLoadedandCardDisplay_SubComponentNameafter an event is triggered.- Define an action that the event directly triggers and set the data loaded flag. You can use a static message and set it directly to loaded.
-
To call, use
actionType=LOGICand theUtils.identityfunction provided by the framework.Theidentityfunction takes the boolean input value and writes it to theCardDisplay_DataLoadedprocess variable. -
Set the
TransitionTonode to call the next actionCardDisplay_setSubcomponentName. -
Set
CardDisplay_setSubcomponentNameto static until you define a list.
Note Create a list and then configure the message component to appear only if no records are available to show.The app shows the no data message component.
<!-- Card: Display START--> <Action name="CardDisplay_loadData" actionType="LOGIC" call="Utils.identity"> <Parameters> <Input name="value" value="1" type="Literal" /> </Parameters> <Return name="ProcessContext::CardDisplay_DataLoaded" /> <TransitionTo action="CardDisplay_setSubcomponentName"/> </Action><Action name="CardDisplay_setSubcomponentName" actionType="LOGIC" call="Utils.identity"> <Parameters> <Input name="value" value="CardNoDataMessageUiPlugin" type="Literal" /> </Parameters> <Return name="ProcessContext::CardDisplay_SubComponentName" /> </Action> <!-- Card: Display END--> -
Configure the
Utils.identityfunction to write the stringCardNoDataMessageUiPlugininto the process variable.The framework provides theUtils.identityfunction. The function takes the input parameter and returns it again to write it into the context variable. - Save your changes.
-
Build the contracts by running the command
sf modeler workspace buildor the alias commandsf mdl ws buildin your workspace. -
To test the changes, restart the simulator app.
Switch on the device toolbar to register the clicks on the UI in the simulation mode. In Mac, launch Developer Tools and then press command+shift+M.
Did this article solve your issue?
Let us know so we can improve!

