Search in sources :

Example 1 with InputConstant

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

the class InitializedVariableTest method urlDecodeConstants.

@Test
public void urlDecodeConstants() throws UnsupportedEncodingException {
    String expected = "<<<#!!!#>>>";
    String encoded = URLEncoder.encode(expected, "UTF-8");
    VariableDeclaration variable = new VariableDeclaration("PARENT_ID", "Object");
    InputConstant c = (InputConstant) createCustomInput("PARENT", variable, encoded);
    Assignment assignment = c.getDataInputAssociation().getAssignment().get(0);
    FormalExpression to = (FormalExpression) assignment.getTo();
    assertEquals(Ids.dataInput("PARENT", "PARENT_ID"), to.getBody());
    FormalExpression from = (FormalExpression) assignment.getFrom();
    assertEquals(asCData(expected), from.getBody());
}
Also used : Assignment(org.eclipse.bpmn2.Assignment) VariableDeclaration(org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.VariableDeclaration) InputConstant(org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.InitializedVariable.InputConstant) FormalExpression(org.eclipse.bpmn2.FormalExpression) Test(org.junit.Test)

Aggregations

Assignment (org.eclipse.bpmn2.Assignment)1 FormalExpression (org.eclipse.bpmn2.FormalExpression)1 Test (org.junit.Test)1 InputConstant (org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.InitializedVariable.InputConstant)1 VariableDeclaration (org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.VariableDeclaration)1