提交 85c13da7 编写于 作者: T Tijs Rademakers

Small fixes to dataobject logic

上级 4ca8e77a
......@@ -176,7 +176,7 @@
],
"properties" : { "documentation" : "",
"name" : "",
"dataproperties" : { "dataProperties" : [
"dataproperties" : { "items" : [
{ "dataproperty_id" : "dObj7",
"dataproperty_name" : "SubStringTest",
"dataproperty_type" : "string",
......@@ -418,7 +418,7 @@
],
"properties" : { "documentation" : "",
"executionlisteners" : "",
"dataproperties" : { "dataProperties" : [
"dataproperties" : { "items" : [
{ "dataproperty_id" : "dObj1",
"dataproperty_name" : "StringTest",
"dataproperty_type" : "string",
......
......@@ -33,11 +33,11 @@ angular.module('flowableModeler').controller('FlowableDataPropertiesPopupCtrl',
// 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) {
&& $scope.property.value.items !== undefined
&& $scope.property.value.items !== 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);
// this to cope with the fact that the user can click the cancel button and no changes should have happened
$scope.dataProperties = angular.copy($scope.property.value.items);
for (var i = 0; i < $scope.dataProperties.length; i++) {
var dataProperty = $scope.dataProperties[i];
......@@ -306,7 +306,7 @@ angular.module('flowableModeler').controller('FlowableDataPropertiesPopupCtrl',
if ($scope.dataProperties.length > 0) {
$scope.property.value = {};
$scope.property.value.dataProperties = $scope.dataProperties;
$scope.property.value.items = $scope.dataProperties;
} else {
$scope.property.value = null;
}
......
<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
<span ng-if="property.value.items && property.value.items.length > 0">{{'PROPERTY.DATAPROPERTIES.VALUES' | translate:property.value.items}}</span>
<span ng-if="!property.value.items || property.value.items.length == 0" translate>PROPERTY.DATAPROPERTIES.EMPTY</span>
\ No newline at end of file
......@@ -12,11 +12,6 @@
*/
package org.flowable.app.service.editor;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
......@@ -35,6 +30,7 @@ import org.flowable.bpmn.model.Artifact;
import org.flowable.bpmn.model.Association;
import org.flowable.bpmn.model.BoundaryEvent;
import org.flowable.bpmn.model.BpmnModel;
import org.flowable.bpmn.model.DataObject;
import org.flowable.bpmn.model.ErrorEventDefinition;
import org.flowable.bpmn.model.Event;
import org.flowable.bpmn.model.EventDefinition;
......@@ -57,6 +53,11 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
@Component
public class BpmnDisplayJsonConverter {
......@@ -168,7 +169,11 @@ public class BpmnDisplayJsonConverter {
protected void processElements(Collection<FlowElement> elementList, BpmnModel model, ArrayNode elementArray, ArrayNode flowArray, GraphicInfo diagramInfo) {
for (FlowElement element : elementList) {
if (element instanceof SequenceFlow) {
// ignore data objects in visual representation
if (DataObject.class.isInstance(element)) {
continue;
} else if (element instanceof SequenceFlow) {
ObjectNode elementNode = objectMapper.createObjectNode();
SequenceFlow flow = (SequenceFlow) element;
elementNode.put("id", flow.getId());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册