Debugging Custom Code

Debug the Mobile Workflow package html and js files using a Windows desktop browser.

This procedure uses Google Chrome as an example, but you can use any browser that supports JavaScript debugging.

  1. Change the tracing level of Mobile Workflow to Debug.
  2. Open the browser to use for debugging and open the Java Console.
    If you are using Chrome:
    1. Add the following command line option to the shortcut used to start Chrome:
      ..\chrome.exe" --allow-file-access-from-files
  3. You can debug a client-initiated Mobile Workflow application up until the point where a menu item of the Submit Workflow type is performed. If the menu item action is an Online Request, place the XMLWidgetMessage (available in the WorkflowClient trace log located in <UnwiredPlatform_InstallDir>\UnwiredPlatform\Servers\UnwiredServer\logs\WorkflowClient) that is the expected response message into an rmi.xml file and place it at the same level as the generated workflow.html file.
    Note: Control characters are not parsed correctly when using rmi.xml and Chrome to debug the Mobile Workflow. Do not format the content of the rmi.xml when debugging the Mobile Workflow using Chrome. If you want a formatted look at the rmi.xml file, make a copy of the file for that purpose.
  4. From WorkSpace Navigator, drag and drop the workflow.html file for the Mobile Workflow application to debug onto the browser window.
  5. Find the name of the key to debug:
    1. In Flow Design, click the screen to debug.
    2. In the Properties view, click General in the left pane.
      The key name is shown, in this example, that is TravelRequest_create.
      mwf_debug_screen_name
  6. In the URL, add the ?screenToShow=<Screen_name> parameter to the end of the URL, for example:
    file:///C:/Documents%20and%20Settings/<user_name>/workspace/MobileWorkflow101/Generated%20Workflow/travelrequest/html/workflow.html?screenToShow=TravelRequest_create
  7. To simulate an e-mail message triggered Mobile Workflow application:
    1. Create a file called transform.xml and place the contents of the XMLWidgetMessage into it.
      The contents of the XMLWidgetMessage are in the WorkflowClient trace log in <UnwiredPlatform_InstallDir>\UnwiredPlatform\Servers\UnwiredServer\logs\WorkflowClient).
    2. To provide data to the Mobile Workflow application you are debugging, place the transform.xml file at the same level as the generated workflow.html file (Generated Workflow\<Workflow_application_name>\html).
    3. Add a ?loadtransformdata=true parameter to load the data into the Workflow application.
Related tasks
Testing Server Initiated Mobile Workflow Packages
Related reference
Launching a Server-initiated Mobile Workflow on the Device