Search in sources :

Example 6 with GenericServiceTaskValue

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

the class GenericServiceTaskEditorWidgetTest method setEmptyValue.

@Test
public void setEmptyValue() {
    GenericServiceTaskValue value = new GenericServiceTaskValue();
    widget.setValue(value);
    assertEquals(value, widget.getValue());
}
Also used : GenericServiceTaskValue(org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskValue) Test(org.junit.Test) ReflectionUtilsTest(org.kie.workbench.common.stunner.bpmn.client.forms.util.ReflectionUtilsTest)

Example 7 with GenericServiceTaskValue

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

the class BPMNDirectDiagramMarshallerTest method testUnmarshallFlightBooking.

@Test
public void testUnmarshallFlightBooking() throws Exception {
    final Diagram<Graph, Metadata> diagram = unmarshall(BPMN_FLIGHT_BOOKING);
    // User Task 1
    Node<? extends View, ?> serviceTask1Node = diagram.getGraph().getNode("ServiceTask_1");
    GenericServiceTask serviceTask1 = (GenericServiceTask) serviceTask1Node.getContent().getDefinition();
    // Assert properties from Generic Service Task
    GenericServiceTaskValue serviceTaskValue = serviceTask1.getExecutionSet().getGenericServiceTaskInfo().getValue();
    assertEquals("Java", serviceTaskValue.getServiceImplementation());
    assertEquals("org.acme.travels.service.FlightBookingService", serviceTaskValue.getServiceInterface());
    assertEquals("bookFlight", serviceTaskValue.getServiceOperation());
    assertEquals("org.acme.travels.Trip", serviceTaskValue.getInMessageStructure());
    assertEquals("org.acme.travels.Flight", serviceTaskValue.getOutMessagetructure());
    String marshalled = tested.marshall(diagram);
    assertTrue(marshalled.contains("<bpmn2:itemDefinition id=\"ServiceTask_1_InMessageType\" structureRef=\"org.acme.travels.Trip\"/>"));
    assertTrue(marshalled.contains("<bpmn2:itemDefinition id=\"ServiceTask_1_OutMessageType\" structureRef=\"org.acme.travels.Flight\"/>"));
}
Also used : GenericServiceTaskValue(org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskValue) Graph(org.kie.workbench.common.stunner.core.graph.Graph) GenericServiceTask(org.kie.workbench.common.stunner.bpmn.definition.GenericServiceTask) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Test(org.junit.Test)

Example 8 with GenericServiceTaskValue

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

the class GenericServiceTaskPropertyWriterTest method setUp.

@Before
public void setUp() {
    PropertyWriterFactory writerFactory = new PropertyWriterFactory();
    w = writerFactory.of(serviceTask);
    value = new GenericServiceTaskValue("Java", "serviceInterface", "serviceOperation", "inMessageStructure", "outMessagetructure");
}
Also used : GenericServiceTaskValue(org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskValue) Before(org.junit.Before)

Example 9 with GenericServiceTaskValue

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

the class GenericServiceTaskPropertyReaderTest method setUp.

@Before
public void setUp() {
    ServiceTask serviceTask = bpmn2.createServiceTask();
    value = new GenericServiceTaskValue("java", "serviceInterface", "serviceOperation", "inMessageStructure", "outMessageStructure");
    GenericServiceTaskPropertyWriter writer = new GenericServiceTaskPropertyWriter(serviceTask, null, new HashSet<>());
    writer.setValue(value);
    writer.setSLADueDate(SLA_DUE_DATE);
    writer.setAsync(false);
    writer.setAdHocAutostart(true);
    OnEntryAction onEntryAction = new OnEntryAction();
    onEntryAction.setValue(new ScriptTypeListValue());
    writer.setOnEntryAction(onEntryAction);
    OnExitAction onExitAction = new OnExitAction();
    onExitAction.setValue(new ScriptTypeListValue());
    writer.setOnExitAction(onExitAction);
    writer.setAssignmentsInfo(new AssignmentsInfo());
    reader = new GenericServiceTaskPropertyReader(serviceTask, diagram, definitionResolver);
}
Also used : GenericServiceTaskPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.GenericServiceTaskPropertyWriter) ServiceTask(org.eclipse.bpmn2.ServiceTask) GenericServiceTaskValue(org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskValue) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) OnExitAction(org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction) OnEntryAction(org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction) ScriptTypeListValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue) Before(org.junit.Before)

Example 10 with GenericServiceTaskValue

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

the class GenericServiceTaskEditorWidget method setValue.

@Override
public void setValue(GenericServiceTaskValue newValue, boolean fireEvents) {
    GenericServiceTaskValue oldValue = value;
    value = newValue;
    implementation.setValue(value.getServiceImplementation());
    serviceInterface.setValue(value.getServiceInterface());
    serviceOperation.setValue(value.getServiceOperation());
    if (fireEvents) {
        ValueChangeEvent.fireIfNotEqual(this, oldValue, value);
    }
}
Also used : GenericServiceTaskValue(org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskValue)

Aggregations

GenericServiceTaskValue (org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskValue)10 Test (org.junit.Test)4 Before (org.junit.Before)3 ServiceTask (org.eclipse.bpmn2.ServiceTask)2 ReflectionUtilsTest (org.kie.workbench.common.stunner.bpmn.client.forms.util.ReflectionUtilsTest)2 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)1 Optional (java.util.Optional)1 Interface (org.eclipse.bpmn2.Interface)1 ItemDefinition (org.eclipse.bpmn2.ItemDefinition)1 Message (org.eclipse.bpmn2.Message)1 Operation (org.eclipse.bpmn2.Operation)1 BPMNDiagram (org.eclipse.bpmn2.di.BPMNDiagram)1 Event (org.jboss.errai.common.client.dom.Event)1 Select (org.jboss.errai.common.client.dom.Select)1 CustomAttribute (org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.CustomAttribute)1 CustomElement (org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.CustomElement)1 GenericServiceTaskPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.GenericServiceTaskPropertyWriter)1 DefinitionResolver (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.DefinitionResolver)1 GenericServiceTask (org.kie.workbench.common.stunner.bpmn.definition.GenericServiceTask)1 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)1