sjeandroz
sjeandroz

Reputation: 43

Alfresco Workflow update programmatically a task

I try to edit a task programmatically

My problem is to know for a specific task, which fields are allowed to be modified or not

For exemple, I have a task like this

[properties] => Array
(
[bpm_percentComplete] => 0
[bpm_description] => ma description
[bpm_hiddenTransitions] => Array
(
)

[bpm_package] => workspace://SpacesStore/33ae7716-1697-413e-bd0c-033efcd13f16
[bpm_dueDate] =>
[bpm_context] => workspace://SpacesStore/fb976941-d7bb-44a8-8c03-263c353fff4c
[bpm_priority] => 2
[bpm_taskId] => 13798
[bpm_reassignable] => 1
[bpm_startDate] => 2014-10-06T09:04:48.000+02:00
[bpm_completedItems] =>
[bpm_pooledActors] => Array
(
)

[bpm_status] => Not Yet Started
[bpm_comment] =>
[wf_reviewOutcome] => Reject
[bpm_completionDate] =>
[bpm_packageActionGroup] =>
[bpm_outcomePropertyName] => wf:reviewOutcome
[cm_content] =>
[bpm_packageItemActionGroup] => edit_package_item_actions
[cm_created] => 2014-10-06T09:04:48.000+02:00
[bpm_outcome] =>
[cm_name] => wf:activitiReviewTask
[cm_owner] => sjeandroz
)

I would like to know (programmatically) which fields are "Technicaly fields" (for exemple cm_name or bpm_taskId), which one are editable fields (for exemple bpm_status or bpm_comment) and which one cannot be modified (like bpm_description)

Thanks in advanced and sorry for my bad english

Sylvain

Upvotes: 1

Views: 614

Answers (1)

Greg Harley
Greg Harley

Reputation: 3240

It sounds like you need to get a list of the form properties defined for the task. The easiest way to do this is to use the formService to retrieve the form data for the task.

ActivitiUtil.getFormService().getTaskFormData(taskId);

This will return the form key, the deployment id and the form properties defined for the task.

Upvotes: 1

Related Questions