7575-- NanoflowCommons.GetCurrentLocation JS action (the NanoflowCommons marketplace
7676-- module is not installed in testdata; install it to clear these). No
7777-- StorageLoadException; project loads cleanly.
78- -- Note : FT extension — page actionbuttons call server-side microflows (FT.ACT_CheckIn,
79- -- FT.ACT_Dispatch_Complete) rather than nanoflows-with-params, working around a
80- -- known mxcli bug where a page nanoflow parameter mapping crashes mx check
81- -- ("Parameter property ... null"). Offline nanoflows remain defined for Task 4.
78+ -- Note : FT extension — page actionbuttons call the offline nanoflows WITHOUT
79+ -- arguments (NF_FT_CheckIn / NF_FT_CompleteOffline were made parameterless,
80+ -- retrieving the order themselves). This works around a known mxcli bug where
81+ -- a page nanoflow parameter mapping crashes mx check ("Parameter property ...
82+ -- null"); the executor root cause is fixed (qualified ParameterQualifiedName)
83+ -- with a regression test, but CE0115 arg matching still needs a Studio Pro BSON
84+ -- sample, so no-arg calls are used here. See cmd_pages_builder_v3.go TODO.
8285--
8386-- Edge cases covered:
8487-- Domain : self-ref association, cross-module association,
@@ -2599,10 +2602,21 @@ create or modify microflow FT.DS_RelevantArticles
25992602-- SYNCHRONIZE lands in MDL, add `synchronize $Object;` after the relevant commits.
26002603-- ============================================================================
26012604
2602- -- NF_FT_CheckIn: capture GPS on arrival at site, store as CheckInRecord.
2603- -- New activities: CALL JAVASCRIPT ACTION (device GPS).
2605+ -- NF_FT_CheckIn: capture GPS on arrival at site.
2606+ -- New activity: CALL JAVASCRIPT ACTION (device GPS) + connectivity guard.
2607+ --
2608+ -- This nanoflow is PARAMETERLESS and is invoked from page actionbuttons WITHOUT
2609+ -- arguments — a workaround for an mxcli bug where a page actionbutton calling a
2610+ -- nanoflow *with parameters* writes an invalid parameter mapping that crashes
2611+ -- `mx check` (root cause fixed + CE0115 TODO in cmd_pages_builder_v3.go; the
2612+ -- microflow path is unaffected).
2613+ -- SCOPE: because a no-arg nanoflow receives no object, this demo focuses on the
2614+ -- client-side CALL JAVASCRIPT ACTION pattern and reports the captured GPS via a
2615+ -- message. In production (once the page-nanoflow parameter bug is fully resolved)
2616+ -- restore the signature to ($Order: FT.DispatchOrder), pass (Order: $currentObject)
2617+ -- from the button, and create the FT.CheckInRecord + set Status = OnSite here.
26042618create or modify nanoflow FT.NF_FT_CheckIn
2605- ($Order: FT.DispatchOrder )
2619+ ()
26062620 folder 'Mobile'
26072621{
26082622 -- CALL JAVASCRIPT ACTION: invokes a NanoflowCommons device API client-side.
@@ -2617,34 +2631,20 @@ create or modify nanoflow FT.NF_FT_CheckIn
26172631 show message 'Could not obtain GPS location. Check device permissions.' type warning;
26182632 return;
26192633 }
2620-
2621- $Record = create FT.CheckInRecord (
2622- Latitude = $Location/Latitude,
2623- Longitude = $Location/Longitude,
2624- CheckedInAt = '[%CurrentDateTime%]',
2625- FT.CheckInRecord_DispatchOrder = $Order
2626- );
2627- commit $Record;
2628-
2629- change $Order (Status = FT.DispatchStatus.OnSite);
2630- commit $Order;
2634+ show message 'Checked in at current location.' type information;
26312635 return;
26322636}
26332637/
26342638
2635- -- NF_FT_CompleteOffline: FieldTech marks order complete while offline.
2636- -- Changes persist locally; the offline runtime pushes to server when back online.
2639+ -- NF_FT_CompleteOffline: FieldTech marks completion while offline.
2640+ -- Parameterless for the same page-nanoflow workaround as NF_FT_CheckIn above.
2641+ -- SCOPE: demonstrates the connectivity-guard offline pattern; in production
2642+ -- (signature ($Order: FT.DispatchOrder)) it would set Status = Completed and
2643+ -- commit the passed order.
26372644create or modify nanoflow FT.NF_FT_CompleteOffline
2638- ($Order: FT.DispatchOrder, $Notes: string )
2645+ ()
26392646 folder 'Mobile'
26402647{
2641- change $Order (
2642- Status = FT.DispatchStatus.Completed,
2643- CompletedAt = '[%CurrentDateTime%]',
2644- SiteNotes = $Notes
2645- );
2646- commit $Order;
2647-
26482648 -- Connectivity guard: report sync intent based on connection state.
26492649 -- (When SYNCHRONIZE is implemented, call it in the online branch.)
26502650 $IsOnline = call javascript action NanoflowCommons.IsConnectedToServer ();
@@ -2790,31 +2790,13 @@ create or modify business event service FT.FieldWorkEvents
27902790-- NOTE on page actionbuttons calling nanoflows: mxcli currently has a bug where
27912791-- a page actionbutton that calls a NANOFLOW *with parameters* writes an invalid
27922792-- parameter mapping (the Parameter reference is left unresolved), which makes
2793- -- `mx check` fail to load the project. The microflow path is unaffected.
2794- -- Until that bug is fixed (tracked separately), these page buttons call
2795- -- server-side MICROFLOWS instead. The offline nanoflows (FT. NF_FT_CheckIn,
2796- -- NF_FT_CompleteOffline, NF_FT_LoadOrders) remain defined above and demonstrate
2797- -- the CALL JAVASCRIPT ACTION + connectivity-guard offline pattern (Task 4).
2793+ -- `mx check` fail to load the project (root cause fixed + CE0115 TODO in
2794+ -- cmd_pages_builder_v3.go). As a workaround the buttons below call the offline
2795+ -- nanoflows WITHOUT arguments; those nanoflows (NF_FT_CheckIn / NF_FT_CompleteOffline)
2796+ -- were made parameterless and retrieve the order to act on themselves. The
2797+ -- CALL JAVASCRIPT ACTION + connectivity-guard offline pattern (Task 4) is intact .
27982798-- ============================================================================
27992799
2800- -- FT.ACT_CheckIn: server-side check-in (microflow mirror of NF_FT_CheckIn).
2801- -- Records arrival and moves the order to OnSite. The nanoflow variant captures
2802- -- GPS on-device; this server variant is what the page buttons invoke.
2803- create or modify microflow FT.ACT_CheckIn
2804- ($Order: FT.DispatchOrder)
2805- folder 'Dispatch'
2806- {
2807- $Record = create FT.CheckInRecord (
2808- CheckedInAt = '[%CurrentDateTime%]',
2809- FT.CheckInRecord_DispatchOrder = $Order
2810- );
2811- commit $Record;
2812- change $Order (Status = FT.DispatchStatus.OnSite);
2813- commit $Order;
2814- return;
2815- }
2816- /
2817-
28182800-- FT.DispatchQueue: FieldTech mobile task list.
28192801-- New patterns:
28202802-- url: 'dispatch-queue' → page slug for deep linking (absent from baseline)
@@ -2841,7 +2823,7 @@ create or replace page FT.DispatchQueue (
28412823 column colActions (caption: 'Actions', ShowContentAs: customContent, ColumnWidth: manual, Size: 160) {
28422824 actionbutton btnCheckIn (
28432825 caption: 'Check In',
2844- action: microflow FT.ACT_CheckIn (Order: $currentObject) ,
2826+ action: nanoflow FT.NF_FT_CheckIn ,
28452827 buttonstyle: primary
28462828 )
28472829 actionbutton btnComplete (
@@ -2883,12 +2865,12 @@ create or replace page FT.DispatchOrder_Detail (
28832865 footer ftrOrderActions {
28842866 actionbutton btnCheckIn (
28852867 caption: 'Check In (GPS)',
2886- action: microflow FT.ACT_CheckIn (Order: $currentObject) ,
2868+ action: nanoflow FT.NF_FT_CheckIn ,
28872869 buttonstyle: primary
28882870 )
28892871 actionbutton btnComplete (
28902872 caption: 'Complete',
2891- action: microflow FT.ACT_Dispatch_Complete (Order: $currentObject) ,
2873+ action: nanoflow FT.NF_FT_CompleteOffline ,
28922874 buttonstyle: success
28932875 )
28942876 actionbutton btnCancel (
@@ -2980,7 +2962,6 @@ grant HD.ManagerRole on FT.PBE_DispatchCompleted (create, read *, write *, delet
29802962grant execute on microflow FT.ACT_Dispatch_Assign to HD.AgentRole, HD.ManagerRole;
29812963grant execute on microflow FT.ACT_Dispatch_Open to HD.AgentRole, HD.ManagerRole;
29822964grant execute on microflow FT.ACT_Dispatch_Complete to FT.FieldTechRole, HD.AgentRole, HD.ManagerRole;
2983- grant execute on microflow FT.ACT_CheckIn to FT.FieldTechRole, HD.AgentRole, HD.ManagerRole;
29842965grant execute on microflow FT.ACT_WorkOrder_Import to HD.ManagerRole;
29852966grant execute on microflow FT.DS_MyDispatchOrders to FT.FieldTechRole;
29862967grant execute on microflow FT.DS_RelevantArticles to FT.FieldTechRole;
0 commit comments