2014-08-22 01:50 PM
Hello Mates - I need help with a workflow. I have attached dar file.
This workflow works perfectly for us. We are looking for one improvement to this.
In the qtree/share name sometimes, for an example: we give either qtree_name as a name which there is no issues in using this.
Sometime we give qtree_name_XXXX and we get this number from an excel sheet and after using we increment by 1 in the excel sheet, which is a manual process today.
What I want is a text file stored in the wfa server (c:\incr.txt) say with a number to start with 8000.
Just above Qtree/Share name in the workflow, I want an option
Add Unique id - Yes/No.
If yes we need to pull the number 8000 from the txt file, number pops in the Qtree/Share name area and increment that txt file by 1
if no nothing happens.
Is this possible ?
May be we can do without a text file. I am not sure how. The other thing is we don’t want to scan existing qtrees and then increment.
2014-08-24 10:59 PM
you can add a custom function like below which will accept the name ending with numeric (test_800) this function will return next name as (test_801).:
java.util.regex.Pattern RESOLVE_PATTERN = java.util.regex.Pattern.compile(
java.util.regex.Matcher matcher = RESOLVE_PATTERN.matcher(name);
String prefix = matcher.group(1);
String number = matcher.group(2);
return prefix + String.valueOf((Integer.valueOf(number)+1));
throwException('The input must be in the format of: <string prefix><number suffix>');
2014-08-25 11:02 AM
Thanks for the response. I am learning WFA and let me try to get some understanding of your code to begin with.
Looks too complicated to me though.