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:

  1. Click Set on CODE PROPERTIES popup to use the function
  2. Select Interface Type, Function, and Requirements for function respectively 

Available Set functions :

Interface TypeFunctionDescriptionRequired
OutputputAll()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 flowAS400 screen that fields are in
putAll(data)Set specific data to output parameterData type “EWIContextData
setContextData(fieldName)Set specific field name to output parameterfieldName of needed input parameter 
setContextData(fieldData)Set specific field data to output parameterField type “SSQUAREContextData
setResponseCode(responseCode)Set specific response code to output parameterSelect 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 parameterSpecify 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 codeSpecify HTTP Status Code (numeric code only)
HostputAll(screen)Set all input parameters to specific AS400 screenAS400 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 screenfieldName of needed input parameter 
setContextData(fieldData)Set specific field data to specific AS400 screenField type “SSQUAREContextData
setCursor(row, col)Set cursor at specific position on AS400 screenRow and column of position on AS400 screen
setText(row, col, text)Set specific text at specific position to AS400 screenRow, column of position and text needed to set on AS400 screen
deleteField(fieldName)delete specific field name from AS400 screenfieldName that needed to delete
  1. Click OK to confirm selection
  2. Selected set function will be encoded and shown in whitespace of CODE EDITOR  
  1. Click DONE to save coding