Skip to Content
avatar image
Former Member

Dynamically Writing Long Text in RaiseAlert Action

Hi all,

I am attempting to overwrite an Alert Definition's Long Text field when raising an Alert with detailed information for the respective alert. The Alarm Definition's default for the Long Text is "temporary". I am attempting to overwrite it with the following: The previous 0 results from the Monitoring Query have exceeded the threshold of: 0. The Alarm value is: 0.

I am aware the Long Text Property is a List property so I write a List Local Property to the Raise Alert Action Block for LongText. The overwritten property (as seen in the Debug) is: [[string:The previous 0 results from the Monitoring Query have exceeded the threshold of: 0. The Alarm value is: 0.]]. This appears to be correct as it is a List of length 1 of type String.

When running the action block the LongText is not overwritten, and I'm not sure why. Is there a proper format for the List Property or am I missing some step?

The outputXML of the Raise Alert Action Block is:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<Alert>

<AlertId>24</AlertId>

<ShortText>Drum from Reduced Crude Volume Level Alert</ShortText>

<LongText>temporary</LongText>

<Expiration>6</Expiration>

<Severity>1</Severity>

<FollowUpActions/>

<ContainerProperties>

<ContainerProperty Name="ResponseTime" Value="10 minutes"/>

</ContainerProperties>

<RecipientRoles>SAP_XMII_User</RecipientRoles>

</Alert>

It should also be mentioned in Debug in the Variables Tab it appears the Type for the Raise_Alert.LongText is 'String' not 'List'. When attempting to write just a string to the LongText Property a conversion error is given.

Thanks,

Joe

DebugVariable.PNG (22.1 kB)
ActionBlock.PNG (39.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Nov 01, 2013 at 10:19 AM

    Hi Joe,

    The property 'long text' in an alert definition is a combination of static text with the place holder element '?' in it. The values for this placeholder can be passed dynamically using the list attribute 'LongTextList'. The values passed in this list replace the '?' symbol in the defined long text sequentially, in the same order.

    That is, if your long text as defined in the alert definition is say, 'Alert raised for the line number ? at the value ? for the location ? ' and if the list in local transaction property contains values '2' , '88.4' , 'Bangalore', then the final long text in the output will be 'Alert raised for the line number 2 at the value 88.4 for the location Bangalore'.

    As you have not provided any placeholder '?' in your alert text, hence the runtime output is not getting changed (as the symbol ? is not found at all in the long text to be replaced with the list values provided)

    If you want to change the entire long text dynamically, then write only a '?' in your long text filed in the alert definition and then you can pass the complete long text string at runtime.

    But as I observe from your example above, you just need to send three values dynamically in your alert text, hence you can have long text defined in your alert as,

    'The previous ? results from the Monitoring Query have exceeded the threshold of: ?. The Alarm value is: ?.'

    Later, create a list that holds the actual placeholder values and assign it in your link editor as done previously. This should generate the final output text as expected.

    Also, you can raise a csn for the issue where it shows 'string' for long text in debugger.

    Hope this helps,

    Regards,

    Rutika

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Rutika,

      Perfect! That is exactly what I was looking for; I figured I was just missing some step in the configuraiton.

      Thanks,

      Joe