Search in sources :

Example 1 with DmnDecisionRequirementsGraphImpl

use of org.camunda.bpm.dmn.engine.impl.DmnDecisionRequirementsGraphImpl in project camunda-engine-dmn by camunda.

the class DefaultDmnTransform method transformDefinitions.

protected DmnDecisionRequirementsGraph transformDefinitions(Definitions definitions) {
    DmnElementTransformHandler<Definitions, DmnDecisionRequirementsGraphImpl> handler = handlerRegistry.getHandler(Definitions.class);
    DmnDecisionRequirementsGraphImpl dmnDrg = handler.handleElement(this, definitions);
    // validate id of drd
    if (dmnDrg.getKey() == null) {
        throw LOG.drdIdIsMissing(dmnDrg);
    }
    Collection<Decision> decisions = definitions.getChildElementsByType(Decision.class);
    List<DmnDecision> dmnDecisions = transformDecisions(decisions);
    for (DmnDecision dmnDecision : dmnDecisions) {
        dmnDrg.addDecision(dmnDecision);
    }
    notifyTransformListeners(definitions, dmnDrg);
    return dmnDrg;
}
Also used : Definitions(org.camunda.bpm.model.dmn.instance.Definitions) DmnDecisionRequirementsGraphImpl(org.camunda.bpm.dmn.engine.impl.DmnDecisionRequirementsGraphImpl) DmnDecision(org.camunda.bpm.dmn.engine.DmnDecision) Decision(org.camunda.bpm.model.dmn.instance.Decision) DmnDecision(org.camunda.bpm.dmn.engine.DmnDecision)

Example 2 with DmnDecisionRequirementsGraphImpl

use of org.camunda.bpm.dmn.engine.impl.DmnDecisionRequirementsGraphImpl in project camunda-engine-dmn by camunda.

the class DmnDecisionRequirementsGraphTransformHandler method createFromDefinitions.

protected DmnDecisionRequirementsGraphImpl createFromDefinitions(DmnElementTransformContext context, Definitions definitions) {
    DmnDecisionRequirementsGraphImpl drd = createDmnElement();
    drd.setKey(definitions.getId());
    drd.setName(definitions.getName());
    return drd;
}
Also used : DmnDecisionRequirementsGraphImpl(org.camunda.bpm.dmn.engine.impl.DmnDecisionRequirementsGraphImpl)

Aggregations

DmnDecisionRequirementsGraphImpl (org.camunda.bpm.dmn.engine.impl.DmnDecisionRequirementsGraphImpl)2 DmnDecision (org.camunda.bpm.dmn.engine.DmnDecision)1 Decision (org.camunda.bpm.model.dmn.instance.Decision)1 Definitions (org.camunda.bpm.model.dmn.instance.Definitions)1