Mattersphere Developers Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Admin
Admin
Posts : 122
Join date : 2018-12-17
https://mattersphere-devs.forumotion.com

Cloning Milestone Tasks Empty Cloning Milestone Tasks

Thu 23 Jan 2020 - 14:45
Hi,
Is there a way to “clone” an existing milestone task, including its actions? We have a task that can be being completed many times concurrently and it would be nice to only code the one tasks with all of the actions, and just Instantiate another one each time.

At present we code the same task and actions many times.

Thanks, Romie
__________________________________________________________________________________________________________________________________
Hi
You can clone the Milestone Plan but not any individual milestone task.
Regards Danny
__________________________________________________________________________________________________________________________________
For clarity, I think Danny is referring to the MS Plan not Taskflow...
Can you or do you know of the new designer we have done for Taskflow in Valencia? The product runtime works exactly the same but we have done some work to help and assist the developer experience? I know I have given access to Jonathan and Peter for the Valencia Beta/RC but not sure if you have access to this. You could install the client on a test machine and try and review this as may assist you, additionally you can execute common methods to ease and reduce duplication of common code.
__________________________________________________________________________________________________________________________________
Perhaps you could add a new task with the same description and complete it straight away leaving the original task uncompleted. You could even give the existing task a new due by date to keep it current. To the user they would see this as completing a task and it re-appearing again. You may need to think of a way to get out of the endless loop!
__________________________________________________________________________________________________________________________________
Hi There, If its a re-occurring task, why not create a new method which adds the tasks you keep needing to reuse. Create a matter action to link to this therefore these tasks will always be populated without the need to re-run a task, or do you specifically want to run this through an existing task?
Thanks
__________________________________________________________________________________________________________________________________
Thank you everyone for your ideas.Mike - I don't have access to the Valencia, but I am really keen to test it. Could you please arrange my account to have access?The "complete the dummy test and re-use the existing one" is a great idea and I will definitely use it.The big picture we are trying to achieve is to map out a process of 3 or so tasks, and then enable users to use the process multiple times, concurrently.For example the process of “Requesting a medical report” may have tasks:1. Request Report 2. Chase the hospital for the medical report 3. Review the medical report. Users have to request many medical reports at all different stages of the matter. So they can keep track of this, it would be nice if we could just program the 3 tasks once, then the user can instantiate the 'process' as many times and whenever the user requires.
__________________________________________________________________________________________________________________________________
Change my int to byte on the _stage variable and this should compile Smile
__________________________________________________________________________________________________________________________________
Thanks Peter,
That's a great solution to get around the fact that created tasks don't have actions, which has been my issue.I'm looking forward to giving it a go!
__________________________________________________________________________________________________________________________________
Hi Peter,
I'm trying to follow your suggestions and create a workflow with general tasks, however the CanCompleteTaskUI event isn't firing when I click the complete button on a general task.
When should the CanCompleteTaskUI fire?
__________________________________________________________________________________________________________________________________
Hi,All
of the script examples relate to Taskflow actions which fire events - ie CanCompleteTaskUIGeneral tasks won't fire a Taskflow event. Any Tasks you create that require scripting must be in Taskflow. The examples I gave inserted Tasks into the workflow that did not have associated actions. If you have created a Taskflow Task where are you trying to complete it: in the Milestone Plan, on the Matter Task Tab or in the Command Centre Task list?

Peter
__________________________________________________________________________________________________________________________________
HI Peter,
Thanks for the clarification. The workflow we are currently creating is a fully-triggered workflow (only 1 milestone task is created when the matter is created - all other tasks are triggered as the matter progresses). We have disabled the 'complete' option for milestone tasks in the Matters Tasks Search list. This is so users are forced to use a coded action to trigger the next task(s).If we used your example and coded milestone 3 milestone tasks (and enabled the complete option), am I right in thinking you couldn't run multiple 'copies' of the three tasks at once?
For the medical reports example, if the first task is “request medical reports” we need users to be able to trigger this task multiple times simultaneously. This is because users can lodge multiple applications simultaneously, and each of the applications may required different sets of medical reports. Each application can not continue until its set of medical reports in is, so they need to keep track of these requests separately.I know you can create the same general task multiple times. Does completing a general task trigger ANY event? If we could tap into that event we could put your code example behind that!
__________________________________________________________________________________________________________________________________
Hi Romie
I hope this is clear enough, it may have been easier for me to write the script

Task: Request Medical Reports Action:
Select Associate Script:
Display Medical Associate Picker*
Select Associate
Create Letter to associate
Create Task to receive reports
*Update associate data set ReportRequested to true***
Action: Complete Task – all medical reports received Script:
Mark all receive medical report tasks complete plus complete the request task.
*The medical associate picker would be an unbound form and display a single combo list box displaying all associates
on the matter of type x, y or z where x y or z are associate type codes applicable to medical reports e.g.
GP, CONSULTANT, HOSPITAL etc.

These associate types would have an extended data bit field ‘ReportRequested’ and the list would only display those which are not 1. A further enhancement would be to include a list of medical report types to choose from as well.
**The task created would have a description ‘Receive medical report from name of associate and have a filterid = tsk_receivemed_associd
***The associate name, id and extended data would all be available when the unbound form returns a value to a table and you simply interrogate row 0 column 0 (let me know if you haven’t worked with unbound forms before)OK, so now we have a task to receive a medical report(s) from an associate. Obviously we cannot pre-create actions for this task so we must allow the user to manually check the task as complete.This is where CanCompleteTaskUI comes in...The event is fired whenever a user attempts to manually check a task and passes through the task object. That task object has a rather unique filterID.First create an if statement to see if the filterID contains “tsk_receivemed’

If it doesn’t then return Else Get the substring of the filterID containing everything beyond tsk_receivemed and convert it to a bigint
You now have the associate ID of related to the medical reports you are expecting You could then pop a Yes/No message box asking if they are received. Click yes and you can complete the task with the filterID and set another piece of associate extended data ‘ReportReceivedDate’ to DateTime.Today. Click no and you could offer them another choice:Do you wish to chase the report?If Yes display a dialog with the contact details (pass a key value collection through to an unbound form).

The form could contain a button to launch a precedent. Cancel will do nothing, OK could reschedule the task for tomorrow. I probably wouldn’t bother with attempting to add more chase tasks, the hassle of handling them and updating a filter to include ‘chase1, chase2 etc may not be worth the effort.If you want to use this handling method for other “receive” tasks create a switch statement in the CanCompleteTaskUI and add a bit more info to the filterID. Use case statements examine the fileter ID and handle the different workflows e.g. tsk_recMedRep; tsk_recFormTR1; tsk_recAuthI suppose the biggest drawback with this technique is that the users may be used to seeing an action on a task and become confused because they need to attempt to check it to complete or chase. A training issue maybe?Slightly more slicker but a bit trickier would be to create a single stage action: Receive Medical Reports. You could pop a dialog listing the tasks in the stage with a filter of tsk_receivemed and ask them to select which one to receive. This has the problem of displaying an action that is
available before the medical reports have been requested!Let me know how you get on. Like I said there is more than one way of skinning this cat!

Peter
__________________________________________________________________________________________________________________________________
Hi Peter,
Thank you so much for your assistance on this issue. We have this set up and working which is great!Just one more issue (for now :)1. CanCompleteTaskUI only triggers when we tick the box on the Workflow tab. We will be only using the matter task tab (and command centre task tab) to run our workflows. Can you think of any event that we can file when users complete a task on this tab?
__________________________________________________________________________________________________________________________________
Hi Again.
Why not create a new method which creates the three tasks you require. Then create a global action so visible to all users no matter where they are in the Taskflow. This global action will call the method and enter the three tasks for them which they will able to do at any point in the Taskflow. Thanks
__________________________________________________________________________________________________________________________________
Try using the CanCompleteTask event, this should fire whenever someone selects the Complete option in the task views.If this works move your script into a common method and call if from both events passing through the calling task. Let me know if that works.
Peter
__________________________________________________________________________________________________________________________________
i would check you are using the taskflow aware command centre tasks.
__________________________________________________________________________________________________________________________________
Hi,
Thanks but that event doesn't fire from the tasks tab either. Mike - how do we check we are using the taskflow aware command centre tasks?
Romie
__________________________________________________________________________________________________________________________________
Are there any actions in the Task Pane on the Left Hand side that allow you to action tasks, if there is then you are using the correct Task system.

I will try and confirm the correct object name but there are two search lists one is Addin based and supports extending the Task Action Control on the Left hand side and one doesn't.
Hi Mike,
Responding to your post above,we can see the action pane in the tasks search list so I assume we are using the correct one. The problem goes back to the fact that for a task to have actions, it has to be pre-coded and if we want to have 20 copies of that same task that users could have active simultaneously then we need to code that task and its actions 20 times.
We are currently getting around this using general tasks and have placed the code to create the next task behind a custom button on the task search list. This is working, but it just means that the code for all file management applications workflows needs to be on the one search list.Regards,
Romie
__________________________________________________________________________________________________________________________________
Hi Romie
I have another idea that may cut down the code and will work for a single or infinite medical requests plus it uses conventional Task actions available in the Task views.First create some extended data against an associate holding two pieces of data: Date Report Requested and Date Report Received. Register the extended data against all associate types that could create a medical report e.g. Claimant Medical Expert, Claimant Medical Consultant, Claimant GP etc.
Next create two datalists; DSMEDREPREQ listing all medical associates on a file that have not yet received a request to provide medical reports; DSMEDREPREC listing those that have had a request but not been received.Example DSMEDREPREQ SQL:
Code:

select
    a.assocID
    , c.contName + ' ' + dbo.GetCodeLookupDesc('SUBASSOC',a.assocType,'') as [Associate]
from
    config.dbAssociates a
        join
    config.dbContact c
        on a.contID = c.contID
        left outer join
    UDMEDASSOCDATA u
        on a.assocID = u.assocID
where
    a.assocType = 'MEDEXP' or a.assocType = 'CONSULTANT' or a.assocType = 'HOSPITAL'
    and a.assocActive = 1 and u.medRepReqDate = null and a.fileID = @fileIDNext
Create a static task “Request medical report”The task will have two actions: Request report All reports requested, mark task completeThe first action will launch an unbound wizard displaying a list box with DSMEDREPREQ as its source and a Request button. The user selects an associate and clicks receive.The task action gets the associate ID from the key value collection and you can process the medical request precedent and write the extended data. I would also add a dynamic task “Medical report requested from name” with a filter ID “tsk_reqmed_associd” and immediately mark it as complete. Also, if it does not exist, another task "Receive Medical Reports" This second task has two actions: Receive Report All reports received, mark task complete The first action will launch an unbound wizard displaying a list box with DSMEDREPREC as its source and a Receive button.

The user selects an associate and clicks Receive. Once again use the key value collection to get the associate ID, create and complete a dynamic task "Medical Report received from name" and write to the extended data.If required you can create a search list control and put it on any of your screens to show the associate extended data in a list form rather than creating a new tab for the associate type. Note: Using extended data means that each medical associate can only produce one medical report which may not be sufficient. If that’s the case create the medical request/receive data capture as a search list (one to many) and adjust the datalists and unbound forms to handle multiple requests to the same associate.

Peter
__________________________________________________________________________________________________________________________________
Thanks to everyone's help. Using a combination of all of the above we have this up and running and looks great.
Back to top
Permissions in this forum:
You cannot reply to topics in this forum