Set Function
Set function is used for setting data to output parameters of service flow and/or on AS400 screens. To use a set function:
- Click Set on CODE PROPERTIES popup to use the function
- Select Interface Type, Function, and Requirements for function respectively
Available Set functions :
Interface Type | Function | Description | Required |
Output | putAll() | Set all fields of AS400 screen to output parameters of service flow | |
putAll(screen) | Set all fields of selected AS400 screen to output parameters of service flow | AS400 screen that fields are in | |
putAll(data) | Set specific data to output parameter | Data type “EWIContextData” | |
setContextData(fieldName) | Set specific field name to output parameter | fieldName of needed input parameter | |
setContextData(fieldData) | Set specific field data to output parameter | Field type “SSQUAREContextData” | |
setResponseCode(responseCode) | Set specific response code to output parameter | Select available response code as follows: 1. RESPONSE_CODE_AUTHENTICATION_FAILED2. RESPONSE_CODE_CANNOT_CONNECT_HOST3. RESPONSE_CODE_HOST_ERROR4. RESPONSE_CODE_HOST_TIMEOUT5. RESPONSE_CODE_INCORRECT_DATA6. RESPONSE_CODE_REQUIRE_INPUT7. RESPONSE_CODE_PAGE_NOT_FOUND8. RESPONSE_CODE_SESSION_FAIL9. RESPONSE_CODE_SESSION_SUCCESS10. RESPONSE_CODE_USER_NOT_ALLOW11. RESPONSE_CODE_USER_EXPIRED | |
setResponseMessage(responseMessage) | Set specific response message to output parameter | Specify responseMessage exceptional case occurred | |
throw Exception() | Return specific error message to front-end when exceptional case occurred | – message responded when exceptional case occurred- Select available response code as follows: 1. RESPONSE_CODE_AUTHENTICATION_FAILED2. RESPONSE_CODE_CANNOT_CONNECT_HOST3. RESPONSE_CODE_HOST_ERROR4. RESPONSE_CODE_HOST_TIMEOUT5. RESPONSE_CODE_INCORRECT_DATA6. RESPONSE_CODE_REQUIRE_INPUT7. RESPONSE_CODE_PAGE_NOT_FOUND8. RESPONSE_CODE_SESSION_FAIL9. RESPONSE_CODE_SESSION_SUCCESS10. RESPONSE_CODE_USER_NOT_ALLOW11. RESPONSE_CODE_USER_EXPIRED | |
setHttpStatus() | Respond to a request with HTTP Status Codes (success codes). Using this function, service flow will run from start to end points as normal. | Specify HTTP Status Code (numeric code only) | |
throwHttpStatus() | Respond to a request with HTTP Status Codes (error codes). Using this function, service flow will stop when error is found. Response headers carry:ResponseCode: EWI-0010EResponseMessage: Error with Http Status fixed numeric code | Specify HTTP Status Code (numeric code only) | |
Host | putAll(screen) | Set all input parameters to specific AS400 screen | AS400 screen needed to place all parameters on |
putAll(screen, autoFlush) | Set all input parameters to specific AS400 screen automatically without executing. This function facilitates when log printing to validate data | – AS400 screen needed to place all parameters on- Select true to execute autoFlush function, false otherwise | |
putAll(data, screen) | Set specific data list to specific AS400 screen | – AS400 screen needed to place all parameters on- Data type “EWIContextData” | |
setContextData(fieldName) | Set specific field name to specific AS400 screen | fieldName of needed input parameter | |
setContextData(fieldData) | Set specific field data to specific AS400 screen | Field type “SSQUAREContextData” | |
setCursor(row, col) | Set cursor at specific position on AS400 screen | Row and column of position on AS400 screen | |
setText(row, col, text) | Set specific text at specific position to AS400 screen | Row, column of position and text needed to set on AS400 screen | |
deleteField(fieldName) | delete specific field name from AS400 screen | fieldName that needed to delete |
- Click OK to confirm selection
- Selected set function will be encoded and shown in whitespace of CODE EDITOR
- Click DONE to save coding