Skip to main content

Get Value To Station Json Converter

Description

The GetValueToStationJsonConverter utility converts a list of Get Table and Get Value output JSON strings into an DocEdgeStationJson object and writes the result to a specified file. This utility is designed to work seamlessly within Process Studio for efficient data transformation.

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