public SimulationAttributeSet getSimulationSet() { return definitionResolver.resolveSimulationParameters(element.getId()) .map(SimulationAttributeSets::of) .orElse(new SimulationAttributeSet()); }
public StartCompensationEvent() { this(new BPMNGeneralSet(""), new BackgroundSet(), new FontSet(), new CircleDimensionSet(new Radius()), new SimulationAttributeSet(), new IsInterrupting(false)); }
public StartTimerEvent() { this((new BPMNGeneralSet("")), new BackgroundSet(), new FontSet(), new CircleDimensionSet(new Radius()), new SimulationAttributeSet(), new InterruptingTimerEventExecutionSet()); }
public StartNoneEvent() { this(new BPMNGeneralSet(""), new BackgroundSet(), new FontSet(), new CircleDimensionSet(new Radius()), new SimulationAttributeSet(), new IsInterrupting(true)); }
public StartConditionalEvent() { this((new BPMNGeneralSet("")), new BackgroundSet(), new FontSet(), new CircleDimensionSet(new Radius()), new SimulationAttributeSet(), new InterruptingConditionalEventExecutionSet()); }
public StartEscalationEvent() { this(new BPMNGeneralSet(""), new BackgroundSet(), new FontSet(), new CircleDimensionSet(new Radius()), new SimulationAttributeSet(), new InterruptingEscalationEventExecutionSet(), new DataIOSet()); }
public StartErrorEvent() { this(new BPMNGeneralSet(""), new BackgroundSet(), new FontSet(), new CircleDimensionSet(new Radius()), new SimulationAttributeSet(), new DataIOSet(), new InterruptingErrorEventExecutionSet()); }
public StartMessageEvent() { this(new BPMNGeneralSet(""), new BackgroundSet(), new FontSet(), new CircleDimensionSet(new Radius()), new SimulationAttributeSet(), new DataIOSet(), new InterruptingMessageEventExecutionSet()); }
public StartSignalEvent() { this(new BPMNGeneralSet(""), new BackgroundSet(), new FontSet(), new CircleDimensionSet(new Radius()), new SimulationAttributeSet(), new DataIOSet(), new InterruptingSignalEventExecutionSet()); }
public static SimulationAttributeSet of(ElementParameters eleType) { TimeParameters timeParams = eleType.getTimeParameters(); if (timeParams == null) { return new SimulationAttributeSet(); } Parameter processingTime = timeParams.getProcessingTime(); ParameterValue paramValue = processingTime.getParameterValue().get(0); return Match.of(ParameterValue.class, SimulationAttributeSet.class) .when(NormalDistributionType.class, ndt -> { SimulationAttributeSet simulationSet = new SimulationAttributeSet(); simulationSet.getMean().setValue(ndt.getMean()); simulationSet.getStandardDeviation().setValue(ndt.getStandardDeviation()); simulationSet.getDistributionType().setValue("normal"); return simulationSet; }) .when(UniformDistributionType.class, udt -> { SimulationAttributeSet simulationSet = new SimulationAttributeSet(); simulationSet.getMin().setValue(udt.getMin()); simulationSet.getMax().setValue(udt.getMax()); simulationSet.getDistributionType().setValue("uniform"); return simulationSet; }) .when(PoissonDistributionType.class, pdt -> { SimulationAttributeSet simulationSet = new SimulationAttributeSet(); simulationSet.getMean().setValue(pdt.getMean()); simulationSet.getDistributionType().setValue("poisson"); return simulationSet; }).apply(paramValue).asSuccess().value(); }
@Test public void testStartCompensationEventAndHashCode() { TestCaseBuilder.newTestCase() .addTrueCase(new StartCompensationEvent(), new StartCompensationEvent()) .addTrueCase(new StartCompensationEvent(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new IsInterrupting()), new StartCompensationEvent(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new IsInterrupting())) .addTrueCase(new StartCompensationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new IsInterrupting()), new StartCompensationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new IsInterrupting())) .addFalseCase(new StartCompensationEvent(), null) .addFalseCase(new StartCompensationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new IsInterrupting()), new StartCompensationEvent(new BPMNGeneralSet("name1", "doc1"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new IsInterrupting())) .test(); }
@Test public void testBaseStartEventEqualsAndHashCode() { TestCaseBuilder.newTestCase() .addTrueCase(new BaseStartEventStub(), new BaseStartEventStub()) .addTrueCase(new BaseStartEventStub(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet()), new BaseStartEventStub(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet())) .addFalseCase(new BaseStartEventStub(), new BaseStartEventStub(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet())) .addFalseCase(new BaseStartEventStub(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet()), new BaseStartEventStub()) .test(); }
@Test public void testStartConditionalEventEqualsAndHashCode() { TestCaseBuilder.newTestCase() .addTrueCase(new StartConditionalEvent(), new StartConditionalEvent()) .addTrueCase(new StartConditionalEvent(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingConditionalEventExecutionSet()), new StartConditionalEvent(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingConditionalEventExecutionSet())) .addFalseCase(new StartConditionalEvent(), null) .addFalseCase(new StartConditionalEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingConditionalEventExecutionSet()), new StartConditionalEvent(new BPMNGeneralSet("name1", "doc1"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingConditionalEventExecutionSet())) .addFalseCase(new StartConditionalEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingConditionalEventExecutionSet(new IsInterrupting(false), new ConditionExpression(new ScriptTypeValue("drools", "script")))), new StartConditionalEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingConditionalEventExecutionSet())) .addFalseCase(new StartConditionalEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingConditionalEventExecutionSet(new IsInterrupting(false), new ConditionExpression(new ScriptTypeValue("drools", "script")))), new StartConditionalEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingConditionalEventExecutionSet(new IsInterrupting(true), new ConditionExpression(new ScriptTypeValue("drools", "script"))))) .addFalseCase(new StartConditionalEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingConditionalEventExecutionSet(new IsInterrupting(false), new ConditionExpression(new ScriptTypeValue("drools", "script")))), new StartConditionalEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingConditionalEventExecutionSet(new IsInterrupting(false), new ConditionExpression(new ScriptTypeValue("drools1", "script"))))) .addFalseCase(new StartConditionalEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingConditionalEventExecutionSet(new IsInterrupting(false), new ConditionExpression(new ScriptTypeValue("drools", "script")))), new StartConditionalEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingConditionalEventExecutionSet(new IsInterrupting(false), new ConditionExpression(new ScriptTypeValue("drools", "script1"))))) .test(); }
new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new IsInterrupting()), new StartNoneEvent(new BPMNGeneralSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new IsInterrupting())) .addTrueCase(new StartNoneEvent(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new IsInterrupting())) .addTrueCase(new StartNoneEvent(new BPMNGeneralSet(),
@Test public void simulationSetMustHaveElementRef() { String elementId = "MY_ID"; StartEvent startEvent = bpmn2.createStartEvent(); startEvent.setId(elementId); CatchEventPropertyWriter p = new CatchEventPropertyWriter( startEvent, new FlatVariableScope()); SimulationAttributeSet defaults = new SimulationAttributeSet(); p.setSimulationSet(defaults); ElementParameters simulationParameters = p.getSimulationParameters(); assertEquals(elementId, simulationParameters.getElementRef()); } }
@Test public void testStartEscalationEventEqualsAndHashCode() { String ESCALATION_REF = "ESCALATION_REF"; String ESCALATION_REF_1 = "ESCALATION_REF_1"; TestCaseBuilder.newTestCase() .addTrueCase(new StartEscalationEvent(), new StartEscalationEvent()) .addTrueCase(new StartEscalationEvent(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingEscalationEventExecutionSet(), new DataIOSet()), new StartEscalationEvent(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingEscalationEventExecutionSet(), new DataIOSet())) .addFalseCase(new StartEscalationEvent(), null) .addFalseCase(new StartEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingEscalationEventExecutionSet(), new DataIOSet()), new StartEscalationEvent(new BPMNGeneralSet("name1", "doc1"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingEscalationEventExecutionSet(), new DataIOSet())) .addFalseCase(new StartEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingEscalationEventExecutionSet(new IsInterrupting(true), new EscalationRef(ESCALATION_REF)), new DataIOSet()), new StartEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingEscalationEventExecutionSet(new IsInterrupting(false), new EscalationRef(ESCALATION_REF)), new DataIOSet())) .addFalseCase(new StartEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingEscalationEventExecutionSet(new IsInterrupting(true), new EscalationRef(ESCALATION_REF)), new DataIOSet()), new StartEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingEscalationEventExecutionSet(new IsInterrupting(true), new EscalationRef(ESCALATION_REF_1)), new DataIOSet())) .addFalseCase(new StartEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingEscalationEventExecutionSet(new IsInterrupting(false), new EscalationRef(ESCALATION_REF)), new DataIOSet()), new StartEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingEscalationEventExecutionSet(new IsInterrupting(false), new EscalationRef(ESCALATION_REF)), new DataIOSet("data"))) .addFalseCase(new StartEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingEscalationEventExecutionSet(new IsInterrupting(false), new EscalationRef(ESCALATION_REF)), new DataIOSet("data")), new StartEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingEscalationEventExecutionSet(null, new EscalationRef(ESCALATION_REF)), new DataIOSet())) .addFalseCase(new StartEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingEscalationEventExecutionSet(new IsInterrupting(false), new EscalationRef(ESCALATION_REF)), new DataIOSet("data")), new StartEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingEscalationEventExecutionSet(new IsInterrupting(false), null), new DataIOSet())) .addFalseCase(new StartEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingEscalationEventExecutionSet(new IsInterrupting(false), new EscalationRef(ESCALATION_REF)), new DataIOSet("data")), new StartEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new SimulationAttributeSet(), new InterruptingEscalationEventExecutionSet(new IsInterrupting(false), new EscalationRef(ESCALATION_REF)), null)) .test(); }
public static SimulationAttributeSet simulationAttributeSet(ElementParameters eleType) { SimulationAttributeSet simulationSet = new SimulationAttributeSet(); TimeParameters timeParams = eleType.getTimeParameters(); if (timeParams == null) { return simulationSet; } Parameter processingTime = timeParams.getProcessingTime(); ParameterValue paramValue = processingTime.getParameterValue().get(0); return Match.of(ParameterValue.class, SimulationAttributeSet.class) .when(NormalDistributionType.class, ndt -> { simulationSet.getMean().setValue(ndt.getMean()); simulationSet.getStandardDeviation().setValue(ndt.getStandardDeviation()); simulationSet.getDistributionType().setValue("normal"); return simulationSet; }) .when(UniformDistributionType.class, udt -> { simulationSet.getMin().setValue(udt.getMin()); simulationSet.getMax().setValue(udt.getMax()); simulationSet.getDistributionType().setValue("uniform"); return simulationSet; }) .when(PoissonDistributionType.class, pdt -> { simulationSet.getMean().setValue(pdt.getMean()); simulationSet.getDistributionType().setValue("poisson"); return simulationSet; }).apply(paramValue).asSuccess().value(); }