use of org.eclipse.bpmn2.Association in project kie-wb-common by kiegroup.
the class Bpmn2JsonMarshaller method writeAssociations.
private void writeAssociations(Process process, String elementId, JsonGenerator generator) throws IOException {
for (Artifact artifact : process.getArtifacts()) {
if (artifact instanceof Association) {
Association association = (Association) artifact;
if (association.getSourceRef().getId().equals(elementId)) {
generator.writeStartObject();
generator.writeObjectField("resourceId", association.getId());
generator.writeEndObject();
}
}
}
}
use of org.eclipse.bpmn2.Association in project kie-wb-common by kiegroup.
the class CustomInput method input.
private DataInputAssociation input(Object value) {
// first we declare the type of this assignment
// // then we declare the input that will provide
// // the value that we assign to `source`
// // e.g. myInput
DataInput target = readInputFrom(inputDefinition.name(), typeDef);
Assignment assignment = assignment(value.toString(), target.getId());
// then we create the actual association between the two
// e.g. foo := myInput (or, to put it differently, myInput -> foo)
DataInputAssociation association = associationOf(assignment, target);
return association;
}
use of org.eclipse.bpmn2.Association in project kie-wb-common by kiegroup.
the class DMNMarshallerTest method checkAssociationsGraph.
private void checkAssociationsGraph(Graph<?, Node<?, ?>> g) {
Node<?, ?> inputData = g.getNode("BD168F8B-4398-4478-8BEA-E67AA5F90FAF");
assertNodeContentDefinitionIs(inputData, InputData.class);
Node<?, ?> decision = g.getNode("A960E2D2-FBC1-4D11-AA33-064F6A0B5CB9");
assertNodeContentDefinitionIs(decision, Decision.class);
Node<?, ?> knowledgeSource = g.getNode("FB99ED65-BC43-4750-999F-7FE24690845B");
assertNodeContentDefinitionIs(knowledgeSource, KnowledgeSource.class);
Node<?, ?> bkm = g.getNode("2F07453C-854F-436F-8378-4CFCE63BB124");
assertNodeContentDefinitionIs(bkm, BusinessKnowledgeModel.class);
Node<?, ?> textAnnotation = g.getNode("7F4B8130-6F3D-4A16-9F6C-01D01DA481D2");
assertNodeContentDefinitionIs(textAnnotation, TextAnnotation.class);
Edge fromInput = assertNodeEdgesTo(inputData, textAnnotation, Association.class);
assertEquals("From Input", ((View<Association>) fromInput.getContent()).getDefinition().getDescription().getValue());
Edge fromDecision = assertNodeEdgesTo(decision, textAnnotation, Association.class);
assertEquals("From Decision", ((View<Association>) fromDecision.getContent()).getDefinition().getDescription().getValue());
Edge fromBkm = assertNodeEdgesTo(bkm, textAnnotation, Association.class);
assertEquals("From BKM", ((View<Association>) fromBkm.getContent()).getDefinition().getDescription().getValue());
Edge fromKnowledgeSource = assertNodeEdgesTo(knowledgeSource, textAnnotation, Association.class);
assertEquals("From Knowledge Source", ((View<Association>) fromKnowledgeSource.getContent()).getDefinition().getDescription().getValue());
}
use of org.eclipse.bpmn2.Association in project drools by kiegroup.
the class AssociationConverter method writeChildren.
@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
super.writeChildren(writer, context, parent);
Association a = (Association) parent;
writeChildrenNode(writer, context, a.getSourceRef(), SOURCE_REF);
writeChildrenNode(writer, context, a.getTargetRef(), TARGET_REF);
}
use of org.eclipse.bpmn2.Association in project drools by kiegroup.
the class AssociationConverter method writeAttributes.
@Override
protected void writeAttributes(HierarchicalStreamWriter writer, Object parent) {
super.writeAttributes(writer, parent);
Association a = (Association) parent;
if (a.getAssociationDirection() != null)
writer.addAttribute(ASSOCIATION_DIRECTION, a.getAssociationDirection().value());
}
Aggregations