Search in sources :

Example 1 with ParsedAssignmentsInfo

use of org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo 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());
}
Also used : AssociationList(org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.AssociationList) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) ParsedAssignmentsInfo(org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo) ParsedAssignmentsInfo(org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo) DeclarationList(org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.DeclarationList)

Example 2 with ParsedAssignmentsInfo

use of org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo in project kie-wb-common by kiegroup.

the class ParsedAssignmentsInfoTest method assertParseUnparse.

private void assertParseUnparse(String original) {
    ParsedAssignmentsInfo assignmentsInfo = ParsedAssignmentsInfo.fromString(original);
    String s1 = assignmentsInfo.toString();
    String s2 = ParsedAssignmentsInfo.fromString(s1).toString();
    assertEquals(original, s2);
}
Also used : ParsedAssignmentsInfo(org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo)

Example 3 with ParsedAssignmentsInfo

use of org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo in project kie-wb-common by kiegroup.

the class BPMNDirectDiagramMarshallerTest method testUnmarshallTravels.

@Test
public void testUnmarshallTravels() throws Exception {
    final Diagram<Graph, Metadata> diagram = unmarshall(BPMN_TRAVELS);
    // User Task 1
    Node<? extends View, ?> userTask1Node = diagram.getGraph().getNode("UserTask_1");
    UserTask userTask1 = (UserTask) userTask1Node.getContent().getDefinition();
    ParsedAssignmentsInfo parsedAssignmentsInfo = ParsedAssignmentsInfo.fromString(userTask1.getExecutionSet().getAssignmentsinfo().getValue());
    assertDataTye("org.acme.travels.Trip", "trip", parsedAssignmentsInfo.getInputs());
    assertDataTye("org.acme.travels.Traveller", "traveller", parsedAssignmentsInfo.getInputs());
    assertDataTye("java.lang.Boolean", "Skippable", parsedAssignmentsInfo.getInputs());
    assertDataTye("java.lang.Integer", "Priority", parsedAssignmentsInfo.getInputs());
    assertDataTye("java.lang.String", "Comment", parsedAssignmentsInfo.getInputs());
    // Business Rule 1
    Node<? extends View, ?> businessRuleTaskNode = diagram.getGraph().getNode("BusinessRuleTask_1");
    BusinessRuleTask businessRuleTask1 = (BusinessRuleTask) businessRuleTaskNode.getContent().getDefinition();
    ParsedAssignmentsInfo businessRuleParsedAssignmentsInfo = ParsedAssignmentsInfo.fromString(businessRuleTask1.getDataIOSet().getAssignmentsinfo().getValue());
    assertDataTye("org.acme.travels.Traveller", "traveller", businessRuleParsedAssignmentsInfo.getInputs());
    assertDataTye("org.acme.travels.Trip", "trip", businessRuleParsedAssignmentsInfo.getInputs());
    assertDataTye("org.acme.travels.Trip", "trip", businessRuleParsedAssignmentsInfo.getOutputs());
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) UserTask(org.kie.workbench.common.stunner.bpmn.definition.UserTask) BusinessRuleTask(org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask) ParsedAssignmentsInfo(org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo) Test(org.junit.Test)

Example 4 with ParsedAssignmentsInfo

use of org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo in project kie-wb-common by kiegroup.

the class AssignmentsInfos method parsed.

public static ParsedAssignmentsInfo parsed(List<DataInput> datainput, List<DataInputAssociation> inputAssociations, List<DataOutput> dataoutput, List<DataOutputAssociation> outputAssociations, boolean alternativeEncoding) {
    DeclarationList inputs = dataInputDeclarations(datainput);
    DeclarationList outputs = dataOutputDeclarations(dataoutput);
    AssociationList associations = new AssociationList(inAssociationDeclarations(inputAssociations), outAssociationDeclarations(outputAssociations));
    return new ParsedAssignmentsInfo(inputs, outputs, associations, alternativeEncoding);
}
Also used : AssociationList(org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.AssociationList) ParsedAssignmentsInfo(org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo) DeclarationList(org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.DeclarationList)

Example 5 with ParsedAssignmentsInfo

use of org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo in project kie-wb-common by kiegroup.

the class ParsedAssignmentsInfoTest method testAssertParseUnparse.

private void testAssertParseUnparse(String original) {
    ParsedAssignmentsInfo assignmentsInfo = ParsedAssignmentsInfo.fromString(original);
    String s1 = assignmentsInfo.toString();
    String s2 = ParsedAssignmentsInfo.fromString(s1).toString();
    assertEquals(original, s2);
}
Also used : ParsedAssignmentsInfo(org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo)

Aggregations

ParsedAssignmentsInfo (org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo)10 DataInput (org.eclipse.bpmn2.DataInput)3 DataOutput (org.eclipse.bpmn2.DataOutput)3 DataInputAssociation (org.eclipse.bpmn2.DataInputAssociation)2 DataOutputAssociation (org.eclipse.bpmn2.DataOutputAssociation)2 Test (org.junit.Test)2 AssociationList (org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.AssociationList)2 DeclarationList (org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.DeclarationList)2 InitializedInputVariable (org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.InitializedVariable.InitializedInputVariable)2 InitializedOutputVariable (org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.InitializedVariable.InitializedOutputVariable)2 ArrayList (java.util.ArrayList)1 InputOutputSpecification (org.eclipse.bpmn2.InputOutputSpecification)1 BusinessRuleTask (org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask)1 UserTask (org.kie.workbench.common.stunner.bpmn.definition.UserTask)1 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)1 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)1 Graph (org.kie.workbench.common.stunner.core.graph.Graph)1