ATM, the new submodule Workflow Field only allows fields on nodes. Other Entities should be supported, as well.

Comments

pedrorocha’s picture

Do you think that this is going to be a total rewrite in a 2.x branch or a upgrade on 1.x branch itself? Any ideas on how to implement this? I'm not familiar with the Workflow code yet.

johnv’s picture

I will take care of this. It will be in the next 1.x version.

pedrorocha’s picture

Allright! Custom workflows for tasks is a feature that many project management products offer, so will be great to have it inside the Case Tracker module too.

johnv’s picture

I am working on it. I'll be updating this comment with current status.

Probalby the following features won't be included - I need someones help:
- The date_time is not collapsed, when you change the radio buttons. (WorkflowDefaultWidget.php)
- Workflow_cron() will not work, since WorkflowSheduledTransition is not aware of entity_types or entity_bundle. This will be fixed soon after the first commit.
- Workflow history tab is not shown, since don't know how to know the menu in advance (workflow_menu() in workflow.module.)
- Also, workflow_history table is not entity aware.
- workflow_node is not entity aware, but you won't be using that table.

johnv’s picture

Title: Workflow Field must support all Entities » Add Entity support for Workflow Field
Status: Active » Needs work

A patch is committed here.
a.o.:
- several 'node'-specific lines of code have been altered to support entity functions and Entity API. (There is no dependency on Entity API)
- the code from several 'workflow_operation_workflow_scheduled_transition_*()' functions has been moved to WorkflowScheduledTransition. The old functions remain as shell functions to not break the current API.
- the code from workflow_execute_transition() has been moved to WorkflowTransition->execute().

See #4 for limitations of the current version (when used on non-Nodes)

johnv’s picture

@pedrorocha,
I've fixed ScheduledTransitions is a separate issue.
The Workflow Field submodule should now be working, with the following exceptions:
- On non-Nodes, the date_time is not collapsed, when you change the radio buttons. (WorkflowDefaultWidget.php)
- Workflow history tab is not shown, since I don't know how to know the menu in advance (workflow_menu() in workflow.module.)
- Also, workflow_history table is not entity aware.
- workflow_node is not entity aware, but you won't be using that table.

pedrorocha’s picture

Great news!
I created a new tag for Case Tracker 2.x yesterday(https://drupal.org/node/2112745, alpha2, but it's quite stable - i'm using as our project management tool, inside a Acquia Commons installation -, i'm just unsure about some architectural decisions, so i'm waiting for feedback to move foward) and will work now to see how the Workflow Field works together.

johnv’s picture

Great! Hope to hear from you!

johnv’s picture

@Pedro, although Workflow Field works on non-Node entities, the following is still an issue:
- I was not able to port tokens; I need help here.
- I was not able to test features import/export.

johnv’s picture

The Workflow history Tab now works for every entity type, but the hook_menu only works for user, node, taxonomy_term. Need some help on that to make it generic.
See this commit.

johnv’s picture

Issue summary: View changes
Status: Needs work » Fixed

This is completed by now. Some submodules may not work for all entity types.

@pedrorocha, I hope to hear about your progress!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.