Hi, I am trying to use the web service function in a rule to deliver several ele

Hi, I am trying to use the web service function in a rule to deliver several elements of data. The function itself is working just fine but I can't seem to find a way to output just two elements from the result. I can isolate a single variable or the result as a string. Should I be looking at refining the result on the rule output or can I set the rule to populate two variables as the output? Perhaps I have mixed up sail and regular rule concepts. Hopefully someone can set me straight.

Thanks, James

OriginalPostID-178344

OriginalPostID-178344

  Discussion posts and replies are publicly visible

Parents
  • Thanks Tim and Stefan. Both of your answers influenced the current end result which is this:

    with(
    local!wsdlUrl: rule!dynamicOBAWSurl(cons!THIS_ENVIRONMENT),
    local!wsResult: webservicequery(
    wsConfig:
    a!wsConfig(
    wsdlUrl: local!wsdlUrl,
    service: "{appian.ZZZZ.org/}Appian",
    port: "AppianSoap12",
    operation: "{appian.ZZZZ.org/}GetCost"
    ),
    inputVar: {
    GetCostSoapIn: {
    orderUrn: ri!URN,
    orderVersion: ri!Version,
    ObaInstance: ri!OBA,
    MonthsSpend: 0
    }
    }
    ),
    "{grossPrice: "&local!wsResult.returnValue.GetCostSoapOut.GetCostResult.Total_Gross_Price&"; monthSpend: "&local!wsResult.returnValue.GetCostSoapOut.GetCostResult.Last_6_Months_Net_Spend&"}"
    )

    The final output of the rule is extracted to pv! in a script task from the ac! using:

    readjson(ac!Param1,"grossPrice")

    For my use case this has delivered what I needed. Which was to display data on a task form in the apps environment. Ideally this will be pulled on demand from within the form as a default value but this might prove to be prohibitive due to load times within the form. If this is the case then pre-processing of the data will be required and a switch of storage to CDT a more suitable method.


Reply
  • Thanks Tim and Stefan. Both of your answers influenced the current end result which is this:

    with(
    local!wsdlUrl: rule!dynamicOBAWSurl(cons!THIS_ENVIRONMENT),
    local!wsResult: webservicequery(
    wsConfig:
    a!wsConfig(
    wsdlUrl: local!wsdlUrl,
    service: "{appian.ZZZZ.org/}Appian",
    port: "AppianSoap12",
    operation: "{appian.ZZZZ.org/}GetCost"
    ),
    inputVar: {
    GetCostSoapIn: {
    orderUrn: ri!URN,
    orderVersion: ri!Version,
    ObaInstance: ri!OBA,
    MonthsSpend: 0
    }
    }
    ),
    "{grossPrice: "&local!wsResult.returnValue.GetCostSoapOut.GetCostResult.Total_Gross_Price&"; monthSpend: "&local!wsResult.returnValue.GetCostSoapOut.GetCostResult.Last_6_Months_Net_Spend&"}"
    )

    The final output of the rule is extracted to pv! in a script task from the ac! using:

    readjson(ac!Param1,"grossPrice")

    For my use case this has delivered what I needed. Which was to display data on a task form in the apps environment. Ideally this will be pulled on demand from within the form as a default value but this might prove to be prohibitive due to load times within the form. If this is the case then pre-processing of the data will be required and a switch of storage to CDT a more suitable method.


Children
No Data