Home > Forum > Database > SQL Update on WFElements table

SQL Update on WFElements table
0

Hi!

I have a process which generates subprocess (list is from sql query). The subprocesses generates correctly but there is one thing that I need to change - the author of the subprocess document should be change for the employee from field.
I tried to change the login by update the WFD_CreatedBy column in WFElements table but it's not possible.
I've received an error:
"One or more errors occurred.
Operacja została wycofana
Concurrency Error Concurrency Error"

In attachement you can see the sql query.

Maybe you have some ideas how to update that field or maybe run the subprocess with the diferent login as author?

Thank you for your help!

In reply to: Markus Jenni

There is no need to write an sql statement.
Simply check "Overwrite instance author" and set the value from the form field and workflows are started with this users as author :)

Thank you for your answers!

I have another question..

I have an dictionary in which I defined a list of users for whom I want to start each subprocess and for each subprocess author should be a login (field from dictionary).
I tried to present it on my main process (as item list) but I don't know how to set it with that field which you proposed (overwrite instance author).

Or maybe should I do it totaly different?

Any ideas?

Thanks a lot in advance!

MVP
In reply to: Stanisław Projs

Thank you for your answers!

I have another question..

I have an dictionary in which I defined a list of users for whom I want to start each subprocess and for each subprocess author should be a login (field from dictionary).
I tried to present it on my main process (as item list) but I don't know how to set it with that field which you proposed (overwrite instance author).

Or maybe should I do it totaly different?

Any ideas?

Thanks a lot in advance!

Hi,

depending on the number of times you are creating these workflows it could be an option to trigger a path transition of the dictionary workflows which in turn would start a single workflow using the non all action. Then you would be able to set the author.

Am alternative could be to user the REST API. You could create an App which is allowed to impersonate users. Then you could call this to generate single workflows. I think the first option would be easier. :)

You could also test whether it has an effect if you use a column with the name WFD_CREATEDBY of the query which defines the workflows to start. Maybe it's treated like the field/attribute columns. :)

Best regards,
Daniel

In reply to: Markus Jenni

At the moment i can't see the purpose/benefits of your approach for having different authors for each subworkflow.
Assigning the first step to different users for e.g. is easier to achieve by setting a people field on workflow start and use the dynamic task assignment.

Maybe you better explain what you would like to achieve.

Each month I will run subworkflow for each employee which is in my dictonary.
In report for employee I need to present only processes which is connected with that user.
Thats why I'm trying to change the author of each subworkflow to the employees from my dictionary list.
Or maybe you know some trick how could I solve it with 'person or group' field and the dynamic value sentance that I need to use?
Please look at tha attachment.

Thanks for your advice!

MVP
In reply to: Stanisław Projs

Each month I will run subworkflow for each employee which is in my dictonary.
In report for employee I need to present only processes which is connected with that user.
Thats why I'm trying to change the author of each subworkflow to the employees from my dictionary list.
Or maybe you know some trick how could I solve it with 'person or group' field and the dynamic value sentance that I need to use?
Please look at tha attachment.

Thanks for your advice!

Last year the "Me"-filter for person/group fields have been introduced on reports.

I would suggest, that you use a person/group field and start the workflows by setting this field with the user in your dictionary rather than trying to change the author.

As long as there are no global read permissions defined on either process or workflow level, the users would not have access to the created workflows.
To make workflow instance visible for the user you could use an "add privileges" action on the path or step exit to grant the appropriate permissions.

In fact, when you have no global permissions and only grant permission on element level, you don't even need the "Me"-filter, because the users would only see the elements with read permissions.

In reply to: Sebastian Gębuś

Hi,
In reports, you can use ##currentloginname## if I'm not mistaken, to get the current user login. It works for sure in SQL filter, and it should in standard filters too, but I cannot verify that right now

Hello,

Thanks Sebastian for your idea - that help me to solve my problem and works perfect at report!
I have some troubles with configuration of that SQL filter that you recomend me but that thread https://community.webcon.com/forum/thread/459?messageid=459 helped me a lot.
I want to thanks all of you guys - of course you have totaly right that changing anything directly in database is not a good idea (but I don't see any other solution at that moment..).

Kind regards,
Stanisław