ccikara Absent Member.
Absent Member.
445 views

Query a mapping table with a workflow


Hi all,

I have a condition activity that needs to check if a user is in a
certain cost code / company and depening on that, the workflow will have
an approver or not.

My thoughts are to create a Mapping Table in the Library of the driver
set and then query that table from the workflow.

I know I will need to add that mapping table to the DAL as to expose it
to the workflow, but how can I actually query that mapping table??

Thanks in advance


--
ccikara
------------------------------------------------------------------------
ccikara's Profile: http://forums.novell.com/member.php?userid=86966
View this thread: http://forums.novell.com/showthread.php?t=452864

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

Re: Query a mapping table with a workflow

Hi there,

I have it in user attribute data so it is very easy to check. I
recommend making organization data as groups and have users as members
then all you need is to check group membership.

If you wanna go with mapping table you should handle the XML data
attribute "DirXML-Data" with javascript but that should be no problem..
just not very fun to do I think. And automatic updating of the table
sounds definately no fun!

To answer your question use idvault.get with mapping table's dn. Get
DirXML-Data attribute and parse it's XML content with ecmascript
(subroutine) to check the company / cost code.

Hope this helps you.

Pekka

On 03/02/2012 11:36 AM, ccikara wrote:
>
> Hi all,
>
> I have a condition activity that needs to check if a user is in a
> certain cost code / company and depening on that, the workflow will have
> an approver or not.
>
> My thoughts are to create a Mapping Table in the Library of the driver
> set and then query that table from the workflow.
>
> I know I will need to add that mapping table to the DAL as to expose it
> to the workflow, but how can I actually query that mapping table??
>
> Thanks in advance
>
>


0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Query a mapping table with a workflow

Wouldn't it be easier to use an IDVault.get() to retrieve the user's
cost code/company?

Wolfgang

On 02.03.2012 10:36, ccikara wrote:
>
> Hi all,
>
> I have a condition activity that needs to check if a user is in a
> certain cost code / company and depening on that, the workflow will have
> an approver or not.
>
> My thoughts are to create a Mapping Table in the Library of the driver
> set and then query that table from the workflow.
>
> I know I will need to add that mapping table to the DAL as to expose it
> to the workflow, but how can I actually query that mapping table??
>
> Thanks in advance
>
>

0 Likes
ccikara Absent Member.
Absent Member.

Re: Query a mapping table with a workflow


That would be how I query the CostCode / CompanyCode.

But I then need a way to decide what to do with that user depending on
that data, and that can change.

i.e. if user belongs to costCode 1234 then start a new workflow with an
approver, but if cost code is 1245 then start a workflow with no
approver.

I have the basic code developed (for testing) and it works, but there I
check the user's cost code against an array of cost codes and if the
cost code is in the array return a TRUE. But I need a better way to
manage the array of valid costCodes, like a mapping table...


--
ccikara
------------------------------------------------------------------------
ccikara's Profile: http://forums.novell.com/member.php?userid=86966
View this thread: http://forums.novell.com/showthread.php?t=452864

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Query a mapping table with a workflow

OK, so you have the user DN and the user's CostCode / CompanyCode

Now, it most likely depends on the subsequent logic needs and on what
factors the subsequent logic depends.

But if the logic depends on information present in the IDVault, you
might run a custom query or look-ups with the CostCode / CompanyCode as
parameters - similar to the logic that generates your mapping table.

If the relevant info for your decision is in the directory, you
typically can use script logic to get it.

If that mapping table is created 'manually', you may be out of luck with
that approach.

Wolfgang


On 02.03.2012 13:16, ccikara wrote:
>
> That would be how I query the CostCode / CompanyCode.
>
> But I then need a way to decide what to do with that user depending on
> that data, and that can change.
>
> i.e. if user belongs to costCode 1234 then start a new workflow with an
> approver, but if cost code is 1245 then start a workflow with no
> approver.
>
> I have the basic code developed (for testing) and it works, but there I
> check the user's cost code against an array of cost codes and if the
> cost code is in the array return a TRUE. But I need a better way to
> manage the array of valid costCodes, like a mapping table...
>
>

0 Likes
mkreim Absent Member.
Absent Member.

Re: Query a mapping table with a workflow

I would add a multivalue attribute to an ou which contains the cost
codes for which the workflow has to be started. It's easy to query and
to compare with the users cost code and it's easy to maintain.

Greetings
Matthias


Am 02.03.2012 13:16, schrieb ccikara:
>
> That would be how I query the CostCode / CompanyCode.
>
> But I then need a way to decide what to do with that user depending on
> that data, and that can change.
>
> i.e. if user belongs to costCode 1234 then start a new workflow with an
> approver, but if cost code is 1245 then start a workflow with no
> approver.
>
> I have the basic code developed (for testing) and it works, but there I
> check the user's cost code against an array of cost codes and if the
> cost code is in the array return a TRUE. But I need a better way to
> manage the array of valid costCodes, like a mapping table...
>
>


0 Likes
Knowledge Partner
Knowledge Partner

Re: Query a mapping table with a workflow

On 3/2/2012 8:29 AM, Matthias Kreim wrote:
> I would add a multivalue attribute to an ou which contains the cost
> codes for which the workflow has to be started. It's easy to query and
> to compare with the users cost code and it's easy to maintain.


And ironically easy in Policy to watch for changes to a Mapping Table,
and then update the right OU's with the right data. 🙂


> Greetings
> Matthias
>
>
> Am 02.03.2012 13:16, schrieb ccikara:
>>
>> That would be how I query the CostCode / CompanyCode.
>>
>> But I then need a way to decide what to do with that user depending on
>> that data, and that can change.
>>
>> i.e. if user belongs to costCode 1234 then start a new workflow with an
>> approver, but if cost code is 1245 then start a workflow with no
>> approver.
>>
>> I have the basic code developed (for testing) and it works, but there I
>> check the user's cost code against an array of cost codes and if the
>> cost code is in the array return a TRUE. But I need a better way to
>> manage the array of valid costCodes, like a mapping table...
>>
>>

>


0 Likes
mkreim Absent Member.
Absent Member.

Re: Query a mapping table with a workflow

Am 02.03.2012 14:40, schrieb Geoffrey Carman:
> On 3/2/2012 8:29 AM, Matthias Kreim wrote:
>> I would add a multivalue attribute to an ou which contains the cost
>> codes for which the workflow has to be started. It's easy to query and
>> to compare with the users cost code and it's easy to maintain.

>
> And ironically easy in Policy to watch for changes to a Mapping Table,
> and then update the right OU's with the right data. 🙂
>


If it is only a list of cost codes which require an approver the mapping
table is not needed.
0 Likes
ccikara Absent Member.
Absent Member.

Re: Query a mapping table with a workflow


Thanks,

I am trying what you suggest, seems like a good solution for now.

I have added an OU to the root of the tree and then added a list of
codes to the OU description attribute, 'ou=approvalModel,o=company'

I then created a DAL entry and deployed it.

Now, in the condition activity... Would it be something as simple as
this??

IDVault.get(initiator , 'frgoUser',
'frgaCompanyCode')==IDVault.get('ou=approvalModel,o=company' ,
'approvalModel', 'Description')

Or would I need to run through the values of description and add them
to an array then compare the value and return a TRUE / FALSE


--
ccikara
------------------------------------------------------------------------
ccikara's Profile: http://forums.novell.com/member.php?userid=86966
View this thread: http://forums.novell.com/showthread.php?t=452864

0 Likes
ccikara Absent Member.
Absent Member.

Re: Query a mapping table with a workflow


Okay, I kinda answered my own question...

I see that when querying a multivalued attribute with Vault.get it
returns an array of values...

So I have written the following code to test and see what I can get
back, problem is, the condition activity is always evaluating to FALSE,
even through the function should eval to TRUE...

function approvalModel()
{
var approvalCodes = IDVault.get('ou=approvalModel,o=firstrand' ,
'approvalModel', 'Description');
for (var i in approvalCodes)
{
if (approvalCodes == '1001')
{
return true;
break;
} else
{
return false;
}
}
}

Any suggestions???

BTW, is there anyway I can test this code or see what is actually
happening?? When I check the UserApp logs I dont see much, it would be
good to see what is actuallty happenig


--
ccikara
------------------------------------------------------------------------
ccikara's Profile: http://forums.novell.com/member.php?userid=86966
View this thread: http://forums.novell.com/showthread.php?t=452864

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Query a mapping table with a workflow

I always try to avoid using mapping tables unless the table is the true
owner of data because I always forget to update it when something
changes. And I feel that table form is not "natural" to LDAP.

Also IMHO just using plain attribute data for costCenter, department and
other organizational data is going half way and leaves you with lots of
things to do.

This grows a bit larger than the topic but my suggestion is to do it the
LDAP way. Save all organizational data to their own objects, use group
class as base and make people in that unit members of the group. Use
auxiliary class to save all data including the workflow boolean. You can
even automate this with driver and delegate this to some office staff
who operates the organizational registry 😉

Then in user application just go through person's group memberships and
determine if the group dn has that workflow attribute TRUE or FALSE. And
your life will be easier in many future situations too.

Pekka

On 03/02/2012 02:16 PM, ccikara wrote:
>
> That would be how I query the CostCode / CompanyCode.
>
> But I then need a way to decide what to do with that user depending on
> that data, and that can change.
>
> i.e. if user belongs to costCode 1234 then start a new workflow with an
> approver, but if cost code is 1245 then start a workflow with no
> approver.
>
> I have the basic code developed (for testing) and it works, but there I
> check the user's cost code against an array of cost codes and if the
> cost code is in the array return a TRUE. But I need a better way to
> manage the array of valid costCodes, like a mapping table...
>
>


0 Likes
ccikara Absent Member.
Absent Member.

Re: Query a mapping table with a workflow


Thanks Pekka,

I did some more research and it seems that querying that mapping table
is out of my JavaScript reach for now 😉
All the info on the web parses standard XML and not the format that the
MappingTable is in, so it will take me time to try figure that out...

What you think about having the list in a GCV??


--
ccikara
------------------------------------------------------------------------
ccikara's Profile: http://forums.novell.com/member.php?userid=86966
View this thread: http://forums.novell.com/showthread.php?t=452864

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Query a mapping table with a workflow

I think you can parse a mapping table with ecmascript, just use string
functions and loop it through. You can also use maybe a GCV list or
multivalue attribute. But in the long run you end up with dozens of
mapping tables and lists and you get lost if your system grows bigger.

I strongly suggest you take a time out and think about the whole
organizational data model in your identity vault.

Pekka

On 03/02/2012 02:26 PM, ccikara wrote:
>
> Thanks Pekka,
>
> I did some more research and it seems that querying that mapping table
> is out of my JavaScript reach for now 😉
> All the info on the web parses standard XML and not the format that the
> MappingTable is in, so it will take me time to try figure that out...
>
> What you think about having the list in a GCV??
>
>


0 Likes
ccikara Absent Member.
Absent Member.

Re: Query a mapping table with a workflow


Okay, I kinda answered my own question...

I see that when querying a multivalued attribute with Vault.get it
returns an array of values...

So I have written the following code to test and see what I can get
back, problem is, the condition activity is always evaluating to FALSE,
even through the function should eval to TRUE...

function approvalModel()
{
var approvalCodes = IDVault.get('ou=approvalModel,o=firstrand' ,
'approvalModel', 'Description');
for (var i in approvalCodes)
{
if (approvalCodes == '1001')
{
return true;
break;
} else
{
return false;
}
}
}

Any suggestions???


--
ccikara
------------------------------------------------------------------------
ccikara's Profile: http://forums.novell.com/member.php?userid=86966
View this thread: http://forums.novell.com/showthread.php?t=452864

0 Likes
mkreim Absent Member.
Absent Member.

Re: Query a mapping table with a workflow

if (approvalCodes == '1001')



Am 05.03.2012 08:36, schrieb ccikara:
>
> Okay, I kinda answered my own question...
>
> I see that when querying a multivalued attribute with Vault.get it
> returns an array of values...
>
> So I have written the following code to test and see what I can get
> back, problem is, the condition activity is always evaluating to FALSE,
> even through the function should eval to TRUE...
>
> function approvalModel()
> {
> var approvalCodes = IDVault.get('ou=approvalModel,o=firstrand' ,
> 'approvalModel', 'Description');
> for (var i in approvalCodes)
> {
> if (approvalCodes == '1001')
> {
> return true;
> break;
> } else
> {
> return false;
> }
> }
> }
>
> Any suggestions???
>
>


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.