Search in sources :

Example 1 with ItemApprovalProcessStateType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ItemApprovalProcessStateType 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)

Example 2 with ItemApprovalProcessStateType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ItemApprovalProcessStateType in project midpoint by Evolveum.

the class ApprovalCasePanel method calculateDecisionList.

public List<DecisionDto> calculateDecisionList() {
    List<DecisionDto> rv = new ArrayList<>();
    CaseType parentCase = getObjectWrapper().getObject().asObjectable();
    if (parentCase == null) {
        return rv;
    }
    if (parentCase.getEvent() != null && !parentCase.getEvent().isEmpty()) {
        parentCase.getEvent().forEach(e -> CollectionUtils.addIgnoreNull(rv, DecisionDto.create(e, ApprovalCasePanel.this.getPageBase())));
    } else {
    // ItemApprovalProcessStateType instanceState = WfContextUtil.getItemApprovalProcessInfo(parentCase.getApprovalContext());
    // if (instanceState != null) {
    // //todo where we can take decisions now?
    // //                instanceState.getDecisions().forEach(d -> CollectionUtils.addIgnoreNull(rv, DecisionDto.create(d)));
    // }
    }
    return rv;
}
Also used : CaseType(com.evolveum.midpoint.xml.ns._public.common.common_3.CaseType) DecisionDto(com.evolveum.midpoint.web.page.admin.workflow.dto.DecisionDto) ArrayList(java.util.ArrayList)

Example 3 with ItemApprovalProcessStateType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ItemApprovalProcessStateType in project midpoint by Evolveum.

the class ItemApprovalSpecificContent method createProcessSpecificState.

@Override
public WfProcessSpecificStateType createProcessSpecificState() {
    ItemApprovalProcessStateType state = new ItemApprovalProcessStateType(prismContext);
    state.setApprovalSchema(approvalSchemaType);
    state.setPolicyRules(policyRules);
    return state;
}
Also used : ItemApprovalProcessStateType(com.evolveum.midpoint.xml.ns._public.common.common_3.ItemApprovalProcessStateType)

Example 4 with ItemApprovalProcessStateType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ItemApprovalProcessStateType in project midpoint by Evolveum.

the class ApprovalCaseTabPanel method calculateDecisionList.

public List<DecisionDto> calculateDecisionList() {
    List<DecisionDto> rv = new ArrayList<>();
    CaseType parentCase = getObjectWrapper().getObject().asObjectable();
    if (parentCase == null) {
        return rv;
    }
    if (parentCase.getEvent() != null && !parentCase.getEvent().isEmpty()) {
        parentCase.getEvent().forEach(e -> CollectionUtils.addIgnoreNull(rv, DecisionDto.create(e, ApprovalCaseTabPanel.this.getPageBase())));
    } else {
    // ItemApprovalProcessStateType instanceState = WfContextUtil.getItemApprovalProcessInfo(parentCase.getApprovalContext());
    // if (instanceState != null) {
    // //todo where we can take decisions now?
    // //                instanceState.getDecisions().forEach(d -> CollectionUtils.addIgnoreNull(rv, DecisionDto.create(d)));
    // }
    }
    return rv;
}
Also used : CaseType(com.evolveum.midpoint.xml.ns._public.common.common_3.CaseType) DecisionDto(com.evolveum.midpoint.web.page.admin.workflow.dto.DecisionDto) ArrayList(java.util.ArrayList)

Aggregations

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