Search in sources :

Example 1 with DecisionsPanel

use of com.evolveum.midpoint.web.component.wf.DecisionsPanel in project midpoint by Evolveum.

the class ItemApprovalHistoryPanel method initLayout.

private void initLayout(UserProfileStorage.TableId tableId, int pageSize) {
    add(new DecisionsPanel(ID_DECISIONS_DONE, new AbstractReadOnlyModel<List<DecisionDto>>() {

        @Override
        public List<DecisionDto> getObject() {
            List<DecisionDto> rv = new ArrayList<>();
            WfContextType wfContextType = getModelObject();
            if (wfContextType == null) {
                return rv;
            }
            if (!wfContextType.getEvent().isEmpty()) {
                wfContextType.getEvent().forEach(e -> addIgnoreNull(rv, DecisionDto.create(e, getPageBase())));
            } else {
                ItemApprovalProcessStateType instanceState = WfContextUtil.getItemApprovalProcessInfo(wfContextType);
                if (instanceState != null) {
                    instanceState.getDecisions().forEach(d -> addIgnoreNull(rv, DecisionDto.create(d)));
                }
            }
            return rv;
        }
    }, tableId, pageSize));
}
Also used : DecisionsPanel(com.evolveum.midpoint.web.component.wf.DecisionsPanel) AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) ItemApprovalProcessStateType(com.evolveum.midpoint.xml.ns._public.common.common_3.ItemApprovalProcessStateType) DecisionDto(com.evolveum.midpoint.web.page.admin.workflow.dto.DecisionDto) ArrayList(java.util.ArrayList) WfContextType(com.evolveum.midpoint.xml.ns._public.common.common_3.WfContextType)

Aggregations

DecisionsPanel (com.evolveum.midpoint.web.component.wf.DecisionsPanel)1 DecisionDto (com.evolveum.midpoint.web.page.admin.workflow.dto.DecisionDto)1 ItemApprovalProcessStateType (com.evolveum.midpoint.xml.ns._public.common.common_3.ItemApprovalProcessStateType)1 WfContextType (com.evolveum.midpoint.xml.ns._public.common.common_3.WfContextType)1 ArrayList (java.util.ArrayList)1 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)1