use of org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue in project kie-wb-common by kiegroup.
the class ScriptTypeTypeSerializerTest method setUp.
@Before
public void setUp() {
serializer = new ScriptTypeTypeSerializer();
scriptType = new ScriptTypeValue(LANGUAGE, SCRIPT);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue in project kie-wb-common by kiegroup.
the class ScriptTypeFieldEditorPresenter method onChange.
protected void onChange() {
ScriptTypeValue oldValue = value;
value = copy(oldValue, true);
value.setScript(view.getScript());
value.setLanguage(view.getLanguage());
notifyChange(oldValue, value);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue in project kie-wb-common by kiegroup.
the class ScriptTypeFieldEditorPresenterTest method testOnScriptChange.
@Test
public void testOnScriptChange() {
ScriptTypeValue oldValue = new ScriptTypeValue();
editor.setValue(oldValue);
when(view.getLanguage()).thenReturn(LANGUAGE);
when(view.getScript()).thenReturn(SCRIPT);
editor.onScriptChange();
verifyValueChange(oldValue, new ScriptTypeValue(LANGUAGE, SCRIPT));
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue 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));
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue in project kie-wb-common by kiegroup.
the class Bpmn2JsonMarshaller method getOnExitActions.
public ScriptTypeListValue getOnExitActions(final List<ExtensionAttributeValue> extensionValues) {
final ScriptTypeListValue onExitActions = new ScriptTypeListValue();
ScriptTypeValue onExitAction;
if (extensionValues != null && !extensionValues.isEmpty()) {
for (ExtensionAttributeValue extattrval : extensionValues) {
FeatureMap extensionElements = extattrval.getValue();
@SuppressWarnings("unchecked") List<OnExitScriptType> onExitExtensions = (List<OnExitScriptType>) extensionElements.get(DroolsPackage.Literals.DOCUMENT_ROOT__ON_EXIT_SCRIPT, true);
for (OnExitScriptType onExitScript : onExitExtensions) {
onExitAction = getOnExitAction(onExitScript);
if (onExitAction.getScript() != null && !onExitAction.getScript().isEmpty()) {
onExitActions.addValue(onExitAction);
}
}
}
}
return onExitActions;
}
Aggregations