Get Value To Station Json Converter
Description
Get Value To Station Json Converter is a Java utility method that transforms the JSON output from Get Table and Get Value steps into a structured DocEdgeStationJson object and writes it to a file. Use this utility within a User Defined Java Class step when your workflow needs to consolidate extracted document data into a single, standardized format for downstream processing or station-based review. It accepts multiple input JSON strings along with contextual identifiers such as process ID, request ID, tenant ID, and file references to produce a complete output JSON file.
Example:
Here is a sample code to use the GetValueToStationJsonConverter method in a user-defined Java class in Process Studio
import com.automationedge.ps.docedge.utils.*;
try {
// Define the input JSON strings
String getValuejson = get(Fields.In, "GetValueOutputJSON").getString(r);
String getTableJson = get(Fields.In, "GetTableOutputValue").getString(r);
// Define the output file path
String updateFileOutput = get(Fields.In, "ouputDEJson").getString(r);
// Add the input JSON strings to a list
List<String> inputJson = new ArrayList<>();
inputJson.add(getValuejson);
inputJson.add(getTableJson);
ObjectMapper objectMapper = new JsonMapper();
// Call the GetValueToStationJsonConverter method
OutputJson outputJson = StationUtils.GetValueToStationJsonConverter(
inputJson,
get(Fields.In, "processId").getString(r),
get(Fields.In, "requestId").getString(r),
get(Fields.In, "tenantId").getString(r),
get(Fields.In, "fileName").getString(r),
get(Fields.In, "reqFileRef").getString(r),
get(Fields.In, "fileCode").getString(r),
get(Fields.In, "tableName").getString(r)
);
// Write the output JSON to the specified file
objectMapper.writeValue(new File(updateFileOutput), outputJson);
} catch (Exception e) {
throw new RuntimeException("Error writing output JSON to file: " + e.getMessage(), e);
}
Method Input / Output Parameters
| No. | Field Name | Data Type | Description |
|---|---|---|---|
| 1 | getValuejson | String | JSON string from GetValueOutputJSON |
| 2 | getTableJson | String | JSON string from GetTableOutputValue |
| 3 | updateFileOutput | String | Output file path |
| 4 | processId | String | Process ID |
| 5 | requestId | String | Request ID |
| 6 | tenantId | String | Tenant ID |
| 7 | fileName | String | File name |
| 8 | reqFileRef | String | Request file reference |
| 9 | fileCode | String | File code |
| 10 | tableName | String | Table name |