Skip to main content

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 NameData TypeDescription
1getValuejsonStringJSON string from GetValueOutputJSON
2getTableJsonStringJSON string from GetTableOutputValue
3updateFileOutputStringOutput file path
4processIdStringProcess ID
5requestIdStringRequest ID
6tenantIdStringTenant ID
7fileNameStringFile name
8reqFileRefStringRequest file reference
9fileCodeStringFile code
10tableNameStringTable name