Search in sources :

Example 1 with InformationRequirement

use of org.camunda.bpm.model.dmn.instance.InformationRequirement in project camunda-dmn-model by camunda.

the class InformationRequirementImpl method registerType.

public static void registerType(ModelBuilder modelBuilder) {
    ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(InformationRequirement.class, DMN_ELEMENT_INFORMATION_REQUIREMENT).namespaceUri(DMN11_NS).instanceProvider(new ModelTypeInstanceProvider<InformationRequirement>() {

        public InformationRequirement newInstance(ModelTypeInstanceContext instanceContext) {
            return new InformationRequirementImpl(instanceContext);
        }
    });
    SequenceBuilder sequenceBuilder = typeBuilder.sequence();
    requiredDecisionRef = sequenceBuilder.element(RequiredDecisionReference.class).uriElementReference(Decision.class).build();
    requiredInputRef = sequenceBuilder.element(RequiredInputReference.class).uriElementReference(InputData.class).build();
    typeBuilder.build();
}
Also used : InformationRequirement(org.camunda.bpm.model.dmn.instance.InformationRequirement) SequenceBuilder(org.camunda.bpm.model.xml.type.child.SequenceBuilder) RequiredDecisionReference(org.camunda.bpm.model.dmn.instance.RequiredDecisionReference) RequiredInputReference(org.camunda.bpm.model.dmn.instance.RequiredInputReference) ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)

Example 2 with InformationRequirement

use of org.camunda.bpm.model.dmn.instance.InformationRequirement in project camunda-engine-dmn by camunda.

the class DefaultDmnTransform method getRequiredDmnDecisions.

protected List<DmnDecision> getRequiredDmnDecisions(Decision decision, Map<String, DmnDecisionImpl> dmnDecisions) {
    List<DmnDecision> requiredDecisionList = new ArrayList<DmnDecision>();
    for (InformationRequirement informationRequirement : decision.getInformationRequirements()) {
        Decision requiredDecision = informationRequirement.getRequiredDecision();
        if (requiredDecision != null) {
            DmnDecision requiredDmnDecision = dmnDecisions.get(requiredDecision.getId());
            requiredDecisionList.add(requiredDmnDecision);
        }
    }
    return requiredDecisionList;
}
Also used : InformationRequirement(org.camunda.bpm.model.dmn.instance.InformationRequirement) ArrayList(java.util.ArrayList) DmnDecision(org.camunda.bpm.dmn.engine.DmnDecision) Decision(org.camunda.bpm.model.dmn.instance.Decision) DmnDecision(org.camunda.bpm.dmn.engine.DmnDecision)

Aggregations

InformationRequirement (org.camunda.bpm.model.dmn.instance.InformationRequirement)2 ArrayList (java.util.ArrayList)1 DmnDecision (org.camunda.bpm.dmn.engine.DmnDecision)1 Decision (org.camunda.bpm.model.dmn.instance.Decision)1 RequiredDecisionReference (org.camunda.bpm.model.dmn.instance.RequiredDecisionReference)1 RequiredInputReference (org.camunda.bpm.model.dmn.instance.RequiredInputReference)1 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1 SequenceBuilder (org.camunda.bpm.model.xml.type.child.SequenceBuilder)1