Commit b7a914f76c7c0e1c5b41588811e46ea16215530d

Authored by Carlos Alberto
1 parent e5adf45c
Exists in master

Correções do workflow

cit-esi-api/src/main/java/br/com/centralit/esi/api/data/service/impl/DataManager.java
... ... @@ -132,13 +132,14 @@ public class DataManager {
132 132 }
133 133  
134 134 String action = (String) objectInArray.get("relationshipAction");
135   - if (action != null) {
136   - if (action.equalsIgnoreCase("insert")) {
137   - this.executeDefaultInsert(relationship.getReferencedObject(), objectInArray);
138   - }else if (action.equalsIgnoreCase("update")) {
139   - this.executeDefaultUpdate(relationship.getReferencedObject(), objectInArray);
140   - }
141   - }
  135 + if (action == null) {
  136 + action = "insert";
  137 + }
  138 + if (action.equalsIgnoreCase("insert")) {
  139 + this.executeDefaultInsert(relationship.getReferencedObject(), objectInArray);
  140 + }else if (action.equalsIgnoreCase("update")) {
  141 + this.executeDefaultUpdate(relationship.getReferencedObject(), objectInArray);
  142 + }
142 143 }
143 144 }
144 145 }
... ... @@ -438,12 +439,16 @@ public class DataManager {
438 439 }
439 440  
440 441 DataObjectUtil.executeSQL(dataObject, connection, sql, map);
441   - if (SQLType.equals(SqlClauseTypeEnum.UPDATE)) {
  442 + if (SQLType.equals(SqlClauseTypeEnum.INSERT)) {
442 443 DataObjectUtil.verifyIdentity(dataObject, connection, map);
443 444 }
444   -
445   - result = map;
446 445 this.dataSourceService.commit(connection);
  446 +
  447 + if (!SQLType.equals(SqlClauseTypeEnum.DELETE)) {
  448 + this.updateRelationships(dataObject, map);
  449 + }
  450 +
  451 + result = map;
447 452 }
448 453 } catch (Exception e) {
449 454 this.dataSourceService.rollback(connection);
... ...
cit-esi-api/src/main/java/br/com/centralit/esi/api/design/service/impl/FlowVersionServiceImpl.java
... ... @@ -911,22 +911,24 @@ public class FlowVersionServiceImpl extends GenericServiceImpl<FlowVersion, Long
911 911 * @param flowVersion
912 912 */
913 913 private void verifyStatusVariables(FlowVersion flowVersion) {
  914 + List<FlowVariable> newList = new ArrayList<FlowVariable>();
914 915 for (FlowVariable flowVariable : flowVersion.getVariables()) {
915 916 if (flowVariable.getStatusVariable() == null) {
916 917 flowVariable.setStatusVariable(false);
917 918 }
918 919 if (flowVariable.getStatusVariable()) {
919   - boolean hasFlowStatus = this.hasFlowStatus(flowVersion, flowVariable.getVariable().getName());
920   - if (!hasFlowStatus) {
921   - flowVersion.getVariables().remove(flowVariable);
922   - }else{
  920 + if (this.hasFlowStatus(flowVersion, flowVariable.getVariable().getName())) {
923 921 flowVariable.setOutput(true);
924 922 flowVariable.setPersistentVariable(true);
925 923 flowVariable.setReturnVariable(true);
926 924 flowVariable.setStatusVariable(true);
  925 + newList.add(flowVariable);
927 926 }
  927 + }else{
  928 + newList.add(flowVariable);
928 929 }
929 930 }
  931 + flowVersion.setVariables(newList);
930 932 for (FlowStatus flowStatus : flowVersion.getStatusList()) {
931 933 if (flowStatus.getAcronym() != null) {
932 934 if (!this.hasStatusVariable(flowVersion, flowStatus.getAcronym())) {
... ...
cit-esi-api/src/main/java/br/com/centralit/esi/api/execution/model/ProcessInstanceVariableValue.java
... ... @@ -83,13 +83,13 @@ public class ProcessInstanceVariableValue extends PersistentObject {
83 83 if (value instanceof String)
84 84 this.setStringValue((String)value);
85 85 else
86   - this.setStringValue(ConvertUtilsESI.toJson(value));
  86 + this.setStringValue(ConvertUtilsESI.toJSONString(value));
87 87 break;
88 88 case BUSINESSRULE:
89 89 if (value instanceof String)
90 90 this.setStringValue((String)value);
91 91 else
92   - this.setStringValue(ConvertUtilsESI.toJson(value));
  92 + this.setStringValue(ConvertUtilsESI.toJSONString(value));
93 93 break;
94 94 case JSON:
95 95 if (value instanceof String)
... ... @@ -130,11 +130,11 @@ public class ProcessInstanceVariableValue extends PersistentObject {
130 130 break;
131 131 case JAVAOBJECT:
132 132 if (this.getStringValue() != null && flowVariable.getVariable().getClassName() != null)
133   - result = ConvertUtilsESI.fromJson(this.getStringValue(), flowVariable.getVariable().getClassName());
  133 + result = ConvertUtilsESI.fromJSONString(this.getStringValue(), flowVariable.getVariable().getClassName());
134 134 break;
135 135 case BUSINESSRULE:
136 136 if (this.getStringValue() != null)
137   - result = ConvertUtilsESI.fromJson(this.getStringValue(), BusinessRule.class.getName());
  137 + result = ConvertUtilsESI.fromJSONString(this.getStringValue(), BusinessRule.class.getName());
138 138 break;
139 139 default:
140 140 result = this.getStringValue();
... ...
cit-esi-api/src/main/java/br/com/centralit/esi/api/execution/service/task/WorkItemDatabaseTransactionServiceImpl.java
... ... @@ -84,7 +84,7 @@ public class WorkItemDatabaseTransactionServiceImpl extends WorkItemServiceImpl&lt;
84 84  
85 85 runtimeEnvironment.addOrUpdateObject(databaseTransaction.getOutuptVariableName(), ConvertUtilsESI.buildJSONArray(resultSet));
86 86 }else if (!databaseTransaction.getSQLType().equals(SqlClauseTypeEnum.DELETE)) {
87   - runtimeEnvironment.addOrUpdateObject(databaseTransaction.getOutuptVariableName(), ConvertUtilsESI.toJson(result));
  87 + runtimeEnvironment.addOrUpdateObject(databaseTransaction.getOutuptVariableName(), new JSONObject(ConvertUtilsESI.toJSONString(result)));
88 88 }
89 89 }
90 90  
... ...
cit-esi-api/src/main/java/br/com/centralit/esi/api/resource/service/impl/FormPageServiceImpl.java
... ... @@ -96,8 +96,8 @@ public class FormPageServiceImpl extends GenericServiceImpl&lt;FormPage, Long&gt; impl
96 96 String pageCode = this.replaceTags(formVersion, formPage.getPageCode());
97 97 pageCode = pageCode.replaceAll("\\$\\{controllerName\\}", formPage.getControllerName());
98 98  
99   - String headerLine1 = "'use strict';\n\ncitApp.controller('"+formPage.getControllerName()+"', ['$scope', 'appService', 'environmentService', 'userInterfaceService', 'subscriberService', 'flowService', 'documentService', 'businessProcessService', 'businessRuleService', 'notificationService', 'formService', 'userTaskService', 'dataService', '$timeout', '$translate', '$compile', '$injector', '$rootScope', '$modal'";
100   - String headerLine2 = " function "+formPage.getControllerName()+"($scope, appService, environmentService, userInterfaceService, subscriberService, flowService, documentService, businessProcessService, businessRuleService, notificationService, formService, userTaskService, dataService, $timeout, $translate, $compile, $injector, $rootScope, $modal";
  99 + String headerLine1 = "'use strict';\n\ncitApp.controller('"+formPage.getControllerName()+"', ['$scope', 'appService', 'environmentService', 'userInterfaceService', 'subscriberService', 'flowService', 'documentService', 'businessProcessService', 'businessRuleService', 'notificationService', 'formService', 'userTaskService', 'dataService', '$timeout', '$translate', '$compile', '$injector', '$rootScope', '$modal', '$filter'";
  100 + String headerLine2 = " function "+formPage.getControllerName()+"($scope, appService, environmentService, userInterfaceService, subscriberService, flowService, documentService, businessProcessService, businessRuleService, notificationService, formService, userTaskService, dataService, $timeout, $translate, $compile, $injector, $rootScope, $modal, $filter";
101 101 if (formPage.getDependencies() != null) {
102 102 for (String dependency : formPage.getDependencies()) {
103 103 if (headerLine1.indexOf(dependency.trim()) < 0) {
... ...
cit-esi-api/src/main/java/br/com/centralit/esi/api/scheduler/model/EventJob.java
... ... @@ -182,7 +182,7 @@ public class EventJob extends PersistentObject {
182 182 }
183 183  
184 184 private void buildData() {
185   - this.data = this.environmentInput != null ? ConvertUtilsESI.toJson(this.environmentInput) : null;
  185 + this.data = this.environmentInput != null ? ConvertUtilsESI.toJSONString(this.environmentInput) : null;
186 186 }
187 187  
188 188 /**
... ...
cit-esi-api/src/main/java/br/com/centralit/esi/api/util/ConvertUtilsESI.java
... ... @@ -131,11 +131,11 @@ public class ConvertUtilsESI {
131 131 return null;
132 132 }
133 133  
134   - public static String toJson(Object obj) {
  134 + public static String toJSONString(Object obj) {
135 135 return getGson().toJson(obj);
136 136 }
137 137  
138   - public static Object fromJson(String valor, String classe) {
  138 + public static Object fromJSONString(String valor, String classe) {
139 139 try {
140 140 Class<?> clazz = Class.forName(classe);
141 141 return getGson().fromJson(valor, clazz);
... ... @@ -169,7 +169,7 @@ public class ConvertUtilsESI {
169 169 }else if (value instanceof Boolean || value instanceof Long || value instanceof Integer || value instanceof Double || value instanceof Float) {
170 170 return value.toString();
171 171 }else if (value instanceof HashMap) {
172   - return toJson(value);
  172 + return toJSONString(value);
173 173 }else if (value instanceof Calendar) {
174 174 SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
175 175 return dateFormat.format(((Calendar) value).getTime());
... ... @@ -191,9 +191,9 @@ public class ConvertUtilsESI {
191 191  
192 192 if (strValue != null) {
193 193 if (isJsonArray(strValue)) {
194   - return fromJson((String) strValue, List.class.getName());
  194 + return fromJSONString((String) strValue, List.class.getName());
195 195 }else if (clazz!= null) {
196   - return fromJson((String) strValue, clazz);
  196 + return fromJSONString((String) strValue, clazz);
197 197 }else{
198 198 return null;
199 199 }
... ... @@ -356,7 +356,7 @@ public class ConvertUtilsESI {
356 356 }else if (value instanceof JSONArray || value instanceof JSONObject) {
357 357 result = value;
358 358 }else if (value instanceof HashMap) {
359   - String str = toJson(value);
  359 + String str = toJSONString(value);
360 360 if (isJsonArray(str)) {
361 361 result = new JSONArray(str);
362 362 }else{
... ... @@ -367,7 +367,7 @@ public class ConvertUtilsESI {
367 367 result = json;
368 368 }
369 369 }else{
370   - result = toJson(value);
  370 + result = toJSONString(value);
371 371 }
372 372 return result;
373 373 }
... ...
cit-esi-web/src/main/java/br/com/centralit/listener/StartupListenerEsi.java
... ... @@ -1472,6 +1472,8 @@ public class StartupListenerEsi extends UtilStartup implements ApplicationListen
1472 1472  
1473 1473 formWidget.getProperties().add(new FormWidgetProperty(formWidget, this.findProperty("ng-label", properties)));
1474 1474 formWidget.getProperties().add(new FormWidgetProperty(formWidget, this.findProperty("ng-model", properties)));
  1475 + formWidget.getProperties().add(new FormWidgetProperty(formWidget, this.findProperty("ng-min-number", properties)));
  1476 + formWidget.getProperties().add(new FormWidgetProperty(formWidget, this.findProperty("ng-max-number", properties)));
1475 1477 formWidget.getProperties().add(new FormWidgetProperty(formWidget, this.findProperty("ng-evento-blur", properties)));
1476 1478 formWidget.getProperties().add(new FormWidgetProperty(formWidget, this.findProperty("ng-evento-change", properties)));
1477 1479 formWidget.getProperties().add(new FormWidgetProperty(formWidget, this.findProperty("ng-show", properties)));
... ...
cit-esi-web/src/main/webapp/assets/js/angular/custom/directive/html/interfaceUsuario.html
... ... @@ -37,12 +37,10 @@
37 37 </div>
38 38 <div class='row' ng-if="(interfaceUsuario.resource || interfaceUsuario.executeCustomPage) && exibeHtmlAdicional">
39 39 <div class='col-sm-12'>
40   - <label-text-area ng-id="interfaceUsuario.aditionalHtmlCode"
41   - ng-label="ESI.HTML_INF_ADICIONAL" rows="20" form="form"
42   - ng-obrigatorio="true" ng-model="interfaceUsuario.aditionalHtmlCode"
43   - ng-custom-maxlength="32000"
44   - ng-evento-change="eventoChange()">
45   - </label-text-area>
  40 + <div class='col-sm-12'>
  41 + <label class='control-label'><translate>ESI.HTML_INF_ADICIONAL</translate></label>
  42 + <div ui-ace="{ useWrapMode: true, theme:'eclipse', mode: 'html' }" ng-model="interfaceUsuario.aditionalHtmlCode" ng-change="eventoChange()"></div>
  43 + </div>
46 44 </div>
47 45 </div>
48 46  
... ...
cit-esi-web/src/main/webapp/assets/js/angular/custom/directive/html/variavelElementoFluxo.html
... ... @@ -19,7 +19,7 @@
19 19 <tfoot>
20 20 </tfoot>
21 21 <tbody>
22   - <tr ng-repeat="variavelFluxo in versaoFluxo.variables">
  22 + <tr ng-repeat="variavelFluxo in versaoFluxo.variables" ng-if="!variavelFluxo.statusVariable">
23 23 <td>{{variavelFluxo.variable.name}}</td>
24 24 <td>{{dominio.getEnumDescription(variavelFluxo.variable.variableType, tiposDeVariavel)}}</td>
25 25 <td class="text-center">
... ...