Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Suggested Answer
+1
person also asked this
people also asked this
Replies
6 replies
Answers
2 answers
Subscribers
9 subscribers
Views
7482 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Is it possible to map specific fields from one CDT to another within an expressi
ashleyb
over 9 years ago
Is it possible to map specific fields from one CDT to another within an expression rule? So far I have been unsuccessful. Code is below - any suggestion would be greatly appreciated!
with(
cacData : rule!CAC_getExceptionByIDAndNotStatus(ri!crsExceptionID, "Cleared"),
crsData: rule!CAC_getCRSExceptionCollateralByActivityIdAndCollateralCode(pv!cacData.activityID, pv!cacData.typecode),
cacData.crsExceptionID : crsData.ActivityId_Int,
cacData.description : crsData.Description_txt,
cacData.exceptionType : crsData.Type_Txt,
cacData.crsStatus : crsData.Status_Txt,
cacData.deadlineDate : crsData.DeadlineDate_Dte,
cacData.addedDate : crsData.AddedDate_Dte,
cacData.descriptionLine1: crsData.Description1_Txt,
cacData.descriptionLine2: crsData.Description2_Txt,
cacData.recordcd : crsData.RecordCd_Txt,
cacData.loanNumber : crsData.LoanNbr_Int,
cacData.customerNumber : toInteger(crsData.Customer_Dec),
cacData.tiedTable : crsData.TiedTable_Txt,
ca...
OriginalPostID-157746
OriginalPostID-157746
Discussion posts and replies are publicly visible
Parents
+1
sikhivahans
over 9 years ago
@ashleyb If I understand your question correctly, following snippet resolves your query:
with(
\tlocal!cacData : rule!CAC_getExceptionByIDAndNotStatus(ri!crsExceptionID, "Cleared"),
\tlocal!crsData: rule!CAC_getCRSExceptionCollateralByActivityIdAndCollateralCode(pv!cacData.activityID, pv!cacData.typecode),
\t
\t/*Assuming that local!cacData has a single value*/
\tlocal!newCacData:type!cacData(
\ tcrsExceptionID:local!cacData.ActivityId_Int,
\ tdescription: local!crsData.Description_txt,
\ texceptionType: local!crsData.Type_Txt,
\ tcrsStatus: local!crsData.Status_Txt,
\ t... and so on
\t),
\t
\t/*Assuming that local!cacData has multiple values*/
\tlocal!newCacData:apply(
\ ttype!cacData(
\ tcrsExceptionID:,
\ tdescription: _ ,
\ texceptionType: _,
\ tcrsStatus: _,
\ t... and so on
\ t),
\ tmerge(
\ tlocal!cacData.ActivityId_Int,
\ tlocal!crsData.Description_txt,
\ tlocal!crsData.Type_Txt,
\ tlocal!crsData.Status_Txt
\ t...and so on
\ t)
\t),
\ttodatasubset(local!newCacData,topgainginfo(1,-1))
)
Not sure why there is local as well as process variable for cacData, but you could use the PV as long as you place the above content in the process model directly, else you may pass the PV as an rule input to the rule in which above contents are encapsulated.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Reject Answer
Cancel
Reply
+1
sikhivahans
over 9 years ago
@ashleyb If I understand your question correctly, following snippet resolves your query:
with(
\tlocal!cacData : rule!CAC_getExceptionByIDAndNotStatus(ri!crsExceptionID, "Cleared"),
\tlocal!crsData: rule!CAC_getCRSExceptionCollateralByActivityIdAndCollateralCode(pv!cacData.activityID, pv!cacData.typecode),
\t
\t/*Assuming that local!cacData has a single value*/
\tlocal!newCacData:type!cacData(
\ tcrsExceptionID:local!cacData.ActivityId_Int,
\ tdescription: local!crsData.Description_txt,
\ texceptionType: local!crsData.Type_Txt,
\ tcrsStatus: local!crsData.Status_Txt,
\ t... and so on
\t),
\t
\t/*Assuming that local!cacData has multiple values*/
\tlocal!newCacData:apply(
\ ttype!cacData(
\ tcrsExceptionID:,
\ tdescription: _ ,
\ texceptionType: _,
\ tcrsStatus: _,
\ t... and so on
\ t),
\ tmerge(
\ tlocal!cacData.ActivityId_Int,
\ tlocal!crsData.Description_txt,
\ tlocal!crsData.Type_Txt,
\ tlocal!crsData.Status_Txt
\ t...and so on
\ t)
\t),
\ttodatasubset(local!newCacData,topgainginfo(1,-1))
)
Not sure why there is local as well as process variable for cacData, but you could use the PV as long as you place the above content in the process model directly, else you may pass the PV as an rule input to the rule in which above contents are encapsulated.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Reject Answer
Cancel
Children
No Data