use of org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo in project kie-wb-common by kiegroup.
the class AssignmentsInfos method of.
public static AssignmentsInfo of(final List<DataInput> datainput, final List<DataInputAssociation> inputAssociations, final List<DataOutput> dataoutput, final List<DataOutputAssociation> outputAssociations, boolean alternativeEncoding) {
DeclarationList inputs = dataInputDeclarations(datainput);
DeclarationList outputs = dataOutputDeclarations(dataoutput);
AssociationList associations = new AssociationList(inAssociationDeclarations(inputAssociations), outAssociationDeclarations(outputAssociations));
return new AssignmentsInfo(new ParsedAssignmentsInfo(inputs, outputs, associations, alternativeEncoding).toString());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo in project kie-wb-common by kiegroup.
the class HashCodeAndEqualityTest method testEndMessageEventEquals.
@Test
public void testEndMessageEventEquals() {
final String MESSAGE_REF = "message ref";
final MessageEventExecutionSet A_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF));
final MessageEventExecutionSet B_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF));
final MessageEventExecutionSet C_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef("Other value"));
final MessageEventExecutionSet D_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF));
final String ASSIGNMENT_INFO = "some value";
final DataIOSet A_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
final DataIOSet B_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
final DataIOSet C_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
final DataIOSet D_DATA_SET = new DataIOSet(new AssignmentsInfo("Other value"));
EndMessageEvent.EndMessageEventBuilder builder = new EndMessageEvent.EndMessageEventBuilder();
EndMessageEvent a = builder.build();
a.setExecutionSet(A_EXECUTION_SET);
a.setDataIOSet(A_DATA_SET);
builder = new EndMessageEvent.EndMessageEventBuilder();
EndMessageEvent b = builder.build();
b.setExecutionSet(B_EXECUTION_SET);
b.setDataIOSet(B_DATA_SET);
builder = new EndMessageEvent.EndMessageEventBuilder();
EndMessageEvent c = builder.build();
c.setExecutionSet(C_EXECUTION_SET);
c.setDataIOSet(C_DATA_SET);
builder = new EndMessageEvent.EndMessageEventBuilder();
EndMessageEvent d = builder.build();
d.setExecutionSet(D_EXECUTION_SET);
d.setDataIOSet(D_DATA_SET);
assertEquals(a, a);
assertEquals(a, b);
assertNotEquals(a, c);
assertNotEquals(a, d);
assertNotEquals(a, 19);
assertNotEquals(a, null);
a.setExecutionSet(null);
assertNotEquals(a, b);
assertNotEquals(b, a);
a.setExecutionSet(A_EXECUTION_SET);
assertEquals(a, b);
assertNotEquals(a, c);
assertNotEquals(a, d);
a.setDataIOSet(null);
assertNotEquals(a, b);
assertNotEquals(b, a);
assertNotEquals(a, c);
assertNotEquals(a, d);
EndSignalEvent.EndSignalEventBuilder builderSignal = new EndSignalEvent.EndSignalEventBuilder();
EndSignalEvent e = builderSignal.build();
assertNotEquals(a, e);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo in project kie-wb-common by kiegroup.
the class HashCodeAndEqualityTest method testEndSignalEventEquals.
@Test
public void testEndSignalEventEquals() {
final String SIGNAL_REF = "signal ref";
final String SIGNAL_SCOPE = "signal scope";
final ScopedSignalEventExecutionSet A_EXECUTION_SET = new ScopedSignalEventExecutionSet(new SignalRef(SIGNAL_REF), new SignalScope(SIGNAL_SCOPE));
final ScopedSignalEventExecutionSet B_EXECUTION_SET = new ScopedSignalEventExecutionSet(new SignalRef(SIGNAL_REF), new SignalScope(SIGNAL_SCOPE));
final ScopedSignalEventExecutionSet C_EXECUTION_SET = new ScopedSignalEventExecutionSet(new SignalRef("Other value"), new SignalScope(SIGNAL_SCOPE));
final ScopedSignalEventExecutionSet D_EXECUTION_SET = new ScopedSignalEventExecutionSet(new SignalRef(SIGNAL_REF), new SignalScope(SIGNAL_SCOPE));
final String ASSIGNMENT_INFO = "some value";
final DataIOSet A_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
final DataIOSet B_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
final DataIOSet C_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
final DataIOSet D_DATA_SET = new DataIOSet(new AssignmentsInfo("Other value"));
EndSignalEvent.EndSignalEventBuilder builder = new EndSignalEvent.EndSignalEventBuilder();
EndSignalEvent a = builder.build();
a.setExecutionSet(A_EXECUTION_SET);
a.setDataIOSet(A_DATA_SET);
builder = new EndSignalEvent.EndSignalEventBuilder();
EndSignalEvent b = builder.build();
b.setExecutionSet(B_EXECUTION_SET);
b.setDataIOSet(B_DATA_SET);
builder = new EndSignalEvent.EndSignalEventBuilder();
EndSignalEvent c = builder.build();
c.setExecutionSet(C_EXECUTION_SET);
c.setDataIOSet(C_DATA_SET);
builder = new EndSignalEvent.EndSignalEventBuilder();
EndSignalEvent d = builder.build();
d.setExecutionSet(D_EXECUTION_SET);
d.setDataIOSet(D_DATA_SET);
assertEquals(a, a);
assertEquals(a, b);
assertNotEquals(a, c);
assertNotEquals(a, d);
assertNotEquals(a, 19);
assertNotEquals(a, null);
a.setExecutionSet(null);
assertNotEquals(a, b);
assertNotEquals(b, a);
a.setExecutionSet(A_EXECUTION_SET);
assertEquals(a, b);
a.setDataIOSet(null);
assertNotEquals(a, b);
assertNotEquals(b, a);
EndMessageEvent.EndMessageEventBuilder builderMessage = new EndMessageEvent.EndMessageEventBuilder();
EndMessageEvent e = builderMessage.build();
assertNotEquals(a, e);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo in project kie-wb-common by kiegroup.
the class HashCodeAndEqualityTest method IntermediateMessageEventCatchingEquals.
@Test
public void IntermediateMessageEventCatchingEquals() {
final String MESSAGE_REF = "message ref";
final CancellingMessageEventExecutionSet A_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), new MessageRef(MESSAGE_REF));
final CancellingMessageEventExecutionSet B_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), new MessageRef(MESSAGE_REF));
final CancellingMessageEventExecutionSet C_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), new MessageRef("Other value"));
final CancellingMessageEventExecutionSet D_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), new MessageRef(MESSAGE_REF));
final String ASSIGNMENT_INFO = "some value";
final DataIOSet A_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
final DataIOSet B_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
final DataIOSet C_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
final DataIOSet D_DATA_SET = new DataIOSet(new AssignmentsInfo("Other value"));
IntermediateMessageEventCatching.IntermediateMessageEventCatchingBuilder builder = new IntermediateMessageEventCatching.IntermediateMessageEventCatchingBuilder();
IntermediateMessageEventCatching a = builder.build();
a.setExecutionSet(A_EXECUTION_SET);
a.setDataIOSet(A_DATA_SET);
builder = new IntermediateMessageEventCatching.IntermediateMessageEventCatchingBuilder();
IntermediateMessageEventCatching b = builder.build();
b.setExecutionSet(B_EXECUTION_SET);
b.setDataIOSet(B_DATA_SET);
builder = new IntermediateMessageEventCatching.IntermediateMessageEventCatchingBuilder();
IntermediateMessageEventCatching c = builder.build();
c.setExecutionSet(C_EXECUTION_SET);
c.setDataIOSet(C_DATA_SET);
builder = new IntermediateMessageEventCatching.IntermediateMessageEventCatchingBuilder();
IntermediateMessageEventCatching d = builder.build();
d.setExecutionSet(D_EXECUTION_SET);
d.setDataIOSet(D_DATA_SET);
assertEquals(a, a);
assertEquals(a, b);
assertNotEquals(a, c);
assertNotEquals(a, d);
assertNotEquals(a, 19);
assertNotEquals(a, null);
a.setExecutionSet(null);
assertNotEquals(a, b);
assertNotEquals(b, a);
assertNotEquals(a, c);
assertNotEquals(a, d);
a.setExecutionSet(A_EXECUTION_SET);
assertEquals(a, b);
assertNotEquals(a, c);
assertNotEquals(a, d);
a.setDataIOSet(null);
assertNotEquals(a, b);
assertNotEquals(b, a);
assertNotEquals(a, c);
assertNotEquals(a, d);
EndSignalEvent.EndSignalEventBuilder builderSignal = new EndSignalEvent.EndSignalEventBuilder();
EndSignalEvent e = builderSignal.build();
assertNotEquals(a, e);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallBusinessRuleTaskAssignments.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallBusinessRuleTaskAssignments() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_BUSINESSRULETASKASSIGNMENTS);
assertDiagram(diagram, 4);
assertEquals("BusinessRuleTaskAssignments", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> businessRuleNode = diagram.getGraph().getNode("_45C2C340-D1D0-4D63-8419-EF38F9E73507");
BusinessRuleTask businessRuleTask = (BusinessRuleTask) businessRuleNode.getContent().getDefinition();
assertEquals(businessRuleTask.getTaskType().getValue(), TaskTypes.BUSINESS_RULE);
DataIOSet dataIOSet = businessRuleTask.getDataIOSet();
AssignmentsInfo assignmentsinfo = dataIOSet.getAssignmentsinfo();
assertEquals(assignmentsinfo.getValue(), "|input1:String,input2:String||output1:String,output2:String|[din]pv1->input1,[din]pv2->input2,[dout]output1->pv2,[dout]output2->pv2");
}
Aggregations