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
5 replies
Subscribers
7 subscribers
Views
4001 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
I would like to store array values of a process variable into a cdt. For exampl
zulfiqarp
over 9 years ago
I would like to store array values of a process variable into a cdt. For example, I would like to store dept variable with values :{"Accounting","Finance","Operations"} to a cdt deptDetail with values {dept:"Accounting", deptSalary:""}, {dept:"Finance",deptSalary:""}, {dept:"Operations", deptSalary:""}. How can I write a loop function to store a process variable of multiple type and store value in a cdt by row? I am using a script task output section to write this value. I have used appended to list besides using stored values, but its combining all the departments and put them in a single row of cdt.
Thanks!
OriginalPostID-161479
OriginalPostID-161479
Discussion posts and replies are publicly visible
0
sikhivahans
over 9 years ago
@zulfiqarp One of the ways of doing it could be as follows:
apply(
type!deptDetail(
dept:_,
deptSalary:null
),
pv!dept
)
Assuming that pv!dept holds {"Accounting","Finance","Operations"} and is of type multiple.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
zulfiqarp
over 9 years ago
It worked like a charm.... :)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
zulfiqarp
over 9 years ago
@sikhivahans When I save and publish the model that contains this apply function, it adds scheme information after type!{SCHEME://SERVER_AND_PORT/APPLICATION_CONTEXT/types/}deptDetail
It is creating an issue when I move deploy this application from DEV to QA region. Thank you for your help....
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
zulfiqarp
over 9 years ago
@sikhivahans Do you recommend a solution in this regard so that I don't get error, when I move this apply function from one region (DEV) to another region (QA)?
Thanks!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
@zulfiqarp Actually the scheme information which you are saying about is actually the 'Namespace' information. So like wise some Appian objects has some uuid, for instance a Group object or Process Model object has UUID, even CDT has a UUID. And this UUID is formed by Namespace and Name of CDT. In your case, Namespace is SCHEME://SERVER_AND_PORT/APPLICATION_CONTEXT/types/ which might have been formed because you haven't given anything explicitly. Not sure if you are aware of this, but you could also provide your own name space, for example, www.projectname.com. And coming to name of CDT, as you know that it should be obviously unique. So the name space and name of the cdt finally forms a UUID, which means that it is constant across the environments.
Let's say I have created a CDT called 'EmpDetails' without any name space in my environment. If I create an expression rule it looks as follows:
{http://localhost:8080/suite/types/}deptDetail. And now if I export the same cdt to other environment, neither Appian identification of CDT's UUID as Namespace + Name combination nor CDT's name space doesn't change.
Simply speaking, once created, the namespace and name will form an UUID which would be constant across the environments for the life time of the CDT.
And coming to your comment regarding - 'When I save and publish the model that contains this apply function, it adds scheme information after type!'. Please don't worry about it. You might write in a neat manner as follows: type!empDetails(), but Appian ends up in appending the name space also to it and it's the default behavior of Appian.
And regarding 'It is creating an issue when I move deploy this application from DEV to QA region.' - Ideally this shouldn't happen at all. If you could describe me the issue exactly i.e. how you are trying to send the objects to other environment, or the errors you are seeing while export, I could definitely help you. :)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel