- Issue created by @alastairworters
- π©πͺGermany jurgenhaas Gottmadingen
Loading a taxonomy term entity works with the Entity: load action with the following settings:
- Load entity from: Type and properties
- Entity type: Taxonomy term
- Property values:
name: "Not Required" vid: "work_status"
However, I wonder if this requirement is best suited with taxonomy terms. Have you thought about using workflow or state machine instead?
- π¬π§United Kingdom alastairworters
Thank you, for both the ECA solution and also the suggestion for the alternative way of solving the concept⦠with Workflow or State Machine.
Sometimes I should take a step back from the problem and look at the bigger picture, rather than heading down a one way path!!
Thanks again π
- π¬π§United Kingdom alastairworters
Hello again,
I have changed the process to work with the workflow module, but again am struggling to get an ECA model to change a field value from one state to another..
Are there any instructions, or even video tutorials, on how to move from one workflow state to another using ECA?
Thank you and apologies for not being able to figure this out on my own.
- π©πͺGermany jurgenhaas Gottmadingen
To change the workflow state of an entity, you can use the Entity workflow Editorial: transition action.
To change other field values, there is the Entity: set field value action.
- π¬π§United Kingdom alastairworters
Thank you again Jurgen.. Very helpful and I now have the model working!
One last question on this, if that's ok.. and not really specifically on ECA. But maybe you would be kind enough to tell me what would be the token to use, for displaying a message to the user after the transition has happened, saying "The Workflow Status has been updated to: [work_status - New Status]" ?
Thank you...
- π©πͺGermany jurgenhaas Gottmadingen
The workflow module perhaps doesn't provide a token for that. But since you know to which state you've just transitioned, you may be able to use a static text for the message too? Otherwise, if you want to make your model more generic, you could use the
Token: Set value
action to define the new state label like a variable and then use that token in the message. - π¬π§United Kingdom alastairworters
So.. following your help and some further reading, I decided to use workflows (within core) with ECA to automatically update the workflow status, as certain milestones were met. However, I've now run into another issue, which looks like I will need to change my approach again, and I am hoping you could possibly let me know your thoughts on the best way forward using ECA to 'automatically' update the state of a workflow...
As per my initial comment (#1), I am looking to build a way to follow the progress of a specific job allocated to a contractor, changing the 'status' of the job as certain milestones are met throughout the task. And with your guidance, I have been able to get the 'status' automatically updated using ECA, along with ECA Workflow module, working with the Drupal Workflows (core) module..
Unfortunately, although this solution has been testing well today issuing a single job to a contractor, I cannot find a way of introducing multiple jobs being issued to various contractors within the same project, and can only get it to control the workflow of a single 'job' within a main 'project' content type.
e.g. A new Project (a content type) is created by a user that, based on the answers given, automatically sends emails to various contractors, instructing each of them to carry out a specific job, all as part of the main project. Then the plan is to allow each of the contractor's progress to be tracked through the various workflow states, from the initial 'Instruction' through to their specific job within the project being automatically marked as 'Completed' when the last milestone has been reached.
Now, after introducing more than one job with the project, I see that only one workflow (made within the workflows core module) can be applied to a content type... meaning that I can only control the status of one 'job', with in the 'project' content type...
Anyway, after a bit of reading this evening, it appears that the Workflow (contrib) module allows multiple workflows to be applied to a content type.
Hopefully that all makes sense....??
So my question is this - Please can you let me know how ECA interacts with the Workflow (contrib) module.. ie. is there a elegant task/action I can use within an ECA model that allows me to change the state of a Workflow (contrib) based workflow, just like the ENTITY WORKFLOW WORK STATUS: TRANSITION one that works with the Workflow (core) workflows..?
As always, I have exhausted my caffeine allowance and my skill levels are letting me down..
Thank you...
- π©πͺGermany jurgenhaas Gottmadingen
This doesn't sound like an ECA question, it's more about data modelling in the first place.
First, if you have a choice between the contrib "workflow" module and the core "workflows" module, I'd always go for the latter one. For a lot of reasons, but that discussion is out of scope for this issue.
Reading through your requirements in comment #8, it sounds like you could work with 2 content types:
project
andtask
. Each project has a list of references to 1 or more tasks. And each task has a workflow state, which goes through all the stages you described.Then, when all tasks of a project reached the completed state, then the project can be flagged as completed as well.
- π¬π§United Kingdom alastairworters
Thank you Jurgen,
I appreciate you taking the time to let me know your thoughts on working with Workflows and various ways they interact with ECA, and also your suggestions on how to find a solution for my particular data modelling / workflows issues..
Very helpful indeed.
- π©πͺGermany jurgenhaas Gottmadingen
@alastairworters what's the status of this, is your issue resolved or do you have any follow-up questions for ECA here?
- Status changed to Postponed: needs info
over 1 year ago 7:24am 13 July 2023 - Status changed to Closed: outdated
over 1 year ago 1:47pm 3 August 2023