152 getListFromState instance_operation_default *** fix exception handlng
This commit is contained in:
@@ -45,9 +45,11 @@
|
||||
</cfif>
|
||||
|
||||
<!--- получаем параметры из свежего стейта --->
|
||||
<cfset local.instanceDataParams={}/>
|
||||
<cfset local.instanceDataParams = {}/>
|
||||
<cfset var currentState = {}/>
|
||||
<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
|
||||
where instance_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#arguments.instanceUid#" null=#!isValid('guid',arguments.instanceUid)#/>
|
||||
order by version desc
|
||||
@@ -55,6 +57,7 @@
|
||||
</cfquery>
|
||||
<cfif local.qState.recordCount GT 0>
|
||||
<cftry>
|
||||
<cfset var currentState = deserializeJson(local.qState.instance_data)/>
|
||||
<cfset local.instanceDataParams = deserializeJson(local.qState.params)/>
|
||||
<cfcatch type="ANY">
|
||||
<cfdump var=#cfcatch#/><cfabort/>
|
||||
@@ -91,6 +94,7 @@
|
||||
<!--- <m:field>p.config::text as config</m:field> --->
|
||||
<m:field>p.config::text</m:field><!--- в таком виде конфиг доступен для кода, но не выводится в респонсе --->
|
||||
<m:field>null as nested_ref_data</m:field>
|
||||
<m:field>p.state_path</m:field>
|
||||
<m:field formatter=#request.castToBool#>(
|
||||
select 1 from svc_operation_cfs_param m
|
||||
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"/>
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user