Skip to main content
Version: 10.2.4

Apply FreeMarker

Start from http://freemarker.org/docs/dgui_quickstart_basics.html

Key points:

WorkFusion template variables​

Review Template variables

Use FreeMarker test tool​

Online FreeMarker Template Tester http://freemarker-online.kenshoo.com/

Complex Manual Task example​

  • Upload files
  • Validation. AJAX calls with jQuery, show results to worker
  • external instructions in iFrame

Task layouts and embedding media content​

Assignments​

1. Practice FreeMarker built-ins​

  1. Explore online FreeMarker user guide: http://freemarker.org/docs/
  2. Prepare .CSV with 5 columns and fill 1 row with data
    1. In WorkFusion create Manual Task and use .CSV as input data
    2. Using FreeMarker build-ins output all 5 fields as HTML table (do NOT use TASK DESIGNER, work in CODE EDITOR mode). I.e. put data into HTML table. Make HTML table headers out of UPPER CASE variable names. WorkFusion injects into FreeMarker variable with all input data: question.data Use #list build-in to iterate through question.data

2. Advanced task design and media content embedding​

Input: scanned invoices (pdf), html invoices, invoice id.

1st step: Detect invoice language and is it WorkFusion related or not. Input = pdf invoices

  • Use Bootstrap styles and controls
  • Create a custom layout: show records as tabs (block size > 1)
  • Show PDF invoice on the left
  • Show answers on the right
  • (optional)
    • show video player in Instructions section: any video file
    • make an AJAX request to some open API (weather, Wikipedia, news) and display a response

Rule: if invoice is not WF related, go to end. Otherwise, go to Step #2.

2nd step: Extract information from invoice (use groups for products table). Input = html invoices