Search in sources :

Example 1 with DecisionName

use of org.kie.workbench.common.stunner.bpmn.definition.property.task.DecisionName in project kie-wb-common by kiegroup.

the class BaseTaskConverter method businessRuleTask.

private BpmnNode businessRuleTask(org.eclipse.bpmn2.BusinessRuleTask task) {
    Node<View<BusinessRuleTask>, Edge> node = factoryManager.newNode(task.getId(), BusinessRuleTask.class);
    BusinessRuleTask definition = node.getContent().getDefinition();
    BusinessRuleTaskPropertyReader p = propertyReaderFactory.of(task);
    definition.setGeneral(new TaskGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
    RuleLanguage ruleLanguage = new RuleLanguage(p.getImplementation());
    RuleFlowGroup ruleFlowGroup = null;
    Namespace namespace = null;
    DecisionName decisionName = null;
    DmnModelName dmnModelName = null;
    if (ruleLanguage.getValue().equals(RuleLanguage.DRL)) {
        ruleFlowGroup = new RuleFlowGroup(p.getRuleFlowGroup());
        namespace = new Namespace();
        decisionName = new DecisionName();
        dmnModelName = new DmnModelName();
    } else if (ruleLanguage.getValue().equals(RuleLanguage.DMN)) {
        ruleFlowGroup = new RuleFlowGroup();
        namespace = new Namespace(p.getNamespace());
        decisionName = new DecisionName(p.getDecisionName());
        dmnModelName = new DmnModelName(p.getDmnModelName());
    }
    definition.setExecutionSet(new BusinessRuleTaskExecutionSet(new RuleLanguage(p.getImplementation()), ruleFlowGroup, namespace, decisionName, dmnModelName, new OnEntryAction(p.getOnEntryAction()), new OnExitAction(p.getOnExitAction()), new IsAsync(p.isAsync()), new AdHocAutostart(p.isAdHocAutoStart()), new SLADueDate(p.getSlaDueDate())));
    definition.setSimulationSet(p.getSimulationSet());
    definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
    node.getContent().setBounds(p.getBounds());
    definition.setDimensionsSet(p.getRectangleDimensionsSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    definition.setFontSet(p.getFontSet());
    return BpmnNode.of(node, p);
}
Also used : RuleFlowGroup(org.kie.workbench.common.stunner.bpmn.definition.property.task.RuleFlowGroup) RuleLanguage(org.kie.workbench.common.stunner.bpmn.definition.property.task.RuleLanguage) BusinessRuleTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.BusinessRuleTaskExecutionSet) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BusinessRuleTask(org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask) TaskGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet) OnExitAction(org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction) OnEntryAction(org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction) AdHocAutostart(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Namespace(org.kie.workbench.common.stunner.bpmn.definition.property.task.Namespace) DmnModelName(org.kie.workbench.common.stunner.bpmn.definition.property.task.DmnModelName) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) DecisionName(org.kie.workbench.common.stunner.bpmn.definition.property.task.DecisionName) TaskName(org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) DecisionName(org.kie.workbench.common.stunner.bpmn.definition.property.task.DecisionName) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) BusinessRuleTaskPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.BusinessRuleTaskPropertyReader) DmnModelName(org.kie.workbench.common.stunner.bpmn.definition.property.task.DmnModelName) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync) Edge(org.kie.workbench.common.stunner.core.graph.Edge)

Aggregations

BusinessRuleTaskPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.BusinessRuleTaskPropertyReader)1 BusinessRuleTask (org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask)1 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)1 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)1 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)1 SLADueDate (org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate)1 TaskGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet)1 AdHocAutostart (org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart)1 BusinessRuleTaskExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.task.BusinessRuleTaskExecutionSet)1 DecisionName (org.kie.workbench.common.stunner.bpmn.definition.property.task.DecisionName)1 DmnModelName (org.kie.workbench.common.stunner.bpmn.definition.property.task.DmnModelName)1 IsAsync (org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync)1 Namespace (org.kie.workbench.common.stunner.bpmn.definition.property.task.Namespace)1 OnEntryAction (org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction)1 OnExitAction (org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction)1 RuleFlowGroup (org.kie.workbench.common.stunner.bpmn.definition.property.task.RuleFlowGroup)1 RuleLanguage (org.kie.workbench.common.stunner.bpmn.definition.property.task.RuleLanguage)1 TaskName (org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName)1 AdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData)1 Edge (org.kie.workbench.common.stunner.core.graph.Edge)1