Search in sources :

Example 31 with SLADueDate

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

the class ProcessMessageRefProviderTest method mockIntermediateMessageEventCatchingNode.

private Element mockIntermediateMessageEventCatchingNode(String messageRefValue) {
    IntermediateMessageEventCatching event = new IntermediateMessageEventCatching();
    event.setExecutionSet(new CancellingMessageEventExecutionSet(new CancelActivity(true), new SLADueDate(), new MessageRef(messageRefValue, "")));
    return mockNode(event);
}
Also used : SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) IntermediateMessageEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching) CancellingMessageEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.CancellingMessageEventExecutionSet) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)

Example 32 with SLADueDate

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

the class DefinitionsConverterTest method JBPM_7526_shouldSetExporter.

@Test
public void JBPM_7526_shouldSetExporter() {
    GraphNodeStoreImpl nodeStore = new GraphNodeStoreImpl();
    NodeImpl x = new NodeImpl("x");
    BPMNDiagramImpl diag = new BPMNDiagramImpl();
    diag.setDiagramSet(new DiagramSet(new Name("x"), new Documentation("doc"), new Id("x"), new Package("org.jbpm"), new ProcessType(), new Version("1.0"), new AdHoc(false), new ProcessInstanceDescription("descr"), new Imports(), new Executable(true), new SLADueDate("")));
    x.setContent(new ViewImpl<>(diag, Bounds.create()));
    nodeStore.add(x);
    ConverterFactory f = new ConverterFactory(new DefinitionsBuildingContext(new GraphImpl("x", nodeStore)), new PropertyWriterFactory());
    DefinitionsConverter definitionsConverter = new DefinitionsConverter(f, new PropertyWriterFactory());
    Definitions definitions = definitionsConverter.toDefinitions();
    assertThat(definitions.getExporter()).isNotBlank();
    assertThat(definitions.getExporterVersion()).isNotBlank();
}
Also used : NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) Definitions(org.eclipse.bpmn2.Definitions) ProcessInstanceDescription(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.ProcessInstanceDescription) Imports(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.Imports) PropertyWriterFactory(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriterFactory) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) GraphNodeStoreImpl(org.kie.workbench.common.stunner.core.graph.store.GraphNodeStoreImpl) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) ProcessType(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.ProcessType) Version(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Version) DiagramSet(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet) GraphImpl(org.kie.workbench.common.stunner.core.graph.impl.GraphImpl) BPMNDiagramImpl(org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl) Id(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Id) Package(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Package) AdHoc(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.AdHoc) Executable(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Executable) Test(org.junit.Test)

Example 33 with SLADueDate

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

the class ReusableSubprocessConverterTest method testToFlowElement.

@Test
public void testToFlowElement() {
    final ReusableSubprocess definition = new ReusableSubprocess();
    definition.getExecutionSet().setSlaDueDate(new SLADueDate(SLA_DUE_DATE));
    definition.getExecutionSet().setIsAsync(new IsAsync(Boolean.TRUE));
    final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, Bounds.create());
    final Node<View<BaseReusableSubprocess>, ?> node = new NodeImpl<>(java.util.UUID.randomUUID().toString());
    node.setContent(view);
    final PropertyWriter propertyWriter = tested.toFlowElement(node);
    assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter));
    assertTrue(CustomElement.async.of(propertyWriter.getFlowElement()).get());
    assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter));
    assertTrue(CustomElement.slaDueDate.of(propertyWriter.getFlowElement()).get().contains(SLA_DUE_DATE));
}
Also used : CallActivityPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CallActivityPropertyWriter) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) ReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess) BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) ViewImpl(org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync) View(org.kie.workbench.common.stunner.core.graph.content.view.View) CallActivityPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CallActivityPropertyWriter) PropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriter) Test(org.junit.Test)

Example 34 with SLADueDate

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

the class ReusableSubprocessConverterTest method setUp.

@Before
public void setUp() {
    when(propertyWriterFactory.of(any(CallActivity.class))).thenReturn(propertyWriter);
    DataIOSet ioSet = mock(DataIOSet.class);
    when(ioSet.getAssignmentsinfo()).thenReturn(ASSIGNMENTS_INFO);
    final ReusableSubprocess definition = new ReusableSubprocess(new BPMNGeneralSet(NAME, DOCUMENTATION), new ReusableSubprocessTaskExecutionSet(new CalledElement(CALLED_ELEMENT), new IsCase(IS_CASE), new Independent(INDEPENDENT), new AbortParent(ABORT_PARENT), new WaitForCompletion(WAIT_FOR_COMPLETION), new IsAsync(IS_ASYNC), new AdHocAutostart(IS_ADHOC_AUTOSTART), new IsMultipleInstance(IS_MULTIPLE_INSTANCE), new MultipleInstanceExecutionMode(SEQUENTIAL), new MultipleInstanceCollectionInput(COLLECTION_INPUT), new MultipleInstanceDataInput(DATA_INPUT), new MultipleInstanceCollectionOutput(COLLECTION_OUTPUT), new MultipleInstanceDataOutput(DATA_OUTPUT), new MultipleInstanceCompletionCondition(COMPLETION_CONDITION), ON_ENTRY_ACTION, ON_EXIT_ACTION, new SLADueDate(SLA_DUE_DATE)), ioSet, new BackgroundSet(), new FontSet(), new RectangleDimensionsSet(), SIMULATION_SET, new AdvancedData());
    final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, BOUNDS);
    node = new NodeImpl<>(UUID);
    node.setContent(view);
    converter = new ReusableSubprocessConverter(propertyWriterFactory);
}
Also used : BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) MultipleInstanceCollectionOutput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionOutput) CallActivity(org.eclipse.bpmn2.CallActivity) AdHocAutostart(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart) WaitForCompletion(org.kie.workbench.common.stunner.bpmn.definition.property.task.WaitForCompletion) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) FontSet(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet) AbortParent(org.kie.workbench.common.stunner.bpmn.definition.property.task.AbortParent) ViewImpl(org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl) MultipleInstanceExecutionMode(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceExecutionMode) IsCase(org.kie.workbench.common.stunner.bpmn.definition.property.subProcess.IsCase) ReusableSubprocessTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.ReusableSubprocessTaskExecutionSet) MultipleInstanceDataOutput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataOutput) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) RectangleDimensionsSet(org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet) Independent(org.kie.workbench.common.stunner.bpmn.definition.property.task.Independent) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) MultipleInstanceCompletionCondition(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCompletionCondition) BackgroundSet(org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet) ReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess) BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) IsMultipleInstance(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance) MultipleInstanceCollectionInput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionInput) MultipleInstanceDataInput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataInput) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync) CalledElement(org.kie.workbench.common.stunner.bpmn.definition.property.task.CalledElement) Before(org.junit.Before)

Example 35 with SLADueDate

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

the class SubProcessConverterTest method setBaseSubprocessExecutionSetValues.

private static void setBaseSubprocessExecutionSetValues(BaseSubprocessTaskExecutionSet executionSet) {
    executionSet.setIsAsync(new IsAsync(Boolean.TRUE));
    executionSet.setSlaDueDate(new SLADueDate(SLA_DUE_DATE));
}
Also used : SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync)

Aggregations

SLADueDate (org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate)64 Test (org.junit.Test)31 AdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData)28 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)26 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)26 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)23 View (org.kie.workbench.common.stunner.core.graph.content.view.View)22 Edge (org.kie.workbench.common.stunner.core.graph.Edge)21 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)19 CancelActivity (org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)18 IsAsync (org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync)18 CatchEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader)15 IsInterrupting (org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting)15 OnEntryAction (org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction)14 OnExitAction (org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction)14 AdHocAutostart (org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart)12 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)11 IsMultipleInstance (org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance)10 ScriptTypeValue (org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue)10 MultipleInstanceCollectionInput (org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionInput)9