Search in sources :

Example 21 with ScriptTypeListValue

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

the class GenericServiceTaskExecutionSetTest method testHashCode.

@Test
public void testHashCode() {
    GenericServiceTaskExecutionSet a = new GenericServiceTaskExecutionSet();
    GenericServiceTaskExecutionSet b = new GenericServiceTaskExecutionSet();
    assertEquals(a.hashCode(), b.hashCode());
    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.hashCode(), d.hashCode());
}
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 22 with ScriptTypeListValue

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

the class GenericServiceTaskExecutionSetTest method testEquals.

@Test
public void testEquals() {
    GenericServiceTaskExecutionSet a = new GenericServiceTaskExecutionSet();
    GenericServiceTaskExecutionSet b = new GenericServiceTaskExecutionSet();
    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 23 with ScriptTypeListValue

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

the class GenericServiceTaskExecutionSetTest method testGetSlaDueDate.

@Test
public void testGetSlaDueDate() {
    GenericServiceTaskExecutionSet a = 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(SLA_DUE_DATE_1, a.getSlaDueDate().getValue());
}
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 24 with ScriptTypeListValue

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

the class Scripts method setOnEntryAction.

public static void setOnEntryAction(FlowElement flowElement, OnEntryAction onEntryAction) {
    ScriptTypeListValue value = onEntryAction.getValue();
    for (ScriptTypeValue scriptTypeValue : value.getValues()) {
        String scriptText = scriptTypeValue.getScript();
        if (scriptText == null || scriptText.isEmpty()) {
            continue;
        }
        OnEntryScriptType script = droolsFactory.createOnEntryScriptType();
        script.setScript(asCData(scriptTypeValue.getScript()));
        String scriptLanguage = Scripts.scriptLanguageToUri(scriptTypeValue.getLanguage());
        script.setScriptFormat(scriptLanguage);
        addExtensionValue(flowElement, DOCUMENT_ROOT__ON_ENTRY_SCRIPT, script);
    }
}
Also used : OnEntryScriptType(org.jboss.drools.OnEntryScriptType) ScriptTypeListValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue) ScriptTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue)

Example 25 with ScriptTypeListValue

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

the class ScriptTypeListFieldEditorPresenterTest method testOnChange.

@Test
public void testOnChange() {
    ScriptTypeListValue oldValue = mock(ScriptTypeListValue.class);
    ScriptTypeValue oldScriptTypeValue = mock(ScriptTypeValue.class);
    ScriptTypeValue newScriptTypeValue = mock(ScriptTypeValue.class);
    editor.setValue(oldValue);
    editor.addChangeHandler(changeHandler);
    editor.onValueChange(oldScriptTypeValue, newScriptTypeValue);
    changeHandler.onValueChange(oldValue, new ScriptTypeListValue().addValue(newScriptTypeValue));
}
Also used : 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)

Aggregations

ScriptTypeListValue (org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue)27 ScriptTypeValue (org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue)17 Test (org.junit.Test)14 OnEntryAction (org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction)10 OnExitAction (org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction)10 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)9 SLADueDate (org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate)9 IsAsync (org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync)9 IsMultipleInstance (org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance)9 AdHocAutostart (org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart)8 FeatureMap (org.eclipse.emf.ecore.util.FeatureMap)6 ScriptTypeListTypeSerializer (org.kie.workbench.common.stunner.bpmn.backend.marshall.json.oryx.property.ScriptTypeListTypeSerializer)6 MultipleInstanceCollectionInput (org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionInput)6 MultipleInstanceCollectionOutput (org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionOutput)6 MultipleInstanceCompletionCondition (org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCompletionCondition)6 MultipleInstanceDataInput (org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataInput)6 MultipleInstanceDataOutput (org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataOutput)6 MultipleInstanceExecutionMode (org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceExecutionMode)6 ArrayList (java.util.ArrayList)4 ExtensionAttributeValue (org.eclipse.bpmn2.ExtensionAttributeValue)4