PostClientFlow, Javascript policy is not supported in the response flow

Not applicable

Hi,

I would like to call a JS policy that will construct the message to be used in the MessageLogging policy. But unfortunately it throws me an error "

PostClientFlow, Javascript policy is not supported in the response flow"

1 3 511
3 REPLIES 3

Not applicable

HI Deepa, Can you please share your code and the JS policy

I want to construct the message depending on the logLevel...if it is ERROR then some details and for other some additional details

Js Code

======

varlogLevel=context.getVariable("messageLogging.loglevel");

var apiName=context.getVariable("apiproxy.name");

var message;

if(logLevel == 'ERROR')

message=apiName+"."+environmentName+" - "+clientTimestamp ;

else

message=apiName+"."+environmentName;

context.setVariable("postClientFlow.messageLogging.message",message);

MessageLogging Policy

==================

<File>

<MessagedefaultVariableValue="unknown">{postClientFlow.messageLogging.message}</Message>

<FileName>Api.log</FileName>

<FileRotationOptionsrotateFileOnStartup="true"> <FileRotationType>TIME_SIZE</FileRotationType> <MaxFileSizeInMB>1024</MaxFileSizeInMB>

<MaxFilesToRetain>10</MaxFilesToRetain> </FileRotationOptions> </File>

Can someone from Apigee team answer above question. I am seeing strange behaviour using javacript in postflow due to which I want to know if it can be executed consistently in posclient flow.