提交 093d8207 编写于 作者: T Tijs Rademakers

Merge branch '592-add_data_obj_modeler' of https://github.com/lsmall/flowable-engine

......@@ -12,6 +12,8 @@
*/
package org.flowable.bpmn.model;
import org.apache.commons.lang3.StringUtils;
/**
* @author Lori Small
*/
......@@ -19,7 +21,11 @@ public class BooleanDataObject extends ValuedDataObject {
@Override
public void setValue(Object value) {
this.value = Boolean.valueOf(value.toString());
if (value instanceof String && !StringUtils.isEmpty(((String) value).trim())) {
this.value = Boolean.valueOf(value.toString());
} else if (value instanceof Boolean) {
this.value = value;
}
}
@Override
......
......@@ -12,8 +12,12 @@
*/
package org.flowable.bpmn.model;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;
import org.apache.commons.lang3.StringUtils;
/**
* @author Lori Small
*/
......@@ -21,7 +25,15 @@ public class DateDataObject extends ValuedDataObject {
@Override
public void setValue(Object value) {
this.value = (Date) value;
if (value instanceof String && !StringUtils.isEmpty(((String) value).trim())) {
try {
this.value = DateFormat.getDateTimeInstance().parse((String) value);
} catch (ParseException e) {
System.out.println("Error parsing Date string: " + value);
}
} else if (value instanceof Date) {
this.value = value;
}
}
@Override
......
......@@ -12,6 +12,8 @@
*/
package org.flowable.bpmn.model;
import org.apache.commons.lang3.StringUtils;
/**
* @author Lori Small
*/
......@@ -19,7 +21,11 @@ public class DoubleDataObject extends ValuedDataObject {
@Override
public void setValue(Object value) {
this.value = Double.valueOf(value.toString());
if (value instanceof String && !StringUtils.isEmpty(((String) value).trim())) {
this.value = Double.valueOf(value.toString());
} else if (value instanceof Number) {
this.value = (Double) value;
}
}
@Override
......
......@@ -12,6 +12,8 @@
*/
package org.flowable.bpmn.model;
import org.apache.commons.lang3.StringUtils;
/**
* @author Lori Small
*/
......@@ -19,7 +21,11 @@ public class IntegerDataObject extends ValuedDataObject {
@Override
public void setValue(Object value) {
this.value = Integer.valueOf(value.toString());
if (value instanceof String && !StringUtils.isEmpty(((String) value).trim())) {
this.value = Integer.valueOf(value.toString());
} else if (value instanceof Number) {
this.value = (Integer) value;
}
}
@Override
......
......@@ -12,6 +12,8 @@
*/
package org.flowable.bpmn.model;
import org.apache.commons.lang3.StringUtils;
/**
* @author Lori Small
*/
......@@ -19,7 +21,11 @@ public class LongDataObject extends ValuedDataObject {
@Override
public void setValue(Object value) {
this.value = Long.valueOf(value.toString());
if (value instanceof String && !StringUtils.isEmpty(((String) value).trim())) {
this.value = Long.valueOf(value.toString());
} else if (value instanceof Number) {
this.value = (Long) value;
}
}
@Override
......
......@@ -190,10 +190,11 @@ public interface StencilConstants {
final String PROPERTY_FORM_ENUM_VALUES_ID = "id";
final String PROPERTY_DATA_PROPERTIES = "dataproperties";
final String PROPERTY_DATA_ID = "dataproperty_id";
final String PROPERTY_DATA_NAME = "dataproperty_name";
final String PROPERTY_DATA_TYPE = "dataproperty_type";
final String PROPERTY_DATA_VALUE = "dataproperty_value";
final String PROPERTY_DATA_PROPERTIES_NODE = "dataProperties";
final String PROPERTY_DATA_ID = "id";
final String PROPERTY_DATA_NAME = "name";
final String PROPERTY_DATA_TYPE = "type";
final String PROPERTY_DATA_VALUE = "value";
final String PROPERTY_SCRIPT_FORMAT = "scriptformat";
final String PROPERTY_SCRIPT_TEXT = "scripttext";
......
......@@ -515,7 +515,7 @@ public class BpmnJsonConverterUtil implements EditorJsonConstants, StencilConsta
}
}
JsonNode itemsArrayNode = objectNode.get(EDITOR_PROPERTIES_GENERAL_ITEMS);
JsonNode itemsArrayNode = objectNode.get(PROPERTY_DATA_PROPERTIES_NODE);
if (itemsArrayNode != null) {
for (JsonNode dataNode : itemsArrayNode) {
......@@ -542,21 +542,27 @@ public class BpmnJsonConverterUtil implements EditorJsonConstants, StencilConsta
}
if (null != dataObject) {
dataObject.setId(dataIdNode.asText());
dataObject.setName(dataNode.get(PROPERTY_DATA_NAME).asText());
itemSubjectRef.setStructureRef("xsd:" + dataType);
dataObject.setItemSubjectRef(itemSubjectRef);
if (dataObject instanceof DateDataObject) {
try {
dataObject.setValue(dateTimeFormatter.parseDateTime(dataNode.get(PROPERTY_DATA_VALUE).asText()).toDate());
} catch (Exception e) {
LOGGER.error("Error converting {}", dataObject.getName(), e);
}
} else {
dataObject.setValue(dataNode.get(PROPERTY_DATA_VALUE).asText());
}
dataObject.setId(dataIdNode.asText());
dataObject.setName(dataNode.get(PROPERTY_DATA_NAME).asText());
itemSubjectRef.setStructureRef("xsd:" + dataType);
dataObject.setItemSubjectRef(itemSubjectRef);
JsonNode valueNode = dataNode.get(PROPERTY_DATA_VALUE);
if (valueNode != null) {
String dateValue = valueNode.asText();
if (dataObject instanceof DateDataObject) {
try {
if (!StringUtils.isEmpty(dateValue.trim())) {
dataObject.setValue(dateTimeFormatter.parseDateTime(dateValue).toDate());
}
} catch (Exception e) {
LOGGER.error("Error converting {}", dataObject.getName(), e);
}
} else {
dataObject.setValue(dateValue);
}
}
dataObjects.add(dataObject);
}
......@@ -597,8 +603,8 @@ public class BpmnJsonConverterUtil implements EditorJsonConstants, StencilConsta
itemsNode.add(propertyItemNode);
}
dataPropertiesNode.set(EDITOR_PROPERTIES_GENERAL_ITEMS, itemsNode);
propertiesNode.set("dataproperties", dataPropertiesNode);
dataPropertiesNode.set(PROPERTY_DATA_PROPERTIES_NODE, itemsNode);
propertiesNode.set(PROPERTY_DATA_PROPERTIES, dataPropertiesNode);
}
public static JsonNode validateIfNodeIsTextual(JsonNode node) {
......
......@@ -62,7 +62,7 @@ public class ValuedDataObjectConverterTest extends AbstractConverterTest {
// verify main process data objects
List<ValuedDataObject> dataObjects = model.getMainProcess().getDataObjects();
assertEquals(6, dataObjects.size());
assertEquals(12, dataObjects.size());
for (ValuedDataObject dObj : dataObjects) {
if ("dObj1".equals(dObj.getId())) {
assertEquals(StringDataObject.class, dObj.getClass());
......@@ -114,11 +114,11 @@ public class ValuedDataObjectConverterTest extends AbstractConverterTest {
assertTrue(flowElement instanceof SubProcess);
assertEquals("subprocess1", flowElement.getId());
SubProcess subProcess = (SubProcess) flowElement;
assertEquals(11, subProcess.getFlowElements().size());
assertEquals(17, subProcess.getFlowElements().size());
// verify subprocess data objects
dataObjects = ((SubProcess) flowElement).getDataObjects();
assertEquals(6, dataObjects.size());
assertEquals(12, dataObjects.size());
for (ValuedDataObject dObj : dataObjects) {
if ("dObj1".equals(dObj.getId())) {
assertEquals(StringDataObject.class, dObj.getClass());
......
......@@ -40,7 +40,7 @@
"exclusivedefinition" : "No",
"executionlisteners" : "",
"formkeydefinition" : "",
"formproperties" : { "items" : [ { "formproperty_expression" : "",
"formproperties" : { "formProperties" : [ { "formproperty_expression" : "",
"formproperty_id" : "test",
"formproperty_name" : "Test",
"formproperty_type" : "string",
......@@ -176,38 +176,69 @@
],
"properties" : { "documentation" : "",
"name" : "",
"dataproperties" : { "items" : [ { "dataproperty_id" : "dObj7",
"dataproperty_name" : "SubStringTest",
"dataproperty_type" : "string",
"dataproperty_value" : "Testing456"
"dataproperties" : { "dataProperties" : [
{ "id" : "dObj7",
"name" : "SubStringTest",
"type" : "string",
"value" : "Testing456"
},
{ "dataproperty_id" : "dObj8",
"dataproperty_name" : "SubBooleanTest",
"dataproperty_type" : "boolean",
"dataproperty_value" : "false"
{ "id" : "dObj8",
"name" : "SubBooleanTest",
"type" : "boolean",
"value" : "false"
},
{ "dataproperty_id" : "dObj9",
"dataproperty_name" : "SubDateTest",
"dataproperty_type" : "datetime",
"dataproperty_value" : "2013-11-11"
{ "id" : "dObj9",
"name" : "SubDateTest",
"type" : "datetime",
"value" : "2013-11-11"
},
{ "dataproperty_id" : "dObj10",
"dataproperty_name" : "SubDoubleTest",
"dataproperty_type" : "double",
"dataproperty_value" : "678912345"
{ "id" : "dObj10",
"name" : "SubDoubleTest",
"type" : "double",
"value" : "678912345"
},
{ "dataproperty_id" : "dObj11",
"dataproperty_name" : "SubIntegerTest",
"dataproperty_type" : "int",
"dataproperty_value" : "45"
{ "id" : "dObj11",
"name" : "SubIntegerTest",
"type" : "int",
"value" : "45"
},
{ "dataproperty_id" : "dObj12",
"dataproperty_name" : "SubLongTest",
"dataproperty_type" : "long",
"dataproperty_value" : "456123"
{ "id" : "dObj12",
"name" : "SubLongTest",
"type" : "long",
"value" : "456123"
},
{ "id" : "dObj19",
"name" : "SubStringTest2",
"type" : "string",
"value" : ""
},
{ "id" : "dObj20",
"name" : "SubBooleanTest2",
"type" : "boolean",
"value" : ""
},
{ "id" : "dObj21",
"name" : "SubDateTest2",
"type" : "datetime",
"value" : ""
},
{ "id" : "dObj22",
"name" : "SubDoubleTest2",
"type" : "double",
"value" : ""
},
{ "id" : "dObj23",
"name" : "SubIntegerTest2",
"type" : "int",
"value" : ""
},
{ "id" : "dObj24",
"name" : "SubLongTest2",
"type" : "long",
"value" : ""
}
],
"totalCount" : 6
"totalCount" : 12
}
},
"resourceId" : "subprocess1",
......@@ -387,38 +418,69 @@
],
"properties" : { "documentation" : "",
"executionlisteners" : "",
"dataproperties" : { "items" : [ { "dataproperty_id" : "dObj1",
"dataproperty_name" : "StringTest",
"dataproperty_type" : "string",
"dataproperty_value" : "Testing123"
"dataproperties" : { "dataProperties" : [
{ "id" : "dObj1",
"name" : "StringTest",
"type" : "string",
"value" : "Testing123"
},
{ "id" : "dObj2",
"name" : "BooleanTest",
"type" : "boolean",
"value" : "true"
},
{ "id" : "dObj3",
"name" : "DateTest",
"type" : "datetime",
"value" : "2013-09-16T11:23:00"
},
{ "id" : "dObj4",
"name" : "DoubleTest",
"type" : "double",
"value" : "123456789"
},
{ "id" : "dObj5",
"name" : "IntegerTest",
"type" : "int",
"value" : "123"
},
{ "id" : "dObj6",
"name" : "LongTest",
"type" : "long",
"value" : "-123456"
},
{ "id" : "dObj13",
"name" : "StringTest2",
"type" : "string",
"value" : ""
},
{ "dataproperty_id" : "dObj2",
"dataproperty_name" : "BooleanTest",
"dataproperty_type" : "boolean",
"dataproperty_value" : "true"
{ "id" : "dObj14",
"name" : "BooleanTest2",
"type" : "boolean",
"value" : ""
},
{ "dataproperty_id" : "dObj3",
"dataproperty_name" : "DateTest",
"dataproperty_type" : "datetime",
"dataproperty_value" : "2013-09-16T11:23:00"
{ "id" : "dObj15",
"name" : "DateTest2",
"type" : "datetime",
"value" : ""
},
{ "dataproperty_id" : "dObj4",
"dataproperty_name" : "DoubleTest",
"dataproperty_type" : "double",
"dataproperty_value" : "123456789"
{ "id" : "dObj16",
"name" : "DoubleTest2",
"type" : "double",
"value" : ""
},
{ "dataproperty_id" : "dObj5",
"dataproperty_name" : "IntegerTest",
"dataproperty_type" : "int",
"dataproperty_value" : "123"
{ "id" : "dObj17",
"name" : "IntegerTest2",
"type" : "int",
"value" : ""
},
{ "dataproperty_id" : "dObj6",
"dataproperty_name" : "LongTest",
"dataproperty_type" : "long",
"dataproperty_value" : "-123456"
{ "id" : "dObj18",
"name" : "LongTest2",
"type" : "long",
"value" : ""
}
],
"totalCount" : 6
"totalCount" : 12
},
"name" : "",
"process_author" : "",
......
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Data Properties
*/
angular.module('flowableModeler').controller('FlowableDataPropertiesCtrl',
['$scope', '$modal', '$timeout', '$translate', function ($scope, $modal, $timeout, $translate) {
// Config for the modal window
var opts = {
template: 'editor-app/configuration/properties/data-properties-popup.html?version=' + Date.now(),
scope: $scope
};
// Open the dialog
_internalCreateModal(opts, $modal, $scope);
}]);
angular.module('flowableModeler').controller('FlowableDataPropertiesPopupCtrl',
['$scope', '$q', '$translate', '$timeout', function ($scope, $q, $translate, $timeout) {
// Put json representing data properties on scope
if ($scope.property.value !== undefined && $scope.property.value !== null
&& $scope.property.value.dataProperties !== undefined
&& $scope.property.value.dataProperties !== null) {
// Note that we clone the json object rather then setting it directly,
// this to cope with the fact that the user can click the cancel button and no changes should have happended
$scope.dataProperties = angular.copy($scope.property.value.dataProperties);
for (var i = 0; i < $scope.dataProperties.length; i++) {
var dataProperty = $scope.dataProperties[i];
if (dataProperty.enumValues && dataProperty.enumValues.length > 0) {
for (var j = 0; j < dataProperty.enumValues.length; j++) {
var enumValue = dataProperty.enumValues[j];
if (!enumValue.id && !enumValue.name && enumValue.value) {
enumValue.id = enumValue.value;
enumValue.name = enumValue.value;
}
}
}
}
} else {
$scope.dataProperties = [];
}
$scope.enumValues = [];
$scope.translationsRetrieved = false;
$scope.labels = {};
var idPromise = $translate('PROPERTY.DATAPROPERTIES.ID');
var namePromise = $translate('PROPERTY.DATAPROPERTIES.NAME');
var typePromise = $translate('PROPERTY.DATAPROPERTIES.TYPE');
var valuePromise = $translate('PROPERTY.DATAPROPERTIES.VALUE');
$q.all([idPromise, namePromise, typePromise, valuePromise]).then(function (results) {
$scope.labels.idLabel = results[0];
$scope.labels.nameLabel = results[1];
$scope.labels.typeLabel = results[2];
$scope.labels.valueLabel = results[3];
$scope.translationsRetrieved = true;
// Config for grid
$scope.gridOptions = {
data: $scope.dataProperties,
headerRowHeight: 28,
enableRowSelection: true,
enableRowHeaderSelection: false,
multiSelect: false,
modifierKeysToMultiSelect: false,
enableHorizontalScrollbar: 0,
enableColumnMenus: false,
enableSorting: false,
columnDefs: [{field: 'id', displayName: $scope.labels.idLabel},
{field: 'name', displayName: $scope.labels.nameLabel},
{field: 'type', displayName: $scope.labels.typeLabel},
{field: 'value', displayName: $scope.labels.valueLabel}]
};
$scope.enumGridOptions = {
data: $scope.enumValues,
headerRowHeight: 28,
enableRowSelection: true,
enableRowHeaderSelection: false,
multiSelect: false,
modifierKeysToMultiSelect: false,
enableHorizontalScrollbar: 0,
enableColumnMenus: false,
enableSorting: false,
columnDefs: [{ field: 'id', displayName: $scope.labels.idLabel },
{ field: 'name', displayName: $scope.labels.nameLabel}]
}
$scope.gridOptions.onRegisterApi = function (gridApi) {
//set gridApi on scope
$scope.gridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope, function (row) {
$scope.selectedProperty = row.entity;
$scope.selectedEnumValue = undefined;
if ($scope.selectedProperty && $scope.selectedProperty.enumValues) {
$scope.enumValues.length = 0;
for (var i = 0; i < $scope.selectedProperty.enumValues.length; i++) {
$scope.enumValues.push($scope.selectedProperty.enumValues[i]);
}
}
});
};
$scope.enumGridOptions.onRegisterApi = function (gridApi) {
//set gridApi on scope
$scope.enumGridApi = gridApi;
gridApi.selection.on.rowSelectionChanged($scope, function (row) {
$scope.selectedEnumValue = row.entity;
});
};
});
// Handler for when the value of the type dropdown changes
$scope.propertyTypeChanged = function () {
// Check date. If date, show date pattern
if ($scope.selectedProperty.type === 'date') {
$scope.selectedProperty.datePattern = 'MM-dd-yyyy hh:mm';
} else {
delete $scope.selectedProperty.datePattern;
}
// Check enum. If enum, show list of options
if ($scope.selectedProperty.type === 'enum') {
$scope.selectedProperty.enumValues = [ {id: 'value1', name: 'Value 1'}, {id: 'value2', name: 'Value 2'}];
$scope.enumValues.length = 0;
for (var i = 0; i < $scope.selectedProperty.enumValues.length; i++) {
$scope.enumValues.push($scope.selectedProperty.enumValues[i]);
}
} else {
delete $scope.selectedProperty.enumValues;
$scope.enumValues.length = 0;
}
};
// Click handler for add button
var propertyIndex = 1;
$scope.addNewProperty = function () {
var newProperty = {
id: 'new_data_object_' + propertyIndex++,
name: '',
type: 'string',
readable: true,
writable: true
};
$scope.dataProperties.push(newProperty);
$timeout(function () {
$scope.gridApi.selection.toggleRowSelection(newProperty);
});
};
// Click handler for remove button
$scope.removeProperty = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.dataProperties.indexOf(selectedItems[0]);
$scope.gridApi.selection.toggleRowSelection(selectedItems[0]);
$scope.dataProperties.splice(index, 1);
if ($scope.dataProperties.length == 0) {
$scope.selectedProperty = undefined;
}
$timeout(function() {
if ($scope.dataProperties.length > 0) {
$scope.gridApi.selection.toggleRowSelection($scope.dataProperties[0]);
}
});
}
};
// Click handler for up button
$scope.movePropertyUp = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.dataProperties.indexOf(selectedItems[0]);
if (index != 0) { // If it's the first, no moving up of course
var temp = $scope.dataProperties[index];
$scope.dataProperties.splice(index, 1);
$timeout(function(){
$scope.dataProperties.splice(index + -1, 0, temp);
$timeout(function() {
$scope.gridApi.selection.toggleRowSelection(temp);
});
});
}
}
};
// Click handler for down button
$scope.movePropertyDown = function () {
var selectedItems = $scope.gridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.dataProperties.indexOf(selectedItems[0]);
if (index != $scope.dataProperties.length - 1) { // If it's the last element, no moving down of course
var temp = $scope.dataProperties[index];
$scope.dataProperties.splice(index, 1);
$timeout(function(){
$scope.dataProperties.splice(index + 1, 0, temp);
$timeout(function() {
$scope.gridApi.selection.toggleRowSelection(temp);
});
});
}
}
};
$scope.addNewEnumValue = function() {
if ($scope.selectedProperty) {
var newEnumValue = { id : '', name : ''};
$scope.selectedProperty.enumValues.push(newEnumValue);
$scope.enumValues.push(newEnumValue);
$timeout(function () {
$scope.enumGridApi.selection.toggleRowSelection(newEnumValue);
});
}
};
// Click handler for remove button
$scope.removeEnumValue = function() {
var selectedItems = $scope.enumGridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.enumValues.indexOf(selectedItems[0]);
$scope.enumGridApi.selection.toggleRowSelection(selectedItems[0]);
$scope.enumValues.splice(index, 1);
$scope.selectedProperty.enumValues.splice(index, 1);
if ($scope.enumValues.length == 0) {
$scope.selectedEnumValue = undefined;
}
$timeout(function () {
if ($scope.enumValues.length > 0) {
$scope.enumGridApi.selection.toggleRowSelection($scope.enumValues[0]);
}
});
}
};
// Click handler for up button
$scope.moveEnumValueUp = function() {
var selectedItems = $scope.enumGridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.enumValues.indexOf(selectedItems[0]);
if (index != 0) { // If it's the first, no moving up of course
var temp = $scope.enumValues[index];
$scope.enumValues.splice(index, 1);
$scope.selectedProperty.enumValues.splice(index, 1);
$timeout(function () {
$scope.enumValues.splice(index + -1, 0, temp);
$scope.selectedProperty.enumValues.splice(index + -1, 0, temp);
$timeout(function () {
$scope.enumGridApi.selection.toggleRowSelection(temp);
});
});
}
}
};
// Click handler for down button
$scope.moveEnumValueDown = function() {
var selectedItems = $scope.enumGridApi.selection.getSelectedRows();
if (selectedItems && selectedItems.length > 0) {
var index = $scope.enumValues.indexOf(selectedItems[0]);
if (index != $scope.enumValues.length - 1) { // If it's the last element, no moving down of course
var temp = $scope.enumValues[index];
$scope.enumValues.splice(index, 1);
$scope.selectedProperty.enumValues.splice(index, 1);
$timeout(function () {
$scope.enumValues.splice(index + 1, 0, temp);
$scope.selectedProperty.enumValues.splice(index + 1, 0, temp);
$timeout(function () {
$scope.enumGridApi.selection.toggleRowSelection(temp);
});
});
}
}
};
// Click handler for save button
$scope.save = function () {
if ($scope.dataProperties.length > 0) {
$scope.property.value = {};
$scope.property.value.dataProperties = $scope.dataProperties;
} else {
$scope.property.value = null;
}
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
$scope.cancel = function () {
$scope.$hide();
$scope.property.mode = 'read';
};
// Close button handler
$scope.close = function () {
$scope.$hide();
$scope.property.mode = 'read';
};
}])
;
\ No newline at end of file
......@@ -34,6 +34,10 @@ FLOWABLE.PROPERTY_CONFIG =
"readModeTemplateUrl": "editor-app/configuration/properties/default-value-display-template.html",
"writeModeTemplateUrl": "editor-app/configuration/properties/ordering-property-write-template.html"
},
"oryx-dataproperties-complex": {
"readModeTemplateUrl": "editor-app/configuration/properties/data-properties-display-template.html",
"writeModeTemplateUrl": "editor-app/configuration/properties/data-properties-write-template.html"
},
"oryx-formproperties-complex": {
"readModeTemplateUrl": "editor-app/configuration/properties/form-properties-display-template.html",
"writeModeTemplateUrl": "editor-app/configuration/properties/form-properties-write-template.html"
......
<span ng-if="!property.noValue">{{'PROPERTY.DATAPROPERTIES.VALUES' | translate:property.value.dataProperties}}</span>
<span ng-if="property.noValue" translate>PROPERTY.DATAPROPERTIES.EMPTY</span>
\ No newline at end of file
<div class="modal" ng-controller="FlowableDataPropertiesPopupCtrl">
<div class="modal-dialog modal-wide">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">&times;</button>
<h2>{{'PROPERTY.PROPERTY.EDIT.TITLE' | translate}} "{{property.title | translate}}"</h2>
</div>
<div class="modal-body">
<div class="row row-no-gutter">
<div class="col-xs-6">
<div ng-if="translationsRetrieved" class="kis-listener-grid" ui-grid="gridOptions" ui-grid-selection></div>
<div class="pull-right">
<div class="btn-group">
<a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.MOVE.UP' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="movePropertyUp()"><i class="glyphicon glyphicon-arrow-up"></i></a>
<a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.MOVE.DOWN' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="movePropertyDown()"><i class="glyphicon glyphicon-arrow-down"></i></a>
</div>
<div class="btn-group">
<a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.ADD' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="addNewProperty()"><i class="glyphicon glyphicon-plus"></i></a>
<a class="btn btn-icon btn-lg" rel="tooltip" data-title="{{'ACTION.REMOVE' | translate}}" data-placement="bottom" data-original-title="" title="" ng-click="removeProperty()"><i class="glyphicon glyphicon-minus"></i></a>
</div>
</div>
</div>
<div class="col-xs-6">
<div ng-show="selectedProperty">
<div class="form-group">
<label for="idField">{{'PROPERTY.DATAPROPERTIES.ID' | translate}}</label>
<input id="idField" class="form-control" type="text" ng-model="selectedProperty.id" placeholder="{{'PROPERTY.DATAPROPERTIES.ID.PLACEHOLDER' | translate }}" />
</div>
<div class="form-group">
<label for="nameField">{{'PROPERTY.DATAPROPERTIES.NAME' | translate}}</label>
<input id="nameField" class="form-control" type="text" ng-model="selectedProperty.name" placeholder="{{'PROPERTY.DATAPROPERTIES.NAME.PLACEHOLDER' | translate }}" />
</div>
<div class="form-group">
<label for="typeField">{{'PROPERTY.DATAPROPERTIES.TYPE' | translate}}</label>
<select id="typeField" class="form-control" ng-model="selectedProperty.type" ng-change="propertyTypeChanged()">
<option selected>string</option>
<option>boolean</option>
<option>datetime</option>
<option>double</option>
<option>int</option>
<option>long</option>
</select>
</div>
<div class="form-group">
<label for="valueField">{{'PROPERTY.DATAPROPERTIES.VALUE' | translate}}</label>
<input id="valueField" class="form-control" type="text" ng-model="selectedProperty.value" placeholder="{{'PROPERTY.DATAPROPERTIES.VALUE.PLACEHOLDER' | translate }}" />
</div>
</div>
<div ng-show="!selectedProperty" class="muted no-property-selected" translate>PROPERTY.DATAPROPERTIES.EMPTY</div>
</div>
</div>
</div>
<div class="modal-footer">
<button ng-click="cancel()" class="btn btn-primary" translate>ACTION.CANCEL</button>
<button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button>
</div>
</div>
</div>
</div>
<!-- Just need to instantiate the controller, and it will take care of showing the modal dialog -->
<span ng-controller="FlowableDataPropertiesCtrl">
</span>
\ No newline at end of file
......@@ -787,6 +787,16 @@
"PROPERTY.FIELDS.STRING.PLACEHOLDER" : "Enter a string",
"PROPERTY.FIELDS.IMPLEMENTATION" : "Implementation",
"PROPERTY.DATAPROPERTIES.VALUES" : "{{length}} data objects",
"PROPERTY.DATAPROPERTIES.EMPTY" : "No data objects configured",
"PROPERTY.DATAPROPERTIES.ID" : "Id",
"PROPERTY.DATAPROPERTIES.ID.PLACEHOLDER" : "Enter an id",
"PROPERTY.DATAPROPERTIES.NAME" : "Name",
"PROPERTY.DATAPROPERTIES.NAME.PLACEHOLDER" : "Enter a name",
"PROPERTY.DATAPROPERTIES.TYPE" : "Type",
"PROPERTY.DATAPROPERTIES.VALUE.PLACEHOLDER" : "Enter a value (optional)",
"PROPERTY.DATAPROPERTIES.VALUE" : "Default Value",
"PROPERTY.FORMPROPERTIES.VALUE" : "{{length}} form properties",
"PROPERTY.FORMPROPERTIES.EMPTY" : "No form properties selected",
"PROPERTY.FORMPROPERTIES.ID" : "Id",
......
......@@ -218,6 +218,7 @@
<script src="editor-app/editor-utils.js" type="text/javascript"></script>
<script src="editor-app/configuration/toolbar-default-actions.js" type="text/javascript"></script>
<script src="editor-app/configuration/properties-data-properties-controller.js" type="text/javascript"></script>
<script src="editor-app/configuration/properties-default-controllers.js" type="text/javascript"></script>
<script src="editor-app/configuration/properties-execution-listeners-controller.js" type="text/javascript"></script>
<script src="editor-app/configuration/properties-event-listeners-controller.js" type="text/javascript"></script>
......
......@@ -22,6 +22,7 @@ import org.flowable.app.util.ImageGenerator;
import org.flowable.bpmn.model.Artifact;
import org.flowable.bpmn.model.Association;
import org.flowable.bpmn.model.BpmnModel;
import org.flowable.bpmn.model.DataObject;
import org.flowable.bpmn.model.FlowElement;
import org.flowable.bpmn.model.GraphicInfo;
import org.flowable.bpmn.model.Lane;
......@@ -220,7 +221,8 @@ public class ModelImageService {
if (flowList != null) {
graphicInfoList.addAll(flowList);
}
} else {
// no graphic info for Data Objects
} else if (!DataObject.class.isInstance(flowElement)) {
graphicInfoList.add(bpmnModel.getGraphicInfo(flowElement.getId()));
}
......
......@@ -103,6 +103,16 @@
"description" : "Define the activity as asynchronous.",
"popular" : true
} ]
}, {
"name" : "datapropertiespackage",
"properties" : [ {
"id" : "dataproperties",
"type" : "Complex",
"title" : "Data Objects",
"value" : "",
"description" : "Definition of the data object properties",
"popular" : true
} ]
}, {
"name" : "exclusivedefinitionpackage",
"properties" : [ {
......@@ -951,7 +961,7 @@
"groups" : [ "Diagram" ],
"mayBeRoot" : true,
"hide" : true,
"propertyPackages" : [ "process_idpackage", "namepackage", "documentationpackage", "process_authorpackage", "process_versionpackage", "process_namespacepackage", "executionlistenerspackage", "eventlistenerspackage", "signaldefinitionspackage", "messagedefinitionspackage", "process_potentialstarteruserpackage","process_potentialstartergrouppackage" ],
"propertyPackages" : [ "process_idpackage", "namepackage", "documentationpackage", "process_authorpackage", "process_versionpackage", "process_namespacepackage", "datapropertiespackage", "executionlistenerspackage", "eventlistenerspackage", "signaldefinitionspackage", "messagedefinitionspackage", "process_potentialstarteruserpackage","process_potentialstartergrouppackage" ],
"hiddenPropertyPackages" : [ ],
"roles" : [ ]
}, {
......@@ -1149,7 +1159,7 @@
"view" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:svg=\"http://www.w3.org/2000/svg\"\n xmlns:oryx=\"http://www.b3mn.org/oryx\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n width=\"200\"\n height=\"160\"\n version=\"1.0\">\n <defs></defs>\n <oryx:magnets>\n \t<oryx:magnet oryx:cx=\"1\" oryx:cy=\"50\" oryx:anchors=\"left\" />\n \t<oryx:magnet oryx:cx=\"1\" oryx:cy=\"80\" oryx:anchors=\"left\" />\n \t<oryx:magnet oryx:cx=\"1\" oryx:cy=\"110\" oryx:anchors=\"left\" />\n \t\n \t<oryx:magnet oryx:cx=\"70\" oryx:cy=\"159\" oryx:anchors=\"bottom\" />\n \t<oryx:magnet oryx:cx=\"100\" oryx:cy=\"159\" oryx:anchors=\"bottom\" />\n \t<oryx:magnet oryx:cx=\"130\" oryx:cy=\"159\" oryx:anchors=\"bottom\" />\n \t\n \t<oryx:magnet oryx:cx=\"199\" oryx:cy=\"50\" oryx:anchors=\"right\" />\n \t<oryx:magnet oryx:cx=\"199\" oryx:cy=\"80\" oryx:anchors=\"right\" />\n \t<oryx:magnet oryx:cx=\"199\" oryx:cy=\"110\" oryx:anchors=\"right\" />\n \t\n \t<oryx:magnet oryx:cx=\"70\" oryx:cy=\"1\" oryx:anchors=\"top\" />\n \t<oryx:magnet oryx:cx=\"100\" oryx:cy=\"1\" oryx:anchors=\"top\" />\n \t<oryx:magnet oryx:cx=\"130\" oryx:cy=\"1\" oryx:anchors=\"top\" />\n \t\n \t<oryx:magnet oryx:cx=\"100\" oryx:cy=\"80\" oryx:default=\"yes\" />\n </oryx:magnets>\n <g pointer-events=\"fill\" oryx:minimumSize=\"120 100\" oryx:maximumSize=\"\" >\n <rect id=\"text_frame\" oryx:anchors=\"bottom top right left\" x=\"0\" y=\"0\" width=\"190\" height=\"160\" rx=\"10\" ry=\"10\" stroke=\"none\" stroke-width=\"0\" fill=\"none\" />\n\t<rect id=\"bg_frame\" oryx:anchors=\"bottom top right left\" x=\"0\" y=\"0\" width=\"200\" height=\"160\" rx=\"10\" ry=\"10\" stroke=\"#bbbbbb\" stroke-width=\"1\" fill=\"#ffffff\" />\n\t<rect id=\"border\" oryx:anchors=\"top bottom left right\" oryx:resize=\"vertical horizontal\" x=\"2.5\" y=\"2.5\" width=\"195\" height=\"155\" rx=\"8\" ry=\"8\" stroke=\"black\" stroke-width=\"1\" fill=\"none\" />\n\t<text \n\t\tfont-size=\"12\" \n\t\tid=\"text_name\" \n\t\tx=\"8\" \n\t\ty=\"10\" \n\t\toryx:align=\"top left\"\n\t\toryx:fittoelem=\"text_frame\"\n\t\toryx:anchors=\"left top\" \n\t\tstroke=\"#373e48\">\n\t</text>\n\t\n\t<g \tid=\"parallel\"\n\t\ttransform=\"translate(1)\">\n\t\t<path \n\t\t\tid=\"parallelpath\"\n\t\t\toryx:anchors=\"bottom\" \n\t\t\tfill=\"none\" stroke=\"#bbbbbb\" d=\"M96 145 v10 M100 145 v10 M104 145 v10\" \n\t\t\tstroke-width=\"2\"\n\t\t/>\n\t</g>\n\t<g \tid=\"sequential\"\n\t\ttransform=\"translate(1)\">\n\t\t<path \n\t\t\tid=\"sequentialpath\"\n\t\t\toryx:anchors=\"bottom\" \n\t\t\tfill=\"none\" stroke=\"#bbbbbb\" stroke-width=\"2\" d=\"M95,154h10 M95,150h10 M95,146h10\"\n\t\t/>\n\t</g>\n </g>\n</svg>",
"icon" : "activity/expanded.subprocess.png",
"groups" : [ "Structural" ],
"propertyPackages" : [ "overrideidpackage", "namepackage", "documentationpackage", "asynchronousdefinitionpackage", "exclusivedefinitionpackage", "executionlistenerspackage", "multiinstance_typepackage", "multiinstance_cardinalitypackage", "multiinstance_collectionpackage", "multiinstance_variablepackage", "multiinstance_conditionpackage", "istransactionpackage" ],
"propertyPackages" : [ "overrideidpackage", "namepackage", "documentationpackage", "asynchronousdefinitionpackage", "exclusivedefinitionpackage", "datapropertiespackage", "executionlistenerspackage", "multiinstance_typepackage", "multiinstance_cardinalitypackage", "multiinstance_collectionpackage", "multiinstance_variablepackage", "multiinstance_conditionpackage", "istransactionpackage" ],
"hiddenPropertyPackages" : [ ],
"roles" : [ "Activity", "sequence_start", "sequence_end", "all" ]
},{
......@@ -1160,7 +1170,7 @@
"view" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:svg=\"http://www.w3.org/2000/svg\"\n xmlns:oryx=\"http://www.b3mn.org/oryx\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n width=\"102\"\n height=\"82\"\n version=\"1.0\">\n <defs></defs>\n <oryx:magnets>\n \t<oryx:magnet oryx:cx=\"1\" oryx:cy=\"20\" oryx:anchors=\"left\" />\n \t<oryx:magnet oryx:cx=\"1\" oryx:cy=\"40\" oryx:anchors=\"left\" />\n \t<oryx:magnet oryx:cx=\"1\" oryx:cy=\"60\" oryx:anchors=\"left\" />\n \t\n \t<oryx:magnet oryx:cx=\"25\" oryx:cy=\"79\" oryx:anchors=\"bottom\" />\n \t<oryx:magnet oryx:cx=\"50\" oryx:cy=\"79\" oryx:anchors=\"bottom\" />\n \t<oryx:magnet oryx:cx=\"75\" oryx:cy=\"79\" oryx:anchors=\"bottom\" />\n \t\n \t<oryx:magnet oryx:cx=\"99\" oryx:cy=\"20\" oryx:anchors=\"right\" />\n \t<oryx:magnet oryx:cx=\"99\" oryx:cy=\"40\" oryx:anchors=\"right\" />\n \t<oryx:magnet oryx:cx=\"99\" oryx:cy=\"60\" oryx:anchors=\"right\" />\n \t\n \t<oryx:magnet oryx:cx=\"25\" oryx:cy=\"1\" oryx:anchors=\"top\" />\n \t<oryx:magnet oryx:cx=\"50\" oryx:cy=\"1\" oryx:anchors=\"top\" />\n \t<oryx:magnet oryx:cx=\"75\" oryx:cy=\"1\" oryx:anchors=\"top\" />\n \t\n \t<oryx:magnet oryx:cx=\"50\" oryx:cy=\"40\" oryx:default=\"yes\" />\n </oryx:magnets>\n <g pointer-events=\"fill\" oryx:minimumSize=\"50 40\">\n\t<rect id=\"text_frame\" oryx:anchors=\"bottom top right left\" x=\"1\" y=\"1\" width=\"94\" height=\"79\" rx=\"10\" ry=\"10\" stroke=\"none\" stroke-width=\"0\" fill=\"none\" />\n\t<rect id=\"bg_frame\" oryx:resize=\"vertical horizontal\" x=\"0\" y=\"0\" width=\"100\" height=\"80\" rx=\"10\" ry=\"10\" stroke=\"#bbbbbb\" stroke-width=\"1\" fill=\"#f9f9f9\" />\n\t\t<text \n\t\t\tfont-size=\"12\" \n\t\t\tid=\"text_name\" \n\t\t\tx=\"50\" \n\t\t\ty=\"40\" \n\t\t\toryx:align=\"middle center\"\n\t\t\toryx:fittoelem=\"text_frame\"\n\t\t\tstroke=\"#373e48\">\n\t\t</text>\n\t<g id=\"subprocess\">\n\t\t<rect height=\"10\" width=\"10\" x=\"45\" y=\"65\" stroke=\"#bbbbbb\" fill=\"none\" />\n\t\t<path d=\"M50 65 L50 75\" stroke=\"black\" />\n\t\t<path d=\"M45 70 L55 70\" stroke=\"black\" />\n\t</g>\n </g>\n</svg>",
"icon" : "activity/subprocess.png",
"groups" : [ "Structural" ],
"propertyPackages" : [ "overrideidpackage", "namepackage", "documentationpackage", "asynchronousdefinitionpackage", "exclusivedefinitionpackage", "executionlistenerspackage", "multiinstance_typepackage", "multiinstance_cardinalitypackage", "multiinstance_collectionpackage", "multiinstance_variablepackage", "multiinstance_conditionpackage", "istransactionpackage" ],
"propertyPackages" : [ "overrideidpackage", "namepackage", "documentationpackage", "asynchronousdefinitionpackage", "exclusivedefinitionpackage", "datapropertiespackage", "executionlistenerspackage", "multiinstance_typepackage", "multiinstance_cardinalitypackage", "multiinstance_collectionpackage", "multiinstance_variablepackage", "multiinstance_conditionpackage", "istransactionpackage" ],
"hiddenPropertyPackages" : [ ],
"roles" : [ "Activity", "sequence_start", "sequence_end", "all" ]
},{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册