Expand my Community achievements bar.

Get the form initiator's id

Avatar

Former Community Member
Is that possible to get the user id in workflow (or something that's uniquely assigned to different users)?



I intended to do something like this:



When initiator opens the form to initiate the workflow process,

the read-only textfields "Staff Name" and "Staff ID" will be filled with the correct details from database.

(This is to validate the form before initiator can submit it to ensure that all forms will be submitted by valid user, and also help to prevent typo of Staff Name and ID)



The problem is...to look up "Staff Name" and "Staff ID" in database accordingly, I need the initiator's id(maybe the login id to form manager?), but how to get it?



Any idea? Thanks in advanced...



Regards,

Leia
8 Replies

Avatar

Former Community Member
Hi Leia,



You can rely on the so-called 'workflow fields', which are automatically populated by workflow server.



On the Workflow CD, look for
/documentation/en, where a document is located called 'creating_workflows.pdf'.



On page 71 it reads:





To use XML forms with LiveCycle Workflow, the form must include several workflow-related fields. To add

the fields, you use LiveCycle Designer and add the custom library named Adobe LiveCycle Workflow Fields.



[...]

AWS_ASSIGNED_ID Text, field (invisible),

A hidden text field that stores the name of the participant that

submits the form.




Hope, this helps.



Regards,

Steve

Avatar

Former Community Member
Hello -



Actually, it does not store the Name of the participant, that is a typo in the docs. It actually stores the ID of the participant. If you need to correlate this to some other id in your database you will likely have to use the JDBC QPac to get the username or canonical name for the user.



Hope that helps - if you need more info let me know.



Will@Adobe

Avatar

Former Community Member
Hi



Thanks for your suggestions. I do need more helps on this :P



For your information, I have already had a workflow enabled form that contains AWS_ASSIGNED_ID field that Steve mentioned. And my database is MSSQL.



So.. go back to my question:




to look up "Staff Name" and "Staff ID" in database accordingly, I need the initiator's id(maybe the login id to form manager?), but how to get it?



From my understanding on Will's reply.. if i'd to get the login ID from AWS_ASSIGNED_ID, I need to use JDBC QPAC. Is this correct? But how to implement this?



Any online reference on this topic?



Many thanks...



Leia

Avatar

Former Community Member
Hi,



Something to clarify..



Is AWS_ASSIGNED_ID a unique and constant value as like user login ID?



If that is the case, I think I know how to do...



I just need to get all workflow users's AWS_ASSIGNED_IDs, staff IDs, staff Names stored in my database and then use JDBC QPAC to look up their staff ID & Name from their AWS_ASSIGNED_IDs. Am I right?



Thanks...



Leia

Avatar

Level 9
Hi Leia



The AWS_Asssigned_id is a unique string, that is a constant value within a particular workflow server. (In other words, if you have a test and a production server, both synchronized to the same LDAP server, they will both contain a record for llandy, but the assigned_id will be different for the two systems.)



There is no need to make a copy of all the user-ids and copy into your own database - you can just query directly against the Workflow database itself. However, the tables are a little convoluted, so...



The easiest way to find out any information you want about a user (except their password) is to use our LookupUser QPAC.

See: http://www.avoka.com/avoka/qpac_library.shtml



Howard

Avatar

Former Community Member
Hello -<br /><br />Yes the Avoka QPacs will probably be the simplest solution. <br /><br />To answer your question, the value of the AWS_ASSIGNED_ID field equates to the ID in the EDCPRINCIPALENTITY Table. Howard is correct, this is a generated ID and will be a different value for the same user in your development and production systems. The correlating column is the "CanonicalName" column - this should be the value that is retrieved from your LDAP system, and should be the same across different workflow installations. You can query something like this:<br /><br />SELECT canonicalname<br />FROM EDCPRINCIPALENTITY <br />where id='<insert value from AWS_ASSIGNED_ID>'<br /><br />I am not sure where the JDBC (or also named the SQL QPac) can be found. It is either found with the base QPacs or is a part of the Workflow SDK. <br /><br />Will@Adobe

Avatar

Level 9
Hi

The JDBC QPAC is part of the Workflow SDK, in the \QPACS\Standard directory.



For Will's query, you'll need to configure it to point to the Adobe datasource ie java:/IDP_DS in the deployment properties.



Just to make things extra confusing, you can actually have the same canonical name appearing more than once in the EDCPRINCIPALENTITY table, if each belongs to different LDAP domains. This is pretty rare though. The id will always be unique.



Howard