CLIENT_REQUEST ()

CLIENT_REQUEST ()

CLIENT_REQUEST(action, [parameters]])


Execute this FORMULA to generate a request that will be sent to the client after a call to form_set_answer ().

The FORMULA is only executed if the call to form_set_answer () causes the FORM to close, and it generates a JSON string that will be included in the response returned by form_set_answer () into the node ‘action_request’.

The goal of this formula is to be able to suggest the client which action should it perform when a FORM is closed. Obviously it is responsibility of the client whether to consider the suggestion or not.

Input Parameters

Parameter

Type

Default

Required

Description

Parameter

Type

Default

Required

Description

action

String

 

Yes

A valid

 

parameters

JSON

NULL

No

Additional parameters that depend on the action requested. See below detailed information about the parameters expected by each action

Return value

The FORMULA generates a JSON formatted string with the information about the request. This string will be included in the response of form_set_answer () into the node action_request, but only when the FORM is closed as a result of the invocation to form_set_answer ().

See examples of possible return values below

Execution

When the FORM containing the FORMULA is closed

Action Names and Parameters

Action Name

Expected parameters

Comments

Return value examples

Action Name

Expected parameters

Comments

Return value examples

SHOW_CASE_LIST

  • program (optional)

  • team (optional)

The client is asked to show the list of CASESs of the active USER.

Optionally It is possible to indicate a program and/or a team to show only the CASEs related to that PROGRAM/TEAM

The accepted parameters indicate:

  • program: (a PROGRAM ID or PROGRAM CODE) if provided, then the FORMULA will generate a request to view the CASEs related to that specific PROGRAM

  • team: (a TEAM reference or TEAM CODE) if provided, then the formula will generate a request to view the CASEs of that specific TEAM

{"arq": "SHOW_CASE_LIST"}

{"arq": "SHOW_CASE_LIST", "program": 232, "team": 433}

Note that the return value will only include the program and team properties if any of them was specified in the input parameters

SHOW_CASE_TASK_LIST

  • program (optional)

  • team (optional)

  • admission (optional)

The client is asked to show the list of TASKs of a particular CASE. The CASE is supposed to be one associated to the current ADMISSION.

Optionally It is possible to indicate a program and/or a team to show only the TASKs related to that PROGRAM/TEAM

The accepted parameters indicate:

  • program: (a PROGRAM ID or PROGRAM CODE) if provided, then the FORMULA will generate a request to view the TASKs related to that specific PROGRAM

  • team: (a TEAM reference or TEAM CODE) if provided, then the formula will generate a request to view the TASKs of that specific TEAM

  • admission: (an ADMISSION reference) if provided, then the formula will generate a request to view the TASKs related to the PROGRAM/TEAM of that ADMISSION. Note that providing an ADMISSION reference is equivalent to provide both “program” and “team” parameters

{"arq": "SHOW_CASE_TASK_LIST",
"case": "1231"}

{"arq": "SHOW_CASE_TASK_LIST",
"case": "1231", "program": 232, "team": 433}

Note that the return value will only include the program and team properties if any of them was specified in the input parameters

SHOW_CASE_EVENT_LIST

  • program (optional)

  • team (optional)

  • admission (optional)

The client is asked to show the list of TASKs of a particular EVENT. The CASE is supposed to be one associated to the current ADMISSION.

Optionally It is possible to indicate a program and/or a team to show only the EVENTs related to that PROGRAM/TEAM

The accepted parameters indicate:

  • program: (a PROGRAM ID or PROGRAM CODE) if provided, then the FORMULA will generate a request to view the TASKs related to that specific PROGRAM

  • team: (a TEAM reference or TEAM CODE) if provided, then the formula will generate a request to view the TASKs related to that specific TEAM

  • admission: (an ADMISSION reference) if provided, then the formula will generate a request to view the TASKs of the PROGRAM/TEAM of that ADMISSION. Note that providing an ADMISSION reference is equivalent to provide both “program” and “team” parameters

{"arq": "SHOW_CASE_EVENT_LIST",
"case": "1231"}

{"arq": "SHOW_CASE_EVENT_LIST",
"case": "1231", "program": 232, "team": 433}

Note that the return value will only include the program and team properties if any of them was specified in the input parameters

SHOW_USER_TASK_LIST

  • program (optional)

  • team (optional)

The client is asked to show the list of TASKs of the active USER.

Optionally It is possible to indicate a program and/or a team to show only the TASKs related to that PROGRAM/TEAM

The accepted parameters indicate:

  • program: (a PROGRAM ID or PROGRAM CODE) if provided, then the FORMULA will generate a request to view the TASKs related to that specific PROGRAM

  • team: (a TEAM reference or TEAM CODE) if provided, then the formula will generate a request to view the TASKs of that specific TEAM

{"arq": "SHOW_USER_TASK_LIST"}

{"arq": "SHOW_USER_TASK_LIST", "program": 232, "team": 433}

Note that the return value will only include the program and team properties if any of them was specified in the input parameters

SHOW_USER_EVENT_LIST

  • program (optional)

  • team (optional)

The client is asked to show the list of EVENTSs of the active USER.

Optionally It is possible to indicate a program and/or a team to show only the EVENTs related to that PROGRAM/TEAM

  • program: (a PROGRAM ID or PROGRAM CODE) if provided, then the FORMULA will generate a request to view the TASKs related to that specific PROGRAM

  • team: (a TEAM reference or TEAM CODE) if provided, then the formula will generate a request to view the TASKs related to that specific TEAM

{"arq": "SHOW_USER_EVENT_LIST"}

{"arq": "SHOW_USER_EVENT_LIST", "program": 232, "team": 433}

Note that the return value will only include the program and team properties if any of them was specified in the input parameters

SHOW_TASK

  • task: a TASK_CODE or a reference to a TASK.

The client is asked to show a specific TASK that should be provided in the parameters.

If a TASK_CODE is provided in the parameters and there exist more than one TASK with that TASK_CODE, then the last open TASK will be used, or the last closed TASK if all are closed.

The return value will include extended information providing the ADMISSION reference and CASE reference

{"arq": "SHOW_TASK",
"case": "1231",
"admission":"54342",
"task": "32434"}

SHOW_EVENT

  • event: A reference to an EVENT.

The client is asked to show a specific EVENT that should be provided in the parameters.

If the EVENT is assigned to a CASE, there return value will include extended information providing the ADMISSION reference and CASE reference

{"arq": "SHOW_EVENT",
"event": "32434"}

Examples

Formula

Description

Return value

Formula

Description

Return value

CLIENT_REQUEST(“SHOW_CASE_LIST“)

Requests the client to show the case list of the active user

{"arq": "SHOW_CASE_LIST" }

CLIENT_REQUEST(“SHOW_TASK“, {“task”: “12324”})

Requests the client to show the TASK with reference 12324

{"arq": "SHOW_TASK",
"case": "12324",
"admission":"54342",
"task": "32434"}