Search in sources :

Example 1 with OnExitAction

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

the class TaskConverter method userTask.

private BpmnNode userTask(org.eclipse.bpmn2.UserTask task) {
    Node<View<UserTask>, Edge> node = factoryManager.newNode(task.getId(), UserTask.class);
    UserTask definition = node.getContent().getDefinition();
    UserTaskPropertyReader p = propertyReaderFactory.of(task);
    definition.setGeneral(new TaskGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setSimulationSet(p.getSimulationSet());
    definition.setExecutionSet(new UserTaskExecutionSet(new TaskName(p.getTaskName()), p.getActors(), new Groupid(p.getGroupid()), p.getAssignmentsInfo(), new IsAsync(p.isAsync()), new Skippable(p.isSkippable()), new Priority(p.getPriority()), new Subject(p.getSubject()), new Description(p.getDescription()), new CreatedBy(p.getCreatedBy()), new AdHocAutostart(p.isAdHocAutostart()), new OnEntryAction(p.getOnEntryAction()), new OnExitAction(p.getOnExitAction())));
    node.getContent().setBounds(p.getBounds());
    definition.setDimensionsSet(p.getRectangleDimensionsSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    definition.setFontSet(p.getFontSet());
    return BpmnNode.of(node);
}
Also used : Description(org.kie.workbench.common.stunner.bpmn.definition.property.task.Description) CreatedBy(org.kie.workbench.common.stunner.bpmn.definition.property.task.CreatedBy) Priority(org.kie.workbench.common.stunner.bpmn.definition.property.connectors.Priority) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) UserTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.UserTaskExecutionSet) UserTask(org.kie.workbench.common.stunner.bpmn.definition.UserTask) TaskGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet) UserTaskPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.UserTaskPropertyReader) 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) Subject(org.kie.workbench.common.stunner.bpmn.definition.property.task.Subject) 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) TaskName(org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName) Skippable(org.kie.workbench.common.stunner.bpmn.definition.property.task.Skippable) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync) Edge(org.kie.workbench.common.stunner.core.graph.Edge)

Example 2 with OnExitAction

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

the class TaskConverter 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()));
    definition.setExecutionSet(new BusinessRuleTaskExecutionSet(new RuleFlowGroup(p.getRuleFlowGroup()), new OnEntryAction(p.getOnEntryAction()), new OnExitAction(p.getOnExitAction()), new IsAsync(p.isAsync()), new AdHocAutostart(p.isAdHocAutoStart())));
    definition.setSimulationSet(p.getSimulationSet());
    node.getContent().setBounds(p.getBounds());
    definition.setDimensionsSet(p.getRectangleDimensionsSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    definition.setFontSet(p.getFontSet());
    return BpmnNode.of(node);
}
Also used : RuleFlowGroup(org.kie.workbench.common.stunner.bpmn.definition.property.task.RuleFlowGroup) 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) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) TaskName(org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) BusinessRuleTaskPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.BusinessRuleTaskPropertyReader) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync) Edge(org.kie.workbench.common.stunner.core.graph.Edge)

Example 3 with OnExitAction

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

the class TaskConverterPriorityTest method setPriorityMvel.

@Test
public void setPriorityMvel() {
    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}]]>"));
    System.out.println("Priority: " + propertyWriter.getPriority());
}
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 4 with OnExitAction

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

the class GenericServiceTaskExecutionSetTest method testEqualTrue.

@Test
public void testEqualTrue() {
    GenericServiceTaskExecutionSet a = new GenericServiceTaskExecutionSet();
    GenericServiceTaskExecutionSet b = new GenericServiceTaskExecutionSet();
    a.setGenericServiceTaskInfo(new GenericServiceTaskInfo());
    assertEquals(a, b);
    GenericServiceTaskExecutionSet c = new GenericServiceTaskExecutionSet(new GenericServiceTaskInfo(), new AssignmentsInfo(), new AdHocAutostart(), new IsAsync(), new IsMultipleInstance(false), new MultipleInstanceExecutionMode(false), new MultipleInstanceCollectionInput(), new MultipleInstanceDataInput(), new MultipleInstanceCollectionOutput(), new MultipleInstanceDataOutput(), new MultipleInstanceCompletionCondition(), new OnEntryAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))), new OnExitAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))), new SLADueDate(SLA_DUE_DATE_1));
    GenericServiceTaskExecutionSet d = new GenericServiceTaskExecutionSet(new GenericServiceTaskInfo(), new AssignmentsInfo(), new AdHocAutostart(), new IsAsync(), new IsMultipleInstance(false), new MultipleInstanceExecutionMode(false), new MultipleInstanceCollectionInput(), new MultipleInstanceDataInput(), new MultipleInstanceCollectionOutput(), new MultipleInstanceDataOutput(), new MultipleInstanceCompletionCondition(), new OnEntryAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))), new OnExitAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))), new SLADueDate(SLA_DUE_DATE_1));
    assertEquals(c, d);
}
Also used : AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) MultipleInstanceCollectionOutput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionOutput) 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) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) MultipleInstanceCompletionCondition(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCompletionCondition) IsMultipleInstance(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance) MultipleInstanceCollectionInput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionInput) MultipleInstanceExecutionMode(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceExecutionMode) MultipleInstanceDataInput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataInput) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync) ScriptTypeListValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue) MultipleInstanceDataOutput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataOutput) ScriptTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue) Test(org.junit.Test)

Example 5 with OnExitAction

use of org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction 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)

Aggregations

OnEntryAction (org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction)19 OnExitAction (org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction)19 IsAsync (org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync)16 SLADueDate (org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate)14 AdHocAutostart (org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart)13 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)11 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)11 IsMultipleInstance (org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance)11 ScriptTypeListValue (org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue)10 Test (org.junit.Test)9 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)9 ScriptTypeValue (org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue)9 MultipleInstanceCollectionInput (org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionInput)8 MultipleInstanceCollectionOutput (org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionOutput)8 MultipleInstanceCompletionCondition (org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCompletionCondition)8 MultipleInstanceDataInput (org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataInput)8 MultipleInstanceDataOutput (org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataOutput)8 MultipleInstanceExecutionMode (org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceExecutionMode)8 TaskName (org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName)8 AdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData)8