Search in sources :

Example 31 with AdvancedData

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

the class IntermediateCatchEventConverterTest method setUp.

@Before
public void setUp() {
    Event boundaryEvent = bpmn2.createBoundaryEvent();
    boundaryEventPropertyWriter = spy(new BoundaryEventPropertyWriter((BoundaryEvent) spy(boundaryEvent), new FlatVariableScope(), new HashSet<>()));
    // when(boundaryEventPropertyWriter.getFlowElement()).thenReturn(spy(FlowElement.class));
    Event catchEvent = bpmn2.createIntermediateCatchEvent();
    catchEventPropertyWriter = spy(new CatchEventPropertyWriter((CatchEvent) spy(catchEvent), new FlatVariableScope(), new HashSet<>()));
    propertyWriterFactory = spy(PropertyWriterFactory.class);
    when(propertyWriterFactory.of(any(BoundaryEvent.class))).thenReturn(boundaryEventPropertyWriter);
    when(propertyWriterFactory.of(any(CatchEvent.class))).thenReturn(catchEventPropertyWriter);
    generalSet = new BPMNGeneralSet(NAME, DOCUMENTATION);
    assignmentsInfo = new AssignmentsInfo(ASSIGNMENTS_INFO);
    dataIOSet = new DataIOSet(assignmentsInfo);
    advancedData = new AdvancedData();
    slaDueDate = mock(SLADueDate.class);
    errorRef = mock(ErrorRef.class);
    signalRef = mock(SignalRef.class);
    linkRef = mock(LinkRef.class);
    timerSettingsValue = mock(TimerSettingsValue.class);
    timerSettings = new TimerSettings(timerSettingsValue);
    messageRef = mock(MessageRef.class);
    scriptTypeValue = mock(ScriptTypeValue.class);
    conditionExpression = new ConditionExpression(scriptTypeValue);
    escalationRef = mock(EscalationRef.class);
    tested = spy(new IntermediateCatchEventConverter(propertyWriterFactory));
}
Also used : SignalRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef) TimerSettings(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettings) BoundaryEvent(org.eclipse.bpmn2.BoundaryEvent) TimerSettingsValue(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) CatchEvent(org.eclipse.bpmn2.CatchEvent) IntermediateCatchEvent(org.eclipse.bpmn2.IntermediateCatchEvent) PropertyWriterFactory(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriterFactory) 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) CatchEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter) ConditionExpression(org.kie.workbench.common.stunner.bpmn.definition.property.common.ConditionExpression) IntermediateCompensationEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent) BaseCatchingIntermediateEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseCatchingIntermediateEvent) Event(org.eclipse.bpmn2.Event) IntermediateTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent) CatchEvent(org.eclipse.bpmn2.CatchEvent) BoundaryEvent(org.eclipse.bpmn2.BoundaryEvent) IntermediateConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent) IntermediateCatchEvent(org.eclipse.bpmn2.IntermediateCatchEvent) IntermediateEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateEscalationEvent) FlatVariableScope(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.FlatVariableScope) ErrorRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef) EscalationRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef) BoundaryEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.BoundaryEventPropertyWriter) LinkRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkRef) ScriptTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue) Before(org.junit.Before)

Example 32 with AdvancedData

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

the class BaseTaskConverter method scriptTask.

private BpmnNode scriptTask(org.eclipse.bpmn2.ScriptTask task) {
    Node<View<ScriptTask>, Edge> node = factoryManager.newNode(task.getId(), ScriptTask.class);
    ScriptTask definition = node.getContent().getDefinition();
    ScriptTaskPropertyReader p = propertyReaderFactory.of(task);
    definition.setGeneral(new TaskGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setExecutionSet(new ScriptTaskExecutionSet(new Script(p.getScript()), new IsAsync(p.isAsync()), new AdHocAutostart(p.isAdHocAutoStart())));
    node.getContent().setBounds(p.getBounds());
    definition.setDimensionsSet(p.getRectangleDimensionsSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    definition.setFontSet(p.getFontSet());
    definition.setSimulationSet(p.getSimulationSet());
    definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
    return BpmnNode.of(node, p);
}
Also used : Script(org.kie.workbench.common.stunner.bpmn.definition.property.task.Script) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) TaskGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet) AdHocAutostart(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart) View(org.kie.workbench.common.stunner.core.graph.content.view.View) ScriptTaskPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ScriptTaskPropertyReader) DmnModelName(org.kie.workbench.common.stunner.bpmn.definition.property.task.DmnModelName) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) DecisionName(org.kie.workbench.common.stunner.bpmn.definition.property.task.DecisionName) TaskName(org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) ScriptTask(org.kie.workbench.common.stunner.bpmn.definition.ScriptTask) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync) Edge(org.kie.workbench.common.stunner.core.graph.Edge) ScriptTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTaskExecutionSet)

Example 33 with AdvancedData

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

the class BaseTaskConverter method businessRuleTask.

private BpmnNode businessRuleTask(org.eclipse.bpmn2.BusinessRuleTask task) {
    Node<View<BusinessRuleTask>, Edge> node = factoryManager.newNode(task.getId(), BusinessRuleTask.class);
    BusinessRuleTask definition = node.getContent().getDefinition();
    BusinessRuleTaskPropertyReader p = propertyReaderFactory.of(task);
    definition.setGeneral(new TaskGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
    RuleLanguage ruleLanguage = new RuleLanguage(p.getImplementation());
    RuleFlowGroup ruleFlowGroup = null;
    Namespace namespace = null;
    DecisionName decisionName = null;
    DmnModelName dmnModelName = null;
    if (ruleLanguage.getValue().equals(RuleLanguage.DRL)) {
        ruleFlowGroup = new RuleFlowGroup(p.getRuleFlowGroup());
        namespace = new Namespace();
        decisionName = new DecisionName();
        dmnModelName = new DmnModelName();
    } else if (ruleLanguage.getValue().equals(RuleLanguage.DMN)) {
        ruleFlowGroup = new RuleFlowGroup();
        namespace = new Namespace(p.getNamespace());
        decisionName = new DecisionName(p.getDecisionName());
        dmnModelName = new DmnModelName(p.getDmnModelName());
    }
    definition.setExecutionSet(new BusinessRuleTaskExecutionSet(new RuleLanguage(p.getImplementation()), ruleFlowGroup, namespace, decisionName, dmnModelName, new OnEntryAction(p.getOnEntryAction()), new OnExitAction(p.getOnExitAction()), new IsAsync(p.isAsync()), new AdHocAutostart(p.isAdHocAutoStart()), new SLADueDate(p.getSlaDueDate())));
    definition.setSimulationSet(p.getSimulationSet());
    definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
    node.getContent().setBounds(p.getBounds());
    definition.setDimensionsSet(p.getRectangleDimensionsSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    definition.setFontSet(p.getFontSet());
    return BpmnNode.of(node, p);
}
Also used : RuleFlowGroup(org.kie.workbench.common.stunner.bpmn.definition.property.task.RuleFlowGroup) RuleLanguage(org.kie.workbench.common.stunner.bpmn.definition.property.task.RuleLanguage) BusinessRuleTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.BusinessRuleTaskExecutionSet) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BusinessRuleTask(org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask) TaskGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet) OnExitAction(org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction) OnEntryAction(org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction) AdHocAutostart(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Namespace(org.kie.workbench.common.stunner.bpmn.definition.property.task.Namespace) DmnModelName(org.kie.workbench.common.stunner.bpmn.definition.property.task.DmnModelName) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) DecisionName(org.kie.workbench.common.stunner.bpmn.definition.property.task.DecisionName) TaskName(org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) DecisionName(org.kie.workbench.common.stunner.bpmn.definition.property.task.DecisionName) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) BusinessRuleTaskPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.BusinessRuleTaskPropertyReader) DmnModelName(org.kie.workbench.common.stunner.bpmn.definition.property.task.DmnModelName) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync) Edge(org.kie.workbench.common.stunner.core.graph.Edge)

Example 34 with AdvancedData

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

the class BaseTaskConverter method jbpmServiceTask.

private BpmnNode jbpmServiceTask(org.eclipse.bpmn2.Task task) {
    final ServiceTaskPropertyReader serviceTaskPropertyReader = propertyReaderFactory.ofCustom(task);
    final Node<View<CustomTask>, Edge> node = factoryManager.newNode(task.getId(), CustomTask.class);
    final CustomTask definition = node.getContent().getDefinition();
    definition.setName(serviceTaskPropertyReader.getServiceTaskName());
    definition.getTaskType().setRawType(serviceTaskPropertyReader.getServiceTaskName());
    definition.setDescription(serviceTaskPropertyReader.getServiceTaskDescription());
    definition.setCategory(serviceTaskPropertyReader.getServiceTaskCategory());
    definition.setDefaultHandler(serviceTaskPropertyReader.getServiceTaskDefaultHandler());
    definition.setGeneral(new TaskGeneralSet(new Name(serviceTaskPropertyReader.getName()), new Documentation(serviceTaskPropertyReader.getDocumentation())));
    definition.setDataIOSet(new DataIOSet(serviceTaskPropertyReader.getAssignmentsInfo()));
    definition.setExecutionSet(new CustomTaskExecutionSet(new TaskName(serviceTaskPropertyReader.getTaskName()), new IsAsync(serviceTaskPropertyReader.isAsync()), new AdHocAutostart(serviceTaskPropertyReader.isAdHocAutoStart()), new OnEntryAction(serviceTaskPropertyReader.getOnEntryAction()), new OnExitAction(serviceTaskPropertyReader.getOnExitAction()), new SLADueDate(serviceTaskPropertyReader.getSlaDueDate())));
    definition.setSimulationSet(serviceTaskPropertyReader.getSimulationSet());
    definition.setAdvancedData(new AdvancedData(serviceTaskPropertyReader.getMetaDataAttributes()));
    node.getContent().setBounds(serviceTaskPropertyReader.getBounds());
    definition.setDimensionsSet(serviceTaskPropertyReader.getRectangleDimensionsSet());
    definition.setBackgroundSet(serviceTaskPropertyReader.getBackgroundSet());
    definition.setFontSet(serviceTaskPropertyReader.getFontSet());
    return BpmnNode.of(node, serviceTaskPropertyReader);
}
Also used : ServiceTaskPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ServiceTaskPropertyReader) GenericServiceTaskPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.GenericServiceTaskPropertyReader) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) CustomTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.workitem.CustomTaskExecutionSet) TaskGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet) OnExitAction(org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction) AdHocAutostart(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart) OnEntryAction(org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction) View(org.kie.workbench.common.stunner.core.graph.content.view.View) DmnModelName(org.kie.workbench.common.stunner.bpmn.definition.property.task.DmnModelName) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) DecisionName(org.kie.workbench.common.stunner.bpmn.definition.property.task.DecisionName) TaskName(org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName) 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) TaskName(org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName) CustomTask(org.kie.workbench.common.stunner.bpmn.workitem.CustomTask) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync) Edge(org.kie.workbench.common.stunner.core.graph.Edge)

Example 35 with AdvancedData

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

the class ReusableSubprocessConverterTest method setUp.

@Before
public void setUp() {
    when(propertyWriterFactory.of(any(CallActivity.class))).thenReturn(propertyWriter);
    DataIOSet ioSet = mock(DataIOSet.class);
    when(ioSet.getAssignmentsinfo()).thenReturn(ASSIGNMENTS_INFO);
    final ReusableSubprocess definition = new ReusableSubprocess(new BPMNGeneralSet(NAME, DOCUMENTATION), new ReusableSubprocessTaskExecutionSet(new CalledElement(CALLED_ELEMENT), new IsCase(IS_CASE), new Independent(INDEPENDENT), new AbortParent(ABORT_PARENT), new WaitForCompletion(WAIT_FOR_COMPLETION), new IsAsync(IS_ASYNC), new AdHocAutostart(IS_ADHOC_AUTOSTART), new IsMultipleInstance(IS_MULTIPLE_INSTANCE), new MultipleInstanceExecutionMode(SEQUENTIAL), new MultipleInstanceCollectionInput(COLLECTION_INPUT), new MultipleInstanceDataInput(DATA_INPUT), new MultipleInstanceCollectionOutput(COLLECTION_OUTPUT), new MultipleInstanceDataOutput(DATA_OUTPUT), new MultipleInstanceCompletionCondition(COMPLETION_CONDITION), ON_ENTRY_ACTION, ON_EXIT_ACTION, new SLADueDate(SLA_DUE_DATE)), ioSet, new BackgroundSet(), new FontSet(), new RectangleDimensionsSet(), SIMULATION_SET, new AdvancedData());
    final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, BOUNDS);
    node = new NodeImpl<>(UUID);
    node.setContent(view);
    converter = new ReusableSubprocessConverter(propertyWriterFactory);
}
Also used : BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) MultipleInstanceCollectionOutput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionOutput) CallActivity(org.eclipse.bpmn2.CallActivity) AdHocAutostart(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart) WaitForCompletion(org.kie.workbench.common.stunner.bpmn.definition.property.task.WaitForCompletion) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) FontSet(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet) AbortParent(org.kie.workbench.common.stunner.bpmn.definition.property.task.AbortParent) ViewImpl(org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl) MultipleInstanceExecutionMode(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceExecutionMode) IsCase(org.kie.workbench.common.stunner.bpmn.definition.property.subProcess.IsCase) ReusableSubprocessTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.ReusableSubprocessTaskExecutionSet) MultipleInstanceDataOutput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataOutput) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) RectangleDimensionsSet(org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet) Independent(org.kie.workbench.common.stunner.bpmn.definition.property.task.Independent) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) MultipleInstanceCompletionCondition(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCompletionCondition) BackgroundSet(org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet) ReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess) BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) IsMultipleInstance(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance) MultipleInstanceCollectionInput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionInput) MultipleInstanceDataInput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataInput) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync) CalledElement(org.kie.workbench.common.stunner.bpmn.definition.property.task.CalledElement) Before(org.junit.Before)

Aggregations

AdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData)70 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)51 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)50 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)49 Edge (org.kie.workbench.common.stunner.core.graph.Edge)47 View (org.kie.workbench.common.stunner.core.graph.content.view.View)47 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)34 SLADueDate (org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate)28 EventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader)20 Test (org.junit.Test)18 CatchEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader)16 ThrowEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ThrowEventPropertyReader)12 BackgroundSet (org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet)11 FontSet (org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet)11 IsAsync (org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync)11 EscalationRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef)10 IsInterrupting (org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting)9 TaskName (org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName)9 CancelActivity (org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)8 TaskGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet)8