How to start an Alfresco Workflow through Javascript adding a resource

后端 未结 1 1643
野性不改
野性不改 2020-12-19 19:32

Starting using a rule and a simple javascript in Alfresco is quite easy but i\'m stuck on trying to start a workflow through javascript adding a resource.

My goal is

相关标签:
1条回答
  • 2020-12-19 20:13

    The bpm:package or bpm_package is not available before start. So what happens you're document is added to bpm_package.

    And in your workflow you can access bpm_package as a variable. And with bpm_package.addNode(doc); you can add nodes.

    These nodes can be found through search/childbynamepath/xpath etc.

    If you don't use the action the other way is:

    var workflowAction = workflow.getDefinitionByName('activiti$AdHocactivitiTimer');
    var package= workflow.createPackage();
    package.addNode(document);
    workflowAction.startWorkflow(package, parameters);
    
    0 讨论(0)
提交回复
热议问题