152 getListFromState instance_operation_default *** fix exception handlng
This commit is contained in:
+1
-1
@@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
//variables.framework.docs={};
|
//variables.framework.docs={};
|
||||||
variables.framework.docs.APIName="svc-api";
|
variables.framework.docs.APIName="svc-api";
|
||||||
variables.framework.docs.APIVersion="0.151"; /*$ git config --global --unset user.password*/
|
variables.framework.docs.APIVersion="0.152"; /*$ git config --global --unset user.password*/
|
||||||
|
|
||||||
variables.framework.globalHeaders = structNew();
|
variables.framework.globalHeaders = structNew();
|
||||||
variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location";
|
variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location";
|
||||||
|
|||||||
@@ -45,9 +45,11 @@
|
|||||||
</cfif>
|
</cfif>
|
||||||
|
|
||||||
<!--- получаем параметры из свежего стейта --->
|
<!--- получаем параметры из свежего стейта --->
|
||||||
<cfset local.instanceDataParams={}/>
|
<cfset local.instanceDataParams = {}/>
|
||||||
|
<cfset var currentState = {}/>
|
||||||
<cfquery name="local.qState" result="local.result">
|
<cfquery name="local.qState" result="local.result">
|
||||||
select instance_data->'params' as params
|
select instance_data->'params' as params,
|
||||||
|
instance_data::text as instance_data
|
||||||
from instance_state
|
from instance_state
|
||||||
where instance_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#arguments.instanceUid#" null=#!isValid('guid',arguments.instanceUid)#/>
|
where instance_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#arguments.instanceUid#" null=#!isValid('guid',arguments.instanceUid)#/>
|
||||||
order by version desc
|
order by version desc
|
||||||
@@ -55,6 +57,7 @@
|
|||||||
</cfquery>
|
</cfquery>
|
||||||
<cfif local.qState.recordCount GT 0>
|
<cfif local.qState.recordCount GT 0>
|
||||||
<cftry>
|
<cftry>
|
||||||
|
<cfset var currentState = deserializeJson(local.qState.instance_data)/>
|
||||||
<cfset local.instanceDataParams = deserializeJson(local.qState.params)/>
|
<cfset local.instanceDataParams = deserializeJson(local.qState.params)/>
|
||||||
<cfcatch type="ANY">
|
<cfcatch type="ANY">
|
||||||
<cfdump var=#cfcatch#/><cfabort/>
|
<cfdump var=#cfcatch#/><cfabort/>
|
||||||
@@ -91,6 +94,7 @@
|
|||||||
<!--- <m:field>p.config::text as config</m:field> --->
|
<!--- <m:field>p.config::text as config</m:field> --->
|
||||||
<m:field>p.config::text</m:field><!--- в таком виде конфиг доступен для кода, но не выводится в респонсе --->
|
<m:field>p.config::text</m:field><!--- в таком виде конфиг доступен для кода, но не выводится в респонсе --->
|
||||||
<m:field>null as nested_ref_data</m:field>
|
<m:field>null as nested_ref_data</m:field>
|
||||||
|
<m:field>p.state_path</m:field>
|
||||||
<m:field formatter=#request.castToBool#>(
|
<m:field formatter=#request.castToBool#>(
|
||||||
select 1 from svc_operation_cfs_param m
|
select 1 from svc_operation_cfs_param m
|
||||||
join svc_operation om on (m.svc_operation_id=om.svc_operation_id)
|
join svc_operation om on (m.svc_operation_id=om.svc_operation_id)
|
||||||
@@ -130,6 +134,17 @@
|
|||||||
}/>
|
}/>
|
||||||
<cfinvoke component="instance_operation_cfs_param" method="generateClosure" argumentCollection=#args# returnVariable="local.fNestedRef"/>
|
<cfinvoke component="instance_operation_cfs_param" method="generateClosure" argumentCollection=#args# returnVariable="local.fNestedRef"/>
|
||||||
<cfset local.qCfsParam.nested_ref_data = local.fNestedRef() />
|
<cfset local.qCfsParam.nested_ref_data = local.fNestedRef() />
|
||||||
|
<cfelseif len(local.qCfsParam.state_path) AND isStruct(currentState)><!--- deserializeJson может вернуть пустую строку вместо структуры,
|
||||||
|
по крайней мере, если получает поле пустого резалтсета --->
|
||||||
|
<cfset var args = {
|
||||||
|
"state":#currentState#,
|
||||||
|
"path":"#local.qCfsParam.state_path#"
|
||||||
|
}/>
|
||||||
|
<cfinvoke component="instance_operation_cfs_param"
|
||||||
|
method="getListFromState"
|
||||||
|
argumentCollection=#args#
|
||||||
|
returnVariable="local.qCfsParam.value_list"
|
||||||
|
/>
|
||||||
</cfif>
|
</cfif>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user