Scripted lanes scripts with complex object arrays

188 views
Skip to first unread message

stor...@gmail.com

unread,
Aug 3, 2018, 5:10:31 AM8/3/18
to Fujitsu RunMyProcess Developer Community
Hi there.

I am having issues trying to make a scripted lane.

In the metadata, I have added an array with locations to determine if a user is counted as a reviewer for that location or not. Each reviewer could be responsible for several locations.

I have added an image to show how the metadata is setup.

I have this script loop through all the locations that works in the script editor:
<#assign loc = 'Karlskrona' /><#list P_user.extended.idea_generation.reviewer_location as reviewer_location><#if reviewer_location.location == loc >true<#break /></#if></#list>

But it gives this error when I try to run it:
Syntax invalid - Cannot extract script (in 0.006 sec)


Looking through the forums here it seems that the xml form of Freemarker isn't allowed, so I've attempted to write the above in one line:
${ P_user.extended.idea_generation.reviewer_location?seq_contains( {"location": "Karlskrona"} ) }

But ?seq_contains only accepts a string and not an object. I don't know how to loop through the elements without using xml?

Are there any way to look through complex object array's for the scripted lane script?

Regards
Svensson, Peter

metadata.PNG

Pankaj Kumar

unread,
Aug 3, 2018, 9:44:40 AM8/3/18
to Fujitsu RunMyProcess Developer Community
Hi Peter,

I made some test and seems it is limitation of the freemarker API and Scripted lane script constraints.

The workaround of this issue is to use Run-time Lane in which you can get the user based on metadata using script and by "P_add_user_to_lane" in loop fetched from the script.

Please refer to below link or reference

Kindly let me know if you face any issue.

Thank you,
Pankaj Kumar
Fujitsu RunMyProcess Support

Svensson, Peter

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/87dad18f-addc-4b6a-85c2-f6a8cdd691b7%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

stor...@gmail.com

unread,
Aug 3, 2018, 10:09:40 AM8/3/18
to Fujitsu RunMyProcess Developer Community
Hi there.

Sadly a run-time lane does not work for us.
After a task has been initiated, if the review team changes, the access rights to the task should change as well.

A run-time lane can be updated when the task has started, but needs to be updated again depending on changes happening outside of the process at any point.

I think I will try to redesign how I store the data instead. I should be able to build it into a string instead.

Thank you for confirming my suspicion. I was hoping I had missed something :(

Regards
Svensson, Peter

stor...@gmail.com

unread,
Aug 4, 2018, 10:56:42 AM8/4/18
to Fujitsu RunMyProcess Developer Community, stor...@gmail.com
Hi again.

So I have rearranged my scripts so that there will be a string with the different locations instead.

So the lane itself should look something like this:
${ P_user.extended.idea_generation.reviewer_location?contains( "Karlskrona" ) }

Which validates and returns the expected answer in the editor, but when I click check script I get this reply:
Syntax invalid - The parameter ?contains has to be a static string (in 0.008 sec)

How can I make my string static if I cannot use the assign method? The example in the user guide is this:
P_user.login?contains(".fr")

Why does that work, but my code does not?

I don't understand what is wrong, what have I missed?

Regards
Svensson, Peter

Vitthal Jivrag

unread,
Aug 6, 2018, 2:04:10 AM8/6/18
to suppor...@runmyprocess.com, stor...@gmail.com
Hi Peter,

As per your last response You want to add user using Metadata and Preferences properties. we tried to reproduce issue we are getting expected result.

Please make sure some points while using Scripted lanes.
  • The script is relevant for execution modes LIVE and ACCEPTANCE
  • Once you have created your script it is possible to check it. The result will show you how many users meet the criteria (and so will be members of the lane) and the duration of the query.

Please try Code given below and find attachments for more information.

${ P_user.extended.idea_generation.reviewer_location == "India"}

Do feel free to contact us for any other query you have.

Regards,
Vitthal Jivrag
RunMyProcess Support


Regards
Svensson, Peter

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
User Metadata Fields.JPG
Profile configuration.JPG
Script configuration.JPG

stor...@gmail.com

unread,
Aug 6, 2018, 4:41:50 AM8/6/18
to Fujitsu RunMyProcess Developer Community, stor...@gmail.com
Hi there.

Thank you, that does work.

Though I would like to complain about it. The script editor (if clicking on the "</>"-icon) states that the script is incorrect, though the script is computed fine.

It is very unintuitive and confusing to work with as the script breaks conventions.

Is there anywhere I can write a more formal complaint about this?

But again, thank you, this solution works for my purposes :)

Regards
Svensson, Peter

Pankaj Kumar

unread,
Aug 6, 2018, 4:58:26 PM8/6/18
to Fujitsu RunMyProcess Developer Community, Peter Svensson
Hi,

For any complaint/enhancement request, please create a case on RunMyProcess Support Portal



Thank you,
Pankaj Kumar
Fujitsu RunMyProcess Support


Regards
Svensson, Peter

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.

stor...@gmail.com

unread,
Aug 7, 2018, 2:37:53 AM8/7/18
to Fujitsu RunMyProcess Developer Community, stor...@gmail.com
Thank you :)

Regards
Svensson, Peter

Reply all
Reply to author
Forward
0 new messages