Search in sources :

Example 46 with Documentation

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

the class TaskConverterPriorityTest method setPriorityEscapeSpecialChars.

@Test
public void setPriorityEscapeSpecialChars() {
    propertyWriterFactory = new PropertyWriterFactory();
    taskConverter = spy(new TaskConverter(propertyWriterFactory));
    when(n.getContent()).thenReturn(view);
    when(view.getBounds()).thenReturn(Bounds.create(0, 0, 10, 10));
    when(view.getDefinition()).thenReturn(definition);
    when(general.getName()).thenReturn(new Name("Name"));
    when(general.getDocumentation()).thenReturn(new Documentation());
    when(definition.getGeneral()).thenReturn(general);
    when(definition.getSimulationSet()).thenReturn(new SimulationSet());
    when(definition.getExecutionSet()).thenReturn(baseUserTaskExecutionSet);
    when(baseUserTaskExecutionSet.getTaskName()).thenReturn(new TaskName("taskName"));
    when(baseUserTaskExecutionSet.getActors()).thenReturn(new Actors());
    when(baseUserTaskExecutionSet.getAssignmentsinfo()).thenReturn(new AssignmentsInfo());
    when(baseUserTaskExecutionSet.getReassignmentsInfo()).thenReturn(new ReassignmentsInfo());
    when(baseUserTaskExecutionSet.getNotificationsInfo()).thenReturn(new NotificationsInfo());
    when(baseUserTaskExecutionSet.getSkippable()).thenReturn(new Skippable(true));
    when(baseUserTaskExecutionSet.getGroupid()).thenReturn(new Groupid("groupId"));
    when(baseUserTaskExecutionSet.getSubject()).thenReturn(new Subject());
    when(baseUserTaskExecutionSet.getDescription()).thenReturn(new Description());
    when(baseUserTaskExecutionSet.getPriority()).thenReturn(new TaskPriority("#{varOne<>&\"}"));
    when(baseUserTaskExecutionSet.getIsAsync()).thenReturn(new IsAsync(true));
    when(baseUserTaskExecutionSet.getCreatedBy()).thenReturn(new CreatedBy());
    when(baseUserTaskExecutionSet.getAdHocAutostart()).thenReturn(new AdHocAutostart());
    when(baseUserTaskExecutionSet.getIsMultipleInstance()).thenReturn(new IsMultipleInstance(false));
    when(baseUserTaskExecutionSet.getOnEntryAction()).thenReturn(new OnEntryAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))));
    when(baseUserTaskExecutionSet.getOnExitAction()).thenReturn(new OnExitAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))));
    when(baseUserTaskExecutionSet.getContent()).thenReturn(new Content());
    when(baseUserTaskExecutionSet.getSlaDueDate()).thenReturn(new SLADueDate());
    when(definition.getAdvancedData()).thenReturn(new AdvancedData(new MetaDataAttributes()));
    doCallRealMethod().when(taskConverter).userTask(any());
    final UserTaskPropertyWriter propertyWriter = (UserTaskPropertyWriter) taskConverter.userTask(n);
    assertTrue(propertyWriter.getPriority().equals("<![CDATA[#{varOne&lt;&gt;&amp;&quot;}]]>"));
}
Also used : Description(org.kie.workbench.common.stunner.bpmn.definition.property.task.Description) TaskPriority(org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskPriority) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) AdHocAutostart(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart) PropertyWriterFactory(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriterFactory) NotificationsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationsInfo) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) TaskName(org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName) Groupid(org.kie.workbench.common.stunner.bpmn.definition.property.assignee.Groupid) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) UserTaskPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.UserTaskPropertyWriter) CreatedBy(org.kie.workbench.common.stunner.bpmn.definition.property.task.CreatedBy) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) Actors(org.kie.workbench.common.stunner.bpmn.definition.property.assignee.Actors) OnExitAction(org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction) OnEntryAction(org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction) Subject(org.kie.workbench.common.stunner.bpmn.definition.property.task.Subject) MetaDataAttributes(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.MetaDataAttributes) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) SimulationSet(org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationSet) TaskName(org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName) Content(org.kie.workbench.common.stunner.bpmn.definition.property.task.Content) ReassignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentsInfo) IsMultipleInstance(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance) Skippable(org.kie.workbench.common.stunner.bpmn.definition.property.task.Skippable) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync) ScriptTypeListValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue) ScriptTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue) Test(org.junit.Test)

Example 47 with Documentation

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

the class TextAnnotationTest method setDocumentation.

@Test
public void setDocumentation() {
    Documentation documentation = new Documentation(this.getClass().getSimpleName());
    tested.getGeneral().setDocumentation(documentation);
    assertEquals(documentation, tested.getGeneral().getDocumentation());
}
Also used : Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) Test(org.junit.Test)

Example 48 with Documentation

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

the class IntermediateCatchEventConverter method compensationEvent.

protected Result<BpmnNode> compensationEvent(CatchEvent event) {
    String nodeId = event.getId();
    Node<View<IntermediateCompensationEvent>, Edge> node = factoryManager.newNode(nodeId, IntermediateCompensationEvent.class);
    IntermediateCompensationEvent definition = node.getContent().getDefinition();
    CatchEventPropertyReader p = propertyReaderFactory.of(event);
    node.getContent().setBounds(p.getBounds());
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setBackgroundSet(p.getBackgroundSet());
    definition.setFontSet(p.getFontSet());
    definition.setDimensionsSet(p.getCircleDimensionSet());
    definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
    definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
    CancelActivity cancelActivity = new CancelActivity(false);
    SLADueDate slaDueDate = new SLADueDate(p.getSlaDueDate());
    BaseCancellingEventExecutionSet executionSet = new BaseCancellingEventExecutionSet(cancelActivity, slaDueDate);
    definition.setExecutionSet(executionSet);
    return Result.success(BpmnNode.of(node, p));
}
Also used : Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BaseCancellingEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.BaseCancellingEventExecutionSet) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) IntermediateCompensationEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) Edge(org.kie.workbench.common.stunner.core.graph.Edge) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)

Example 49 with Documentation

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

the class IntermediateCatchEventConverter method conditionalEvent.

protected Result<BpmnNode> conditionalEvent(CatchEvent event, ConditionalEventDefinition e) {
    String nodeId = event.getId();
    Node<View<IntermediateConditionalEvent>, Edge> node = factoryManager.newNode(nodeId, IntermediateConditionalEvent.class);
    IntermediateConditionalEvent definition = node.getContent().getDefinition();
    CatchEventPropertyReader p = propertyReaderFactory.of(event);
    node.getContent().setBounds(p.getBounds());
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setBackgroundSet(p.getBackgroundSet());
    definition.setFontSet(p.getFontSet());
    definition.setDimensionsSet(p.getCircleDimensionSet());
    definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
    definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
    definition.setExecutionSet(new CancellingConditionalEventExecutionSet(new CancelActivity(p.isCancelActivity()), new SLADueDate(p.getSlaDueDate()), p.getConditionExpression(e)));
    return Result.success(BpmnNode.of(node, p));
}
Also used : Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) IntermediateConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) CancellingConditionalEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.conditional.CancellingConditionalEventExecutionSet) Edge(org.kie.workbench.common.stunner.core.graph.Edge) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)

Example 50 with Documentation

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

the class IntermediateCatchEventConverter method escalationEvent.

protected Result<BpmnNode> escalationEvent(CatchEvent event, EscalationEventDefinition e) {
    String nodeId = event.getId();
    Node<View<IntermediateEscalationEvent>, Edge> node = factoryManager.newNode(nodeId, IntermediateEscalationEvent.class);
    IntermediateEscalationEvent definition = node.getContent().getDefinition();
    CatchEventPropertyReader p = propertyReaderFactory.of(event);
    node.getContent().setBounds(p.getBounds());
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setBackgroundSet(p.getBackgroundSet());
    definition.setFontSet(p.getFontSet());
    definition.setDimensionsSet(p.getCircleDimensionSet());
    definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
    definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
    definition.setExecutionSet(new CancellingEscalationEventExecutionSet(new CancelActivity(p.isCancelActivity()), new SLADueDate(p.getSlaDueDate()), new EscalationRef(EventDefinitionReader.escalationRefOf(e))));
    return Result.success(BpmnNode.of(node, p));
}
Also used : Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) CancellingEscalationEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.CancellingEscalationEventExecutionSet) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) IntermediateEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateEscalationEvent) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) Edge(org.kie.workbench.common.stunner.core.graph.Edge) EscalationRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)

Aggregations

Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)67 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)66 View (org.kie.workbench.common.stunner.core.graph.content.view.View)60 Edge (org.kie.workbench.common.stunner.core.graph.Edge)58 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)49 AdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData)49 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)28 SLADueDate (org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate)26 EventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader)22 CatchEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader)17 IsAsync (org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync)15 ThrowEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ThrowEventPropertyReader)13 TaskGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet)13 TaskName (org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName)13 OnEntryAction (org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction)11 OnExitAction (org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction)11 AdHocAutostart (org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart)9 CancelActivity (org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)8 IsInterrupting (org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting)8 ProcessData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData)8