Please give details of the problem



    Developer Guide

      1. Todo Validation
    1. Release Your User Login
    1. Markdown Template
      1. Backloop
      2. JavaScript Inclusion
      3. Task Reminder Email
      4. Variable Mapping
      5. SubProcess
      6. PDF
    2. Trigger
      1. Lock
      2. Dynamic Variable
      3. List 1000+ Objects
      4. JSONObject Creation
      5. JSONArray Conversion
      6. Number Currency Format
      7. Error Handling
      8. JSONObject Concatenation
      9. Freemarker Container Test
      10. Number Test
      11. Loop
      12. File Visibility
      13. List Hash Sequence
      14. Special Freemarker Characters
      15. Array To List
      16. Salesforce Computation
      17. Metadata
      18. JSONObject Keys Values
    1. Delegation
    2. Access Rights
    3. Dynamic Lanes
    4. Runtime Lanes
    5. Scripted Lanes
    6. Compound Organization Hierarchy
      1. Array From WS
      2. Column Inactivation
      3. Holidays
      4. List Reinitialization
      5. ArrayJSON to JSONArray
      6. Print JSONObject
      7. Invalid Fields
      8. Number Currency Format
      9. Google Tables
      10. Initialization Widget Date
      11. Date
      12. JQuery
      13. Round
      14. Inject JSONObject
      15. Label Modification
      16. Launch Process JQuery
      1. CSS Personalization
      2. CSS Examples
      1. Tags
      2. Retrieving Variables Values
      3. Dialog Window
      4. Autocomplete Widget
      5. JavaScript Report
      6. User Lane Picker
        1. Chart Dashboard Collection
        2. Chart Dashboard
        3. Report Chart
        4. Google Visualization
      7. Collection
      8. Dynamic List
      9. Summing Array
      10. API Listener
      11. File Preview
    1. Performance
      1. Custom Login Page
      2. Redirection ExecutionMode
      3. Mobile Devices
        1. homepage.js
        2. homepage.css
      4. Logout
      5. Header
      6. Menu Bar
      7. Information Tags
      8. Basket
    1. Mobile
    2. Offline
        1. Collections
          1. Process General Tab
            1. Process Step Output Variables
              1. Process Task Email Tab
              2. Process Task SubProcess Tab
              3. Process Task Functional Tab
              4. Process Task Connector Tab
              5. Process Task Manual Tab
              6. Process Task Loop Tab
              7. Process Task Script Tab
            2. Process Step Input Variables
            3. Gate
            4. Process Step Testing Variables
              1. Process Intermediary Event
              2. Process Timer Event
              3. Process Start Event
          2. Process Variables Tab
          3. Process Measures Tab
          4. Process Design
          5. Process Input Tab
          1. Organization
          2. Roles entities
          1. Project Collection Tab
          2. Project Definition Tab
          3. Version
          4. Project Versioned Files Tab
          5. Project Files Tab
          6. Project Description Tab
          7. Project Version Tab
          8. Project Rights Tab
          1. Connectors
          2. Providers
          3. Processes
          1. Composite API Configuration Tab
          2. Composite API Design Tab
        2. Custom Lists
        3. Revision
            1. Image Widget
            2. Spinner Widget
            3. FileUpload Widget
            4. Section Widget
            5. Multi Checkbox Widget
            6. URLInput Widget
            7. RadioButton Widget
            8. Array Widget
            9. Captcha Widget
            10. Checkbox Widget
            11. Report Widget
            12. Geolocation Widget
            13. Button Widget
            14. Custom Widget
            15. TextInput Widget
            16. Tree Widget
            17. List Widget
            18. StaticText Widget
            19. HTML Editor Widget
            20. JavaScript Widget
            21. Tab Widget
            22. HTML Widget
            23. ProgressBar Widget
            24. History Widget
          1. Web Interface Stylesheet Tab
          2. Web Interface Design Tab
          3. Web Interface Analytics Tab
          4. Web Interface Collection Tab
          5. Web Interface API Tab
          6. Web Interface Implementation Tab
          7. Web Interface JS Tab
        1. Scheduled Process
        2. Messages
        1. Configuration
        2. Users
        3. Usage
        1. Connectors
        2. Process Examples
      1. Customer Management
          1. Measuring
          2. Parameters
          3. Execution Path
          4. Runtime Users
        1. Web Interface Reports
        1. Files
        2. Home
        3. My Applications
      1. Collections To Array
      2. Collections BackOffice
      3. Collection JS Freemarker
      4. Collections To List
      1. Composite API Example
      1. Process Reporting API

    Scripted Lanes

    IMPORTANT - Advance Notice of upcoming API deprecation

    The performance of scripted lanes was drastically improved with the release of thibault_v1 (November 2016). This enhancement required a new set of script definitions and some previously supported functionality has been deprecated, full details are given in this document.

    Currently RunMyProcess accepts all scripts. The ones that are compliant with the new definition will take advantage of the new mechanism while the non-compliant ones will continue to use the old mechanism. A check is provided to help you determine whether your scripts are compliant or not.

    We strongly advise that you check that your scripted lanes are compliant with the new definitions. If your lanes are found to be non-compliant they will need to be re-written before the old mechanism is deprecated. While both mechanisms are currently supported, we strongly advise that you upgrade your scripts to the new definition at your earliest convenience - both to take advantage of the improved performance and to prepare for the deprecation of the old mechanism.

    When will the old mechanism be deprecated?

    We aim to deprecate the old method at the beginning of July 2017.

    A reminder will be sent out before each release.

    What is the impact on my scripted lane if it is not compliant with the new algorithm?

    Once we have deprecated the old mechanism, non-compliant scripted lanes will be empty.

    As a consequence, some end-users that were members of these non-compliant scripted lanes might not be able to access their applications or part of their applications.

    How will I know which scripted lanes are non-compliant?

    To review the status of your lanes, please follow these steps:

    1. Open the IDE (https://portal.runmyprocess.com/ide/).
    2. Open the Toolbox / Organization tab.
    3. A new column "Syntax" has been added (Please note that you cannot filter on this column therefore it is important that you check each available page).


    This column can take three values:

    Value Explanation
    An empty column means that the lane is not a scripted one. No action is required.
    Valid The lane is compliant. No action is required
    Invalid The lane is non-compliant. You will need to update the script.

    How can I make my scripted lanes compliant?

    Warning: Scripts are common to each of the three environments (TEST, ACCEPTANCE and LIVE). If you therefore update your script and save it, it will be applied directly to the LIVE environment.

    We recommend the following process for upgrading your scripts:

    1. Create a new temporary scripted lane;
    2. Open the non-compliant scripted lane and copy the script;
    3. Paste the script into the temporary scripted lane;
    4. Update the script according to the documentation below and click on the Check Script button;
    5. Once you have checked the script is valid, copy the upgraded script and paste it into the original non-compliant scripted lane;
    6. If you are having trouble upgrading your scripts, please do not hesitate to contact our support (http://support.runmyprocess.com/) or get in touch with your usual contact.

    Please note that your non-compliant scripted lanes will continue to work until the old mechanism is fully deprecated (July 2017).

    1 Overview

    A user will be a member of a Scripted Lane if they satisfy the criteria set for membership by the script which defines how membership should be determined. The criteria can be based on the user's metadata, preferences or current lane membership (or a combination of the three). This document gives details of what can be included in a script.

    Membership of a scripted lane is re-calculated under the following circumstances:

    1. Modification of the script for the lane;
    2. Modification of a user's metadata;
    3. Modification of a user's preference;
    4. Modification of one lane referenced in the script.

    info_1 The script is relevant for execution modes LIVE and ACCEPTANCE

    info_2 Once you have created your script it is possible to check it. The result will show you how many users meet the criteria (and so will be members of the lane) and the duration of the query.

    info_3 Lanes and Roles are essentially the same things. Roles are used in a User context whereas Lanes are used in a Process context i.e. a Role becomes a Lane in a process context.

    2 Creating a Scripted Lane

    Go to the tab Organization and create a new Role. By adding a formula within the Role Script field your lane will become a scripted lane.

    A scripted lane is created separately to the process execution, scripts can only therefore involve static data.

    The supported structure of a script is (in the following order) :

    • An optional static part

    • A dynamic part

    2.1 Optional Static part

    <# freemarker static computation >

    Here is an example script:

    <#-- Computation of the ratio -->
    <#assign first_number = 23>
    <#assign second_number = 3>
    <#assign result = first_number / second_number>

    The result could be used as a variable of the dynamic part (to ease the understanding of a computation for example).

    2.2 Dynamic part

    ${ expression }

    Rules for the expression:

    • Expression could be a combination of logical parts separated by && or ||

    • Supported evaluation order is variable operator value (value operator variable is not supported)

    • Only the listed Properties and FreeMarker Methods or Built-ins are supported

    Here are some example scripts:

    • ${is_user_in_lane([1111,1112,1113])} : The scripted lane will contain all the users that belong to any of the lanes 1111, 1112 or 1113. In other words, the scripted lane will be the union of the lanes 1111, 1112 and 1113.

    • ${is_user_in_lane([1111]) && is_user_in_lane([1112])} : The scripted lane will contain the users that belong to both lanes - 1111 and 1112. In other words, the scripted lane will be the intersection of the lanes 1111 and 1112.

    • ${is_user_in_lane([1111]) && color=='red'} : The scripted lane will contain all of the users that belong to the lane 1111 and have the Metadata or Preference 'color' set to red.

    info_1 If the script is not recognised as a script e.g. because it does not start with ${ and end with } or start with <# then the lane will be empty.

    3 Valid Methods and Properties

    The following section details the methods and properties that can be used within scripts.

    3.1 Freemarker Methods

    • is_user_in_lane(): Allows you to determine whether or not the current user is a member of at least one of the lanes specified. The lane ids are passed as a list (can be just one lane).

    • get_user_metadata(): Get the metadata for the current user.

    • get_user_preferences(): Get the preferences for the current user.

    • get_user_data(): Get the basic data (e.g. id, name) for the current user.

    • has_right(): Determines if the current user is a member of the lane whose id is passed as a parameter.

    info_1 If the lane queried by methods is_user_in_lane() and has_right() is a lane of type everybody, an error will be thrown. These methods should not be used with lanes of type everybody.

    3.2 Using Internal Parameter P_user

    P_user can be used in the script to represent the current user.

    3.2.2 User Properties

    The following properties can be used with P_user to access the user's data:

    Property Description Syntax
    id The user's unique identifier P_user.id
    login The user's login id P_user.login
    name The user's name P_user.name
    profile The user's profile P_user.profile
    status The user's current status - Active, Pending or Inactive P_user.status
    restriction Any restriction placed on the user's account e.g. unable to view other users P_user.restriction

    3.2.1 Metadata and Preferences properties

    The following properties can be used with P_user to access the user's metadata or preferences:

    Property Description Syntax
    extended Access the current user's metadata P_user.extended.xxx where xxx would be the name of the metadata required (e.g. P_user.extended.company).
    Equivalent of using get_user_metadata() or get_user_data().extended
    preferences Access the current user's preferences P_user.preferences.xxx where xxx would be the name of the preference required (e.g. P_user.preferences.language).
    Equivalent of using get_user_preferences() or get_user_data().preferences

    3.2.3 Accessing properties direclty

    It is possible to access properties directly within the script e.g. ${my_metadata == value} In this case, if the property is present in both the metadata and the preferences, the metadata will take preference.

    3.3 Freemarker Built-ins

    The following Freemarker Built-ins can be used within scripts:

    Built-in Description Example
    ?? This operator determines if a value is missing (result is false) or not (result is true).
    If the metadata doest not exist, ?? will raise an error
    ?default This allows you to set a default value if the value is missing. P_user.ext.company?default("MyCompany")
    ?exists This operator determines if a value is present (result is true) or missing (result is false).
    If the metadata doest not exist, ?exists will raise an error
    ?contains True if the substring specified as the parameter to this built-in occurs in the string. P_user.login?contains(".fr")
    ?seq_contains() True if a sequence contains the value passed as a parameter. get_user_preferences().languages?seq_contains("Russian")
    ?size The number of elements in a sequence languages?size

    info_1 Consecutive Freemarker Built-ins are not supported (Ex: P_user.pref.language?default("English")?contains("Russian")

    4 Deprecated Freemarker Built-ins

    Some Freemarker Built-ins that were previously supported in scripts have now been deprecated. This section identifies these built-ins and suggests alternative ways of achieving the same behaviour with supported Built-ins.

    Built-in(s) Explanation Example Previous Use Replacement
    ?eval This built-in evaluates a string as an expression. For example "2+2"?eval returns 4. ${language == "English"?eval} ${language == "English"}
    ?default([])?size Consecutive Freemarker Built-ins are not supported. ${(companies?default([])?size > 0)} ${(companies?size > 0)}
    ?index_of This built-in was used to determine the presence of a substring within a string. ${grade?index_of("y") != -1} ${grade?contains("y") == true}
    ?upper_case This built-in converted a string to upper case. ${(country?upper_case == "ENGLAND")} No alternative available yet
    ?lower_case This built-in converted a string to lower case. ${(country?lower_case == "england")} No alternative available yet
    ?string This built-in returned the value as a string. ${global_superuser?string =="true"} (if global_superuser is a boolean) ${global_superuser == true}
    ?has_content This returned true if the variable existed and had some value. ${get_user_metadata().finance?has_content} ${get_user_metadata().finance?? && get_user_metadata().finance != ""}

    5 Other deprecated functionality

    Strings used as booleans

    It was previously possible to treat strings that were used for boolean values as though they were booleans e.g. ${support} where support was a string used for boolean values (i.e. took the value "true" or "false").

    When no operators are used on these strings, they must now be treated as strings rather than booleans. The above example would therefore need to be written as ${support == "true"}

    6 Error Codes

    The following errors codes are the answer of the server when checking or saving a scripted lane :

    Code Name Explanation
    FMT0 MALFORMED_SCRIPT No script or assignment block found.
    FMT1 UNKNOWN_PROPERTY_EXCEPTION The property(metadata or preferences) is unknown
    FMT2 SYNTAX_ERROR_EXCEPTION Syntax problem - an expected character was not found
    FMT3 NO_SCRIPT_EXCEPTION The script was not recognized, the ${} was probably missing
    FMT4 INTERNAL_EXCEPTION An exception was thrown during the translation of the script
    FMT5 BUILTINS_EXCEPTION At least one unsupported built-in was used
    FMT6 EVERY_BODY_LANE_EXCEPTION The script used at least one everybody lane
    FMT7 SEQ_CONTAINS_EXCEPTION The parameter passed to built-in ?seq_contains() is incorrect
    FMT8 SYNTAX_OPERATOR_EXCEPTION A syntax problem was found around an operator (e.g. a single '&' instead of a double '&&')
    FMT9 PARENTHESIS_EXCEPTION A parenthesis mismatch, no closing parenthesis found for an opening one
    FMT10 UNKNOWN_DATA_EXCEPTION The data(metadata or preferences) is unknown
    FMT11 NOT_SYNTAX_EXCEPTION Syntax problem around the use of the NOT ('!') operator
    FMT12 UNKNOWN_OPERATOR_EXCEPTION The operator used is not a supported one
    FMT13 BUILTINS_SIZE_EXCEPTION The value of the ?size built-in was not found
    FMT14 WRONG_SIZE_VALUE_EXCEPTION The size value is not compatible with ?size built_in
    FMT15 UNKNOWN_SIZE_OPERATOR_EXCEPTION The operator of the ?size built-ins is not supported
    FMT16 TYPE_EXCEPTION Wrong or malformed parameter of builtins ?contains
    FMT17 DOUBLE_BUILTINS Consecutive builtins
    FMT999 OTHER_EXCEPTION An unknow exception was thrown during the testing of the script