Changing task owner in a GXFlow business process diagram - business-process-management

I'm working with GeneXus and I'm developing a business process diagram for GXFlow.
I need that the user can select the owner of the next task.
I can retrieve the list of the users of the specific role with this code:
&WorkflowServer.Connect('WFADMINISTRATOR','WFADMINISTRATOR')
&WorkflowOrganizationalModel = &WorkflowServer.GetOrganizationalModel()
&WorkflowFilter.Role = &WorkflowOrganizationalModel.GetRoleByName('RoleName')
&WorkflowUsers = &WorkflowOrganizationalModel.ListUsers(&WorkflowFilter)
//Adding users to a combobox
For &WorkflowUser in &WorkflowUsers
&users.AddItem( &WorkflowUser.Id.ToString(),&WorkflowUser.Name)
EndFor
In this case a user can select the owner of the next task from a combobox. How I can set the selected user as owner of the next task?

I found the best solution for my question. I hope it can be useful also for you:
You can save the selected user in a relevant data variable.
In the target task properties you can change the property "Assign from a user in a relevant data" and assign the previous created variable to it.
This works good for me.

You can use the "Is Ad-Hoc" property for a task and GXflow will do this automatically for you. Please see this documentation for more details about this option https://wiki.genexus.com/commwiki/servlet/wiki?11875,Is+Ad-Hoc+Property

Related

Send Mautic Form to different Recipients based on Formfield

I've a Mautic form with Radiobuttons where the User can select which Department he want to connect with.
o General Question (1)
o Sales (2)
o Technical Support (3)
I want to send the Request to the Person in Charge. So for example:
1: info#company.org
2: sales#company.org
3: support#company.org
I've tried different approaches, but non worked.
The most dirty one was to set the values of the radio buttons as E-Mails and send the Form to the Contact. Worked in some way, but then off course saves the Radiobutton Input to the Database as customer E-Mail. So, only smart in the first place. ;)
I've also tried campaigns, but couldn't find a nice way to use Formfields in the Campaign Templates.
I cannot accept that this couldn't be possible in a easy way. This Form gonna replace a Powermail Form in TYPO3 and there it kind of works like a charm.
Any hint is very much appreciated.
Sorry that you found the documentation bad - we are actually in the process of improving and migrating our developer docs, so please take a look at the WIP docs here: https://mautic-developer.readthedocs.io/en/latest/plugins/getting_started.html which are much improved!
(will also post this on the forum thread!)
After weeks and weeks of research and workarounds I got at the Mautic Form, here is my solution to this Challenge.
I really love Mautic and its extensiveness. It’s just a great and powerful tool.
But at this point it totally misses the market. For me it just feels so wrong and like a big error by design, when you have to create fake fields to handle formfields for such a simple task.
Not talking about the problem when the user overwrite his records before the data being send.
As mentioned this is so easy to do in TYPO3 with Powermail and so I was thinking about creating a plugin, but the documentation on this is really bad.
So here is my solution, as I was looking for simple solution for me as well as the customer.
Solution is tested and worked like a charm for me. Here’s what you can do, for everyone also looking something like this:
Create 1 custom field and label it “Owner (form)” - set Type to Text
Create 2 MySQL Trigger as follows (just copy the code 1:1, should work out of the box):
DELIMITER ;;
CREATE TRIGGER set_lead_owner_from_radiobutton_on_insert BEFORE INSERT ON leads FOR EACH ROW
IF (NEW.owner_form != NULL) THEN
IF (SELECT count(id) FROM users WHERE users.id=NEW.owner_form) > 0 THEN
SET NEW.owner_id = NEW.owner_form;
ELSE
SET NEW.owner_id = NULL;
END IF;
END IF;;
DELIMITER ;
DELIMITER ;;
CREATE TRIGGER set_lead_owner_from_radiobutton_on_update BEFORE UPDATE ON leads FOR EACH ROW
IF (NEW.owner_form != NULL) THEN
IF (SELECT count(id) FROM users WHERE users.id=NEW.owner_form) > 0 THEN
SET NEW.owner_id = NEW.owner_form;
ELSE
SET NEW.owner_id = NULL;
END IF;
END IF;;
DELIMITER ;
Create a form with a Radiobutton or Selectbox and set the “Contact Field” to our custom field “Owner (Form)”
Note: Values of the Radiobuttons / Selectboxes need to be set to the User IDs of your Mautic Instance. So you have to create an user for every Select- oder Radiobutton-Option.
Select for example “Send form results” in Actions and set “Send to owner” to yes.
That’s it.
So what does it do. It’s basically all about the MySQL Triggers. Every time a new Lead is created or updated and our custom field “Owner (form)” is not null and has a valid entry (User ID), the trigger copies the value from our field to the original Owner Field of the lead. So we can then use Owner of the Lead (in my case a Department) to send him a E-Mail.
I hope this is helpfull to someone. But even more I hope that Mautic is gonna fix this in the future, as I believe this a very essential task when it come to enterprise Websites.
Cheers,
Lufi
Mautic Forum Discussion: https://forum.mautic.org/t/send-mautic-form-to-different-recipients-based-on-formfield/24363/13

Populate list based on selection from separate list

There are a few topics that I have found while searching for an answer to this, but nothing that specifically helps my situation. Here's what I need to do and some background.
Web application has a field called "Requested by" that automatically inputs the logged in users name from Active Directory. This cannot be edited.
User selects a store location from the first list, this location is where the requested user will be setup for.
Second list needs to then populate with a list of potential approvers by first seeing which store was selected, then grabbing a list of names from an Active Directory group called "Store Managers"
Example
Bob Jones is requesting a new logon for Sally Smith who will work at Store 1.
Bob selects "Store 1" from the first dropdown list
List 2 populates a list of approvers who are in "Store 1" group AND "Store Managers" group.
Can someone please tell me where to start on this! Any help is very much appreciated!!
Within the function that is called whenever the first drop-down menu changed, ie. a new value has been selected (such as selecting a store), you can have a simple if-else structure that, depending on the newly selected drop-down menu item, checks for any valid values within your Active Directory.
That is as specific as I can be, seeing as you haven't posted any code along with your question.

TFS: How to add more 'CheckIn' actions

Out-of-the-box TFS provides ability to either "Associate" or "Resolve" bug/task during check-in action.
I've added additional state "Implemented", created transition from "Active" to "Implemented", added into its "Action" value "Microsoft.VSTS.Actions.Checkin" and expect to have "Implemented" option in the list of "Check-in Action" on the "Pending changed => Work Items" panel.
I've saved updated work item type, imported it into TFS, 'refresged' team explorer... but in "Check-in Action" list there are still only "Associate" and "Resolve".
Please advise: how to add additional options into that list and implement switch of work item state.
Any thoughts are welcome. Thanks!
The checkin actions aren't item workflow states, but are used to trigger the transition of a work item from one state to another.
As a starting point, have a look at the MSDN Documentation to get a better idea of what's required.
You might also want to look at this older thread on the support forums.
The only thing I've found is that the only "resolve" action is allowed for Check-in operation. And it is only available if from "current" state you have defined "Microsoft.VSTS.Actions.Checkin" action. Some time it work's, sometime now. If you are adding few actions from one state (with different name) - they both works,... but not exactly as I want... don't know why...

SharePoint - checking Content Approval change status in event receiver

I have a SharePoint list with Content Approval enabled. The business requirement is that once the new list item is approved it should stay approved despite further updates by any user.
My first thought was to handle the ItemUpdating method, and if the corresponding before property is Approved then set the after property to Approved. This doesn't work however.
In the ItemUpdating method the "Approval Status" column does not show up in properties.BeforeProperties or properties.AfterProperties. properties.ListItem["Approval Status"] and properties.ListItem.ModerationInformation.Status both show the "before" value. In the ItemUpdated method the situation is the same, except instead the values shown are the "after" values.
Is there a way in either method to identify both the before and after methods? I can work around this by creating a new hidden column that I set when the item is approved but that doesn't seem best.
Should I be approaching this from a workflow perspective?
Would this help?
http://www.synergyonline.com/blog/blog-moss/Lists/Posts/Post.aspx?ID=25
Use field's internal name with AfterProperties or BeforeProperties.
i.e. properties.AfterProperties["internal name"].
It works for me
Please refer to the following properties in the AfterProperties section for a document library.
Document libraries are a bit different than lists. the doc libraries have .AfterProperties["vti_doclibmodstat"] and .AfterProperties["vti_doclibmodcomm"].

Saving data in rails session to use in form on next request

Let's say I have a table called positions (as in job positions). On the position show page I display all the detail about the job - awesome. At the bottom I need the prospective applicant to input their professional license # before continuing onto the next page which is the actual applicant creation form. I also need to take that license # and have it populate that field on the applicant form (again on the proceeding page).
I realize there are a couple ways to do this. Possibly the more popular option would be to store that value in the session. I am curious how to do this in the simplest manner?
My idea:
Create a table specifically for license #'s.
Add a small form on the position show page to create license # (with validation)
Store newly created license in session - not sure what to put in which controller?
On applicant creation form populate from session the license #.
This would assume applicants only have one license.
Thoughts?
Appreciate the help!
Don't store this in the session! Pass that as an hidden field.
Let's say the user starts the form, then open the form again in a new window or something... then the session variable would be shared between the two forms. Other problems would occur if the cookie gets removed (session expire, user clear cache...)
This is not good. The best way is using a POST variable. GET works as well but messes up the URL
Seems like a good idea. As for #3, for whatever controller is called in the transition from 2 -> 4, that would be the controller where you store the session, as such:
session[:license_number] = your_license_number_information
From there, it can be called the same way (session[:license_number]) to get it.
The hidden field is safer for data persistence. However is not not then coded in the HTML output? That can be a great data security issue.
This is a trade-off to be considered.

Resources