Skip to content

Commit 827812c

Browse files
authored
Update }bedrock.security.group.create (#196)
Update }bedrock.security.group.create.pro fixes #187
1 parent b8af53e commit 827812c

1 file changed

Lines changed: 54 additions & 11 deletions

File tree

main/}bedrock.security.group.create.pro

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
586,
55
585,
66
564,
7-
565,"bya[_^`Ce<8\VYO><\gK?:i5>z_li@k3JlsB2^?LUnD13KqyMi_vFWeJVK4dObB=3p9<p7ddX@s<TXva;egQQC:eo9cjFX7KM8t4\9quZ<ToSqrrLV8C8rUD6liRzgByKkyalsRD=>x_2OzUy`3VUbAI:r[\VQcGj;AJ3]rsYe=Sg`zbF8fY[FAKNm9iihic>W?@c3jb"
7+
565,"c6tavyY\4i5uzUh?gAMJ;Me:U8_>[PPZB_THlU_xnNJb]q4BZp24AeaMk]bxzy3=4>FVU<4YVn]6J03Z[[:2xX<Mf^XfbOk@RV5>0kh4G2B=^1:jcuGMX8vEC_c`WRRLm9u8FeUo[cpZb45mPbIB>EdM[byciP@gx?eWQeMJ^v7_2r6Z\5=MZApVbzj7NzR?liJ4:QG>"
88
559,1
99
928,0
1010
593,
@@ -25,25 +25,29 @@
2525
569,0
2626
592,0
2727
599,1000
28-
560,4
28+
560,5
2929
pLogOutput
3030
pStrictErrorHandling
3131
pGroup
32+
pAlias
3233
pDelim
33-
561,4
34+
561,5
3435
1
3536
1
3637
2
3738
2
38-
590,4
39+
2
40+
590,5
3941
pLogOutput,0
4042
pStrictErrorHandling,0
4143
pGroup,""
44+
pAlias,""
4245
pDelim,"&"
43-
637,4
46+
637,5
4447
pLogOutput,"OPTIONAL: Write parameters and action summary to server message log (Boolean True = 1)"
4548
pStrictErrorHandling,"OPTIONAL: On encountering any error, exit with major error status by ProcessQuit after writing to the server message log (Boolean True = 1)"
4649
pGroup,"REQUIRED: Groups separated by delimiter"
50+
pAlias,"OPTIONAL: single or delimited list of }TM1_DefaultDisplayValue alias to assign to group (if list of groups then size of list of aliases must be the same!)"
4751
pDelim,"OPTIONAL: Delimiter character (Defaults to & if left blank)"
4852
577,0
4953
578,0
@@ -52,13 +56,13 @@ pDelim,"OPTIONAL: Delimiter character (Defaults to & if left blank)"
5256
581,0
5357
582,0
5458
603,0
55-
572,99
59+
572,108
5660
#Region CallThisProcess
5761
# A snippet of code provided as an example how to call this process should the developer be working on a system without access to an editor with auto-complete.
5862
If( 1 = 0 );
5963
ExecuteProcess( '}bedrock.security.group.create', 'pLogOutput', pLogOutput,
6064
'pStrictErrorHandling', pStrictErrorHandling,
61-
'pGroup', '', 'pDelim', '&'
65+
'pGroup', '', 'pAlias', '', 'pDelim', '&'
6266
);
6367
EndIf;
6468
#EndRegion CallThisProcess
@@ -126,6 +130,15 @@ If( nErrors <> 0 );
126130
EndIf;
127131
EndIf;
128132

133+
# Alias
134+
If( pAlias @<> '' );
135+
If( DimensionExists( '}ElementAttributes_}Groups' ) = 0 );
136+
AttrInsert( '}Groups', '', '}TM1_DefaultDisplayValue', 'A' );
137+
ElseIf( DimIx( '}ElementAttributes_}Groups', '}TM1_DefaultDisplayValue' ) = 0 );
138+
AttrInsert( '}Groups', '', '}TM1_DefaultDisplayValue', 'A' );
139+
EndIf;
140+
EndIf;
141+
129142
### Split pGroups into individual groups and add ###
130143
sGroups = pGroup;
131144
nDelimiterIndex = 1;
@@ -162,7 +175,7 @@ EndIf;
162175
#****Begin: Generated Statements***
163176
#****End: Generated Statements****
164177

165-
575,30
178+
575,60
166179

167180
#****Begin: Generated Statements***
168181
#****End: Generated Statements****
@@ -171,6 +184,39 @@ EndIf;
171184
##~~Join the bedrock TM1 community on GitHub https://github.com/cubewise-code/bedrock Ver 4.0~~##
172185
#################################################################################################
173186

187+
### Update Alias
188+
189+
If( nErrors = 0 );
190+
191+
sAliases = pAlias;
192+
sGroups = pGroup;
193+
nDelimiterIndex = 1;
194+
195+
While( nDelimiterIndex > 0 );
196+
nDelimiterIndex = Scan( pDelim, sAliases );
197+
If( nDelimiterIndex = 0 );
198+
sAlias = sAliases;
199+
Else;
200+
sAlias = Trim( SubSt( sAliases, 1, nDelimiterIndex - 1 ) );
201+
sAliases = Trim( Subst( sAliases, nDelimiterIndex + Long(pDelim), Long( sAliases ) ) );
202+
EndIf;
203+
nDelimiterIndex = Scan( pDelim, sGroups );
204+
If( nDelimiterIndex = 0 );
205+
sGroup = sGroups;
206+
Else;
207+
sGroup = Trim( SubSt( sGroups, 1, nDelimiterIndex - 1 ) );
208+
sGroups = Trim( Subst( sGroups, nDelimiterIndex + Long(pDelim), Long( sGroups ) ) );
209+
EndIf;
210+
211+
If( DimIx( '}Groups', sGroup ) > 0 );
212+
If( sAlias @<> '' );
213+
AttrPutS( sAlias, '}Groups', sGroup, '}TM1_DefaultDisplayValue', 1 );
214+
EndIf;
215+
EndIf;
216+
End;
217+
218+
EndIf;
219+
174220
### Return code & final error message handling
175221
If( nErrors > 0 );
176222
sMessage = 'the process incurred at least 1 error. Please see above lines in this file for more details.';
@@ -189,10 +235,7 @@ Else;
189235
EndIf;
190236
EndIf;
191237

192-
193-
194238
### End Epilog ###
195-
196239
576,CubeAction=1511 DataAction=1503 CubeLogChanges=0
197240
930,0
198241
638,1

0 commit comments

Comments
 (0)