Skip to content

Commit

Permalink
Merge pull request #36 from SoftwareAG/feature-new-samples
Browse files Browse the repository at this point in the history
fixed bug
  • Loading branch information
ck-c8y authored May 14, 2024
2 parents c1c5409 + c7b5aa4 commit 26b9137
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions repository/blocks/EnhancedHttpOutputBlock.mon
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ using apama.analyticsbuilder.ABConstants;
using apama.analyticsbuilder.L10N;
using apama.analyticsbuilder.Value;
using apama.analyticsbuilder.TimerParams;
using com.apama.util.AnyExtractor;

using com.softwareag.connectivity.httpclient.HttpTransport;
using com.softwareag.connectivity.httpclient.RequestType;
Expand All @@ -35,7 +36,7 @@ event HTTPHandler
TimerParams tp := TimerParams.relative(0.01).withPayload(res).withPartition(deviceId);
base.createTimerWith(tp);

log "Called handleResponse: " + res.payload.data.toString() at INFO;
log "Called handleResponse: " device + "/" + res.payload.data.toString() at INFO;
if not res.isSuccess() {
log "Unable to connect " +host+". Error code: " + res.statusMessage at WARN;
}
Expand Down Expand Up @@ -186,7 +187,7 @@ event EnhancedHTTPOutput {
Request req := transport.createPOSTRequest($parameters.path, data);

// Execute the request and pass the callback action.
string deviceId := $activation.partition.toString();
string deviceId := AnyExtractor($activation.partition).getString("");
log "Processing for partition: " + deviceId at INFO;
req.execute(HTTPHandler(deviceId, $parameters.host, $base).handleResponse);
$base.profile(BlockBase.PROFILE_OUTPUT);
Expand All @@ -208,7 +209,7 @@ event EnhancedHTTPOutput {
propertyValues[k.valueToString()] := response.payload.data.getEntry(k);
}

log "Response parsed: " + propertyValues.toString() at INFO;
log "Response parsed: " + propertyValues.toString() at DEBUG;

$setOutput_responseBody($activation, Value(true, $activation.timestamp, propertyValues));
$setOutput_statusCode($activation, response.statusCode.toFloat());
Expand Down

0 comments on commit 26b9137

Please sign in to comment.