Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
7 replies
Subscribers
9 subscribers
Views
3527 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Data and Records
I am using an apply function to build SAIL components based on an array of data(
Tim
Certified Lead Developer
over 11 years ago
I am using an apply function to build SAIL components based on an array of data(CDT).
Now that I have upgraded to 7.4 I plugged in the new integerField but receive the following error:
"The load function cannot be used within rules called by looping functions. Instead, pass the necessary variables via rule inputs. Load variables found: local!textValue, local!setIfTextIsNotValid, local!validationFunction, local!validations."
I do not use load() in the rule that creates the SAIL elements and the local! variables listed as being found do not appear anywhere in any of my expressions. I get the same error whilst trying to use dateTimeField - is there something different or restrictive about the new components?...
buildSAILcomponents.txt
OriginalPostID-96067
OriginalPostID-96067
Discussion posts and replies are publicly visible
Parents
0
ryanh
over 11 years ago
I've found multiple references in the forums & release notes to the load() function not working anymore in 7.3/7.4 in certain looping functions. "You cannot use this function within the Web Content Channel or a Looping Function or else an error occurs."
Alert error:
There is a problem with task “Update Days In Process” in the process “ARG: Dev: Update Days in Process - ELAR # 90319”. ERROR:An error occurred while evaluating expression: =if(isnull(apply(rule!roundDurationToDaysBase24,apply(rule!calculateHoldDurationForCollateralService,pv!theCollaterals_ArgCollaterals.collateralId_Int))),0,apply(rule!roundDurationToDaysBase24,apply(rule!calculateHoldDurationForCollateralService,pv!theCollaterals_ArgCollaterals.collateralId_Int))) (Expression evaluation error at function 'apply': Error evaluating function 'apply' : Expression evaluation error in rule 'calculateholddurationforcollateralservice': The load function cannot be used within rules called by looping functions. Instead, pass the necessary variables via rule inputs. Load variables found: local!collateralId, local!arrayOfPlaceOnHoldEvents, local!arrayOfTakeOffHoldEvents.) (Data Inputs)
Here is the primary function in question:
=if(isnull(apply(rule!roundDurationToDaysBase24,apply(rule!calculateHoldDurationForCollateralService,pv!theCollaterals_ArgCollaterals.collateralId_Int))),0,apply(rule!roundDurationToDaysBase24,apply(rule!calculateHoldDurationForCollateralService,pv!theCollaterals_ArgCollaterals.collateralId_Int)))
roundDurationToDaysBase24 = Derives the integer number of days from a duration-type object. Will the number of days up if hours component of duration is greater than or equal to 12.
= if(isnull(ri!duration),0,tointeger(ri!duration)+if((hour(ri!duration))>=12,1,0))
calculateHoldDurationForCollateralService = Returns the total duration (may be sum of several different periods) for which a specific collateral service (identified by parameter collateralId_int) has had the status of "On Hold".
=load(
local!collateralId:ri!collateralId_int,
local!arrayOfPlaceOnHoldEvents: rule!getOnHoldEventsForCollateralService(local!collateralId).timestamp_datetime,
local!arrayOfTakeOffHoldEvents: rule!getHoldReleaseEventsForCollateralService(local!collateralId).timestamp_datetime,
if(
or(
length(local!arrayOfPlaceOnHoldEvents)<1,
isnull(local!arrayOfPlaceOnHoldEvents)
),
0,
if(
length(local!arrayOfPlaceOnHoldEvents)=length(local!arrayOfTakeOffHoldEvents),
reduce(rule!sumDurations,now()-now(),apply(rule!calculateDuration,merge(local!arrayOfPlaceOnHoldEvents,local!arrayOfTakeOffHoldEvents))),
reduce(rule!sumDurations,now()-now(),apply(rule!calculateDuration,merge(local!arrayOfPlaceOnHoldEvents,append(local!arrayOfTakeOffHoldEvents,now()))))
)
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
ryanh
over 11 years ago
I've found multiple references in the forums & release notes to the load() function not working anymore in 7.3/7.4 in certain looping functions. "You cannot use this function within the Web Content Channel or a Looping Function or else an error occurs."
Alert error:
There is a problem with task “Update Days In Process” in the process “ARG: Dev: Update Days in Process - ELAR # 90319”. ERROR:An error occurred while evaluating expression: =if(isnull(apply(rule!roundDurationToDaysBase24,apply(rule!calculateHoldDurationForCollateralService,pv!theCollaterals_ArgCollaterals.collateralId_Int))),0,apply(rule!roundDurationToDaysBase24,apply(rule!calculateHoldDurationForCollateralService,pv!theCollaterals_ArgCollaterals.collateralId_Int))) (Expression evaluation error at function 'apply': Error evaluating function 'apply' : Expression evaluation error in rule 'calculateholddurationforcollateralservice': The load function cannot be used within rules called by looping functions. Instead, pass the necessary variables via rule inputs. Load variables found: local!collateralId, local!arrayOfPlaceOnHoldEvents, local!arrayOfTakeOffHoldEvents.) (Data Inputs)
Here is the primary function in question:
=if(isnull(apply(rule!roundDurationToDaysBase24,apply(rule!calculateHoldDurationForCollateralService,pv!theCollaterals_ArgCollaterals.collateralId_Int))),0,apply(rule!roundDurationToDaysBase24,apply(rule!calculateHoldDurationForCollateralService,pv!theCollaterals_ArgCollaterals.collateralId_Int)))
roundDurationToDaysBase24 = Derives the integer number of days from a duration-type object. Will the number of days up if hours component of duration is greater than or equal to 12.
= if(isnull(ri!duration),0,tointeger(ri!duration)+if((hour(ri!duration))>=12,1,0))
calculateHoldDurationForCollateralService = Returns the total duration (may be sum of several different periods) for which a specific collateral service (identified by parameter collateralId_int) has had the status of "On Hold".
=load(
local!collateralId:ri!collateralId_int,
local!arrayOfPlaceOnHoldEvents: rule!getOnHoldEventsForCollateralService(local!collateralId).timestamp_datetime,
local!arrayOfTakeOffHoldEvents: rule!getHoldReleaseEventsForCollateralService(local!collateralId).timestamp_datetime,
if(
or(
length(local!arrayOfPlaceOnHoldEvents)<1,
isnull(local!arrayOfPlaceOnHoldEvents)
),
0,
if(
length(local!arrayOfPlaceOnHoldEvents)=length(local!arrayOfTakeOffHoldEvents),
reduce(rule!sumDurations,now()-now(),apply(rule!calculateDuration,merge(local!arrayOfPlaceOnHoldEvents,local!arrayOfTakeOffHoldEvents))),
reduce(rule!sumDurations,now()-now(),apply(rule!calculateDuration,merge(local!arrayOfPlaceOnHoldEvents,append(local!arrayOfTakeOffHoldEvents,now()))))
)
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data