Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
juanma1 Contributor.
Contributor.
208 views

Get data from Approval form


Hello, we have a problem with flowdata and "not form" activity

Activity 1: (Start)

- Start activity have a picklist (resources) populated with several
DN's
- Data Item Mapping/Post Activity:
resources flowdata.start/request_form/resources dn

Activity 2: (Approval)
-Approval Activity, have a picklist (resources) populated with data from
Start activity:
- Data Item Mapping/Pre Activity:
flowdata.getObject('start/request_form/resources') resources
dn

- Data Item Mapping/Post Activity:
resources flowdata.approval/approval_form/resources
dn

Activity 3: (Resource Request)
Resource Property have a ECMAscript expresion to display all data

ECMASCRIPT:


Code:
--------------------
function bucleRecursos() {
Packages.java.lang.System.out.println("JM: bucleRecursos()");

MyLoop('start/request_form/resources');
MyLoop('approval/approval_form/resources');

// fake return
return 'CN=VISUALSTUDIO,CN=Desarrollo,CN=ResourceDefs,CN=RoleConfig,CN=AppConfig,CN=User Application Driver,CN=driverset1,O=system'
}


function MyLoop(dataFlow) {
Packages.java.lang.System.out.println("JM:" + dataFlow);
v=new java.util.Vector();
ips=flowdata.getObject(dataFlow);
Packages.java.lang.System.out.println("JM: size="+ips.size());
for(var x=0;x<ips.size();x++) {
data = ips.get(x).getFirstChild().getNodeValue()
v.add(data);
Packages.java.lang.System.out.println("JM: loop="+x);
Packages.java.lang.System.out.println("JM: data="+data);
}
return v;
}
--------------------



When call to function, the first time (
MyLoop('start/request_form/resources') ) output are:

JM:start/request_form/recursos
JM: size=3
JM: loop=0
JM: data=cn=Adobe,cn=Aplicaciones
Ofimáticas,cn=ResourceDefs,cn=RoleConfig,cn=AppConfig,cn=User
Application Driver,cn=driverset1,o=system
JM: loop=1
JM: data=cn=Antivirus,cn=Aplicaciones
Ofimáticas,cn=ResourceDefs,cn=RoleConfig,cn=AppConfig,cn=User
Application Driver,cn=driverset1,o=system
JM: loop=2
JM: data=cn=Aplicación Ofimática,cn=Aplicaciones
Ofimáticas,cn=ResourceDefs,cn=RoleConfig,cn=AppConfig,cn=User
Application Driver,cn=driverset1,o=system


The second time, ( MyLoop('approval/approval_form/resources') ), output
are:

JM:approval/approval_form/recursos
JM: size=0




How we can read data from Approval activity ?

Thx


--
juanma
------------------------------------------------------------------------
juanma's Profile: https://forums.netiq.com/member.php?userid=332
View this thread: https://forums.netiq.com/showthread.php?t=53635

Labels (1)
0 Likes
4 Replies
Anonymous_User Absent Member.
Absent Member.

Re: Get data from Approval form

On 06/08/2015 03:15 AM, juanma wrote:
>
> Hello, we have a problem with flowdata and "not form" activity
>
> Activity 1: (Start)
>
> - Start activity have a picklist (resources) populated with several
> DN's
> - Data Item Mapping/Post Activity:
> resources flowdata.start/request_form/resources dn
>
> Activity 2: (Approval)
> -Approval Activity, have a picklist (resources) populated with data from
> Start activity:
> - Data Item Mapping/Pre Activity:
> flowdata.getObject('start/request_form/resources') resources
> dn
>
> - Data Item Mapping/Post Activity:
> resources flowdata.approval/approval_form/resources
> dn
>
> Activity 3: (Resource Request)
> Resource Property have a ECMAscript expresion to display all data
>
> ECMASCRIPT:
>
>
> Code:
> --------------------
> function bucleRecursos() {
> Packages.java.lang.System.out.println("JM: bucleRecursos()");
>
> MyLoop('start/request_form/resources');
> MyLoop('approval/approval_form/resources');
>
> // fake return
> return 'CN=VISUALSTUDIO,CN=Desarrollo,CN=ResourceDefs,CN=RoleConfig,CN=AppConfig,CN=User Application Driver,CN=driverset1,O=system'
> }
>
>
> function MyLoop(dataFlow) {
> Packages.java.lang.System.out.println("JM:" + dataFlow);
> v=new java.util.Vector();
> ips=flowdata.getObject(dataFlow);
> Packages.java.lang.System.out.println("JM: size="+ips.size());
> for(var x=0;x<ips.size();x++) {
> data = ips.get(x).getFirstChild().getNodeValue()
> v.add(data);
> Packages.java.lang.System.out.println("JM: loop="+x);
> Packages.java.lang.System.out.println("JM: data="+data);
> }
> return v;
> }
> --------------------
>
>
>
> When call to function, the first time (
> MyLoop('start/request_form/resources') ) output are:
>
> JM:start/request_form/recursos
> JM: size=3
> JM: loop=0
> JM: data=cn=Adobe,cn=Aplicaciones
> Ofim�ticas,cn=ResourceDefs,cn=RoleConfig,cn=AppConfig,cn=User
> Application Driver,cn=driverset1,o=system
> JM: loop=1
> JM: data=cn=Antivirus,cn=Aplicaciones
> Ofim�ticas,cn=ResourceDefs,cn=RoleConfig,cn=AppConfig,cn=User
> Application Driver,cn=driverset1,o=system
> JM: loop=2
> JM: data=cn=Aplicaci�n Ofim�tica,cn=Aplicaciones
> Ofim�ticas,cn=ResourceDefs,cn=RoleConfig,cn=AppConfig,cn=User
> Application Driver,cn=driverset1,o=system
>
>
> The second time, ( MyLoop('approval/approval_form/resources') ), output
> are:
>
> JM:approval/approval_form/recursos
> JM: size=0
>
>
>
>
> How we can read data from Approval activity ?
>
> Thx
>
>

Greetings,
Without seeing the actual workflow it is a little hard to know for
sure what is happening. I would tend to believe that the user during
the Approval Activity is not selecting the "resources" within the
Picklist. Unless the items in the Picklist are selected (either by the
person or via code) then they will not be included when the form is
submitted. That would by why the flowdata entry of
"approval/approval_form/resources" has zero (0) entries.

--

Sincerely,
Steven Williams
Lead Software Engineer
NetIQ
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Get data from Approval form

On 06/09/2015 06:30 AM, Steven Williams wrote:
> On 06/08/2015 03:15 AM, juanma wrote:
>>
>> Hello, we have a problem with flowdata and "not form" activity
>>
>> Activity 1: (Start)
>>
>> - Start activity have a picklist (resources) populated with several
>> DN's
>> - Data Item Mapping/Post Activity:
>> resources flowdata.start/request_form/resources dn
>>
>> Activity 2: (Approval)
>> -Approval Activity, have a picklist (resources) populated with data from
>> Start activity:
>> - Data Item Mapping/Pre Activity:
>> flowdata.getObject('start/request_form/resources') resources
>> dn
>>
>> - Data Item Mapping/Post Activity:
>> resources flowdata.approval/approval_form/resources
>> dn
>>
>> Activity 3: (Resource Request)
>> Resource Property have a ECMAscript expresion to display all data
>>
>> ECMASCRIPT:
>>
>>
>> Code:
>> --------------------
>> function bucleRecursos() {
>> Packages.java.lang.System.out.println("JM: bucleRecursos()");
>>
>> MyLoop('start/request_form/resources');
>> MyLoop('approval/approval_form/resources');
>>
>> // fake return
>> return
>> 'CN=VISUALSTUDIO,CN=Desarrollo,CN=ResourceDefs,CN=RoleConfig,CN=AppConfig,CN=User
>> Application Driver,CN=driverset1,O=system'
>> }
>>
>>
>> function MyLoop(dataFlow) {
>> Packages.java.lang.System.out.println("JM:" + dataFlow);
>> v=new java.util.Vector();
>> ips=flowdata.getObject(dataFlow);
>> Packages.java.lang.System.out.println("JM: size="+ips.size());
>> for(var x=0;x<ips.size();x++) {
>> data = ips.get(x).getFirstChild().getNodeValue()
>> v.add(data);
>> Packages.java.lang.System.out.println("JM: loop="+x);
>> Packages.java.lang.System.out.println("JM: data="+data);
>> }
>> return v;
>> }
>> --------------------
>>
>>
>>
>> When call to function, the first time (
>> MyLoop('start/request_form/resources') ) output are:
>>
>> JM:start/request_form/recursos
>> JM: size=3
>> JM: loop=0
>> JM: data=cn=Adobe,cn=Aplicaciones
>> Ofim�ticas,cn=ResourceDefs,cn=RoleConfig,cn=AppConfig,cn=User
>> Application Driver,cn=driverset1,o=system
>> JM: loop=1
>> JM: data=cn=Antivirus,cn=Aplicaciones
>> Ofim�ticas,cn=ResourceDefs,cn=RoleConfig,cn=AppConfig,cn=User
>> Application Driver,cn=driverset1,o=system
>> JM: loop=2
>> JM: data=cn=Aplicaci�n Ofim�tica,cn=Aplicaciones
>> Ofim�ticas,cn=ResourceDefs,cn=RoleConfig,cn=AppConfig,cn=User
>> Application Driver,cn=driverset1,o=system
>>
>>
>> The second time, ( MyLoop('approval/approval_form/resources') ), output
>> are:
>>
>> JM:approval/approval_form/recursos
>> JM: size=0
>>
>>
>>
>>
>> How we can read data from Approval activity ?
>>
>> Thx
>>
>>

> Greetings,
> Without seeing the actual workflow it is a little hard to know for
> sure what is happening. I would tend to believe that the user during
> the Approval Activity is not selecting the "resources" within the
> Picklist. Unless the items in the Picklist are selected (either by the
> person or via code) then they will not be included when the form is
> submitted. That would by why the flowdata entry of
> "approval/approval_form/resources" has zero (0) entries.
>

Greetings,
If the "approver" is not going to modify the list of Resources that
were selected on the Request form, then there is no need to put it into
flowdata again after the Approval Activity. In other words, if the
selected values will not be changed at the Approval Activity, then do
not put it into flowdata in the post-activity of the Approval Activity.
You would always look at flowdata variable from the Request
(start/request_form/resources)

--

Sincerely,
Steven Williams
Lead Software Engineer
NetIQ
0 Likes
juanma1 Contributor.
Contributor.

Re: Get data from Approval form


Hi Steven, that was the problem, the list is loaded with data but none
were selected

We need to permit approver to modify the list, so we need to use
flowdata.

Thanks


--
juanma
------------------------------------------------------------------------
juanma's Profile: https://forums.netiq.com/member.php?userid=332
View this thread: https://forums.netiq.com/showthread.php?t=53635

0 Likes
wschreiber1 Absent Member.
Absent Member.

Re: Get data from Approval form

If the approver is not supposed to change/select the field anyway, there
is no sense in putting the outcomes into flowdata in the first place.

Instead of processing "flowdata.approval/approval_form/resources",
simply process the original data from
"flowdata.start/request_form/resources"

Wolfgang

On 17.06.2015 11:16, juanma wrote:
>
> Hi Steven, that was the problem, the list is loaded with data but none
> were selected
>
> We need to permit approver to modify the list, so we need to use
> flowdata.
>
> Thanks
>
>

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.