cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5: How do I set the ProcessFlowLaneHeader state with a JSON-Model?

p_zemlyansky
Discoverer

I'm currently working on an SAPUI5 app which includes a Process Flow control. I want to set the state of the ProcessFlowLaneHeader according to values in my JSON-model but it keeps changing to a state represting each existing state of the nodes. So I want the "donut" to show 2/3 of green, 1/12 of grey and 1/4 of red color(see JSON below). Instead it shows me 1/3 of each. When I look at the properties of the ProcessFlowLaneHeader through the UI5 Inspector while the app is running it shows me:

state: {
0: {
  "state": "Positive",
  "value": 1
}
1: {
  "state": "Negative",
  "value": 1
}
2: {
  "state": "Neutral",
  "value": 1
}
3: {
  "state": "Planned",
  "value": 0
}
4: {
  "state": "Critical",
  "value": 0
}

Did i make a mistake or is SAUPUI5 just overwriting my state? How can I set the state of the ProcessFlowLaneHeade?(onInit on controller?)

My JSON:

...
"lanes": [{
    "id": "0",
    "icon": "sap-icon://sales-quote",
    "label": "MoBe",
    "position": 0,
    "state": [{
        "state": "Positive",
        "value": 8
    }, {
        "state": "Negative",
        "value": 1
    }, {
        "state": "Neutral",
        "value": 3
    }, {
        "state": "Planned",
        "value": 0
    }, {
        "state": "Critical",
        "value": 0
    }]
},
...

My View:

<ProcessFlow id="processflow1" foldedCorners="false" wheelZoomable="false" nodes="{Monitor1>/nodes}" lanes="{Monitor1>/lanes}">
    <nodes>
        <ProcessFlowNode laneId="{Monitor1>lane}" nodeId="{Monitor1>id}" title="{Monitor1>title}" children="{Monitor1>children}" state="{Monitor1>state}" value="{Monitor1>value}" stateText="{Monitor1>stateText}" texts="{Monitor1>texts}" highlighted="{Monitor1>highlighted}" focused="{Monitor1>focused}" titleAbbreviation="{Monitor1>titleAbbreviation}"/>
    </nodes>
    <lanes>
        <ProcessFlowLaneHeader laneId="{Monitor1>id}" iconSrc="{Monitor1>icon}" text="{Monitor1>label}" position="{Monitor1>position}" state="{Monitor1>state}" press="onChangeDonut"/>
    </lanes>
</ProcessFlow>

Thank you for your help!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi You have to put a value in Pourcent.

"lanes": [{
    "id": "0",
    "icon": "sap-icon://sales-quote",
    "label": "MoBe",
    "position": 0,
    "state": [{
        "state": "Positive",
        "value": 66
    }, {
        "state": "Negative",
        "value": 8
    }, {
        "state": "Neutral",
        "value": 25
    }, {
        "state": "Planned",
        "value": 0
    }, {
        "state": "Critical",
        "value": 0
    }]
p_zemlyansky
Discoverer

Hi, thank you for your answer but this is already included in my JSON.
The SAPUI5 Documentation says:
If the complete process flow is displayed (that is, if the lane header is displayed with documents underneath), the given state values of the lane header are ignored and will be calculated in the ProcessFlow according to the current state of the documents.

I want to know if there is a way to turn this automatic calculation off.