Search in sources :

Example 6 with Message

use of org.jboss.errai.bus.client.api.messaging.Message in project kie-wb-common by kiegroup.

the class AssignmentsEditorWidget method getDataTypes.

protected void getDataTypes() {
    final String simpleDataTypes = "Boolean:Boolean,Float:Float,Integer:Integer,Object:Object,String:String";
    MessageBuilder.createCall(new RemoteCallback<List<String>>() {

        public void callback(List<String> dataTypes) {
            String formattedDataTypes = formatDataTypes(dataTypes);
            String allDataTypes = simpleDataTypes + "," + formattedDataTypes;
            showDataIOEditor(allDataTypes.toString());
        }
    }, new BusErrorCallback() {

        public boolean error(Message message, Throwable t) {
            notification.fire(new NotificationEvent(StunnerFormsClientFieldsConstants.INSTANCE.Error_retrieving_datatypes(), NotificationEvent.NotificationType.ERROR));
            showDataIOEditor(simpleDataTypes);
            return false;
        }
    }, DataTypesService.class).getDataTypeNames();
}
Also used : Message(org.jboss.errai.bus.client.api.messaging.Message) DataTypesService(org.kie.workbench.common.stunner.bpmn.service.DataTypesService) ArrayList(java.util.ArrayList) List(java.util.List) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) RemoteCallback(org.jboss.errai.common.client.api.RemoteCallback) BusErrorCallback(org.jboss.errai.bus.client.api.BusErrorCallback)

Example 7 with Message

use of org.jboss.errai.bus.client.api.messaging.Message in project kie-wb-common by kiegroup.

the class VariablesEditorWidgetViewImpl method getDataTypes.

protected void getDataTypes(final String value, final boolean fireEvents) {
    final List<String> simpleDataTypes = new ArrayList<String>(Arrays.asList("Boolean", "Float", "Integer", "Object", "String"));
    final List<String> simpleDataTypeDisplayNames = new ArrayList<String>(Arrays.asList("Boolean", "Float", "Integer", "Object", "String"));
    MessageBuilder.createCall(new RemoteCallback<List<String>>() {

        public void callback(final List<String> serverDataTypes) {
            List<List<String>> mergedDataTypes = mergeDataTypes(simpleDataTypes, simpleDataTypeDisplayNames, serverDataTypes);
            setDataTypes(mergedDataTypes.get(0), mergedDataTypes.get(1));
            doSetValue(value, fireEvents, true);
        }
    }, new BusErrorCallback() {

        public boolean error(final Message message, final Throwable t) {
            notification.fire(new NotificationEvent(StunnerFormsClientFieldsConstants.INSTANCE.Error_retrieving_datatypes(), NotificationEvent.NotificationType.ERROR));
            setDataTypes(simpleDataTypes, simpleDataTypeDisplayNames);
            doSetValue(value, fireEvents, true);
            return false;
        }
    }, DataTypesService.class).getDataTypeNames();
}
Also used : Message(org.jboss.errai.bus.client.api.messaging.Message) ArrayList(java.util.ArrayList) DataTypesService(org.kie.workbench.common.stunner.bpmn.service.DataTypesService) ArrayList(java.util.ArrayList) List(java.util.List) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) RemoteCallback(org.jboss.errai.common.client.api.RemoteCallback) BusErrorCallback(org.jboss.errai.bus.client.api.BusErrorCallback)

Aggregations

Message (org.jboss.errai.bus.client.api.messaging.Message)7 RemoteCallback (org.jboss.errai.common.client.api.RemoteCallback)5 ArrayList (java.util.ArrayList)4 List (java.util.List)4 Set (java.util.Set)3 Optional (java.util.Optional)2 TreeSet (java.util.TreeSet)2 Collectors (java.util.stream.Collectors)2 Dependent (javax.enterprise.context.Dependent)2 Inject (javax.inject.Inject)2 BusErrorCallback (org.jboss.errai.bus.client.api.BusErrorCallback)2 ErrorCallback (org.jboss.errai.common.client.api.ErrorCallback)2 Group (org.jboss.errai.security.shared.api.Group)2 User (org.jboss.errai.security.shared.api.identity.User)2 AssigneeType (org.kie.workbench.common.stunner.bpmn.forms.model.AssigneeType)2 DataTypesService (org.kie.workbench.common.stunner.bpmn.service.DataTypesService)2 AbstractEntityManager (org.uberfire.ext.security.management.api.AbstractEntityManager)2 ClientUserSystemManager (org.uberfire.ext.security.management.client.ClientUserSystemManager)2 SearchRequestImpl (org.uberfire.ext.security.management.impl.SearchRequestImpl)2 DefaultErrorCallback (org.uberfire.ext.widgets.common.client.callbacks.DefaultErrorCallback)2