To make this work;
– Make sure there is a workflow available.
+ check : http://localhost:8080/alfresco/faces/jsp/admin/workflow-console.jsp
+ Enter show definitions all
+ fill in the name in the first line.
– It needs also an active workflow to get stuff like InstanceID.
var naam_wf = “wf:ADHOC”; // name of the processdefinition of the workflow
var workflowType = “jbpm$” + naam_wf;
var wf_all_definition = workflow.getAllDefinitions();
logger.log(“REPORT – ALL_DEFINITIONS =”+ wf_all_definition);
var wf_definition = workflow.getDefinitionByName(workflowType);
logger.log(“REPORT – DEFINITION =”+ wf_definition);
var wf_description = wf_definition.getDescription();
logger.log(“REPORT – DESCRIPTION =”+ wf_description);
var wf_definition_id = wf_definition.getId();
logger.log(“REPORT – (ADHOC) ID =”+ wf_definition_id);
var wf_instances = wf_definition.getActiveInstances();
logger.log(“REPORT – INSTANCE =”+ wf_instances);
var wf_instance_id = wf_instances.getId();
logger.log(“REPORT – INSTANCE_ID =”+ wf_instance_id);
var wf_instance_paths = wf_instances.getPaths();
logger.log(“REPORT – PATHS =”+ wf_instance_paths);
var wf_tasks = wf_instance_paths.getTasks();
logger.log(“REPORT – TASKS =”+ wf_tasks);
var wf_tasks_length = wf_tasks.length;
logger.log(“REPORT – NUMBER OF TASKS = “+ wf_tasks_length);
var wf_task_name = wf_tasks.getDescription();
logger.log(“REPORT – TASK – DESCRIPTION =”+ wf_task_name);
Since I always forget ;
I update this one : …./config/extension/model/customModel.xml
The …./config/extension/custom-model-context.xml is still the same (contains a bean referring to the above file)
I have to update the web-client-config-custom.xml and add
– my newly defined types to the list of the Content Wizards
– my newly defined aspects to the list of the Action Wizards
– then define all types here with their properties showing
– then define all aspects with their properties and associations showing
And this is enough to update the custom model
This is an excerpt from the workflow code I’m using:
That should be good, but no logging information.
https://forums.alfresco.com/en/viewtopic.php?f=10&t=21838 gave me the answer.
log4j.logger.org.alfresco.repo.jscript.ScriptLogger=debug <= set this one .
And also –
logger.log(“Ad Hoc Task”);
The link to my personal workflow console ; http://localhost:8080/alfresco/faces/jsp/admin/workflow-console.jsp
I`m testing all kinds of variations of workflows. (simple workflow, but mostly variations of the advanced workflow) Because trial and error clutters up my Alfresco environment, I want to clean up all the old (non-working) workflows.
If I understood correctly Alfresco does not delete the older workflows. If a workflow crashed (due to any number of reasons – aka wrong names, unreachable variables, wrongly defined names etc.) the workflow step is kept alive in the system. This is great for produktion systems, but for testing it’s not that convenient.
So i`ll delete them through the management console.
show definitions all – show me all workflows that still exist in the system
delete all workflows imeanit – my personal favorite, but a ruthless one..
undeploy definition name jbpm$incentroWorkflow – remove this workflow from the system.
undeploy definition jbpm$26 – remove workflow with this number
I’ve created the adhoc model from the wiki example; http://wiki.alfresco.com/wiki/WorkflowAdministration
I created 3 files and it’s working (hooray)
– the content of the files can be found at the above named wiki page
Now I want to place the functions in my own name space (incentro of course) and this seems to be an issue. It’s not working.. I haven’t figured out why yet. Just renaming the wf:prefix with an incentro:prefix did not work. There must be something I am missing….
Still working on workflows;
This is good example to make a workflow with a lifecycle.
I only run into some issues with user authentication. If I start a workflow (as admin) on a txt document and refer it to a user (myself) there are some authentication errors. It might have something to do with this code;
I have no solution yet.. So back to research..
I am following the http://wiki.alfresco.com/wiki/WorkflowAdministration step-by-step guide to creating a custom workflow.
The anwser to my question, regarding how to get / where to place a new custom-workflow-context.xml file got answered in this very usefull forum topic – https://forums.alfresco.com/en/viewtopic.php?f=30&t=35459
I am once again a little frustrated with the Alfresco system.
Why? The “hello world” workflow won’t work… The simplest.xml workflow didn’t work.
And “A system error happened during the operation: null” is not really a good error in my humble opinion.