AnsweredAssumed Answered

Create rule for a simple workflow

Question asked by samar on Sep 20, 2007
Latest reply on Mar 12, 2008 by andresaimar
Hi

I want to use Alfresco Action Web Service to create a simple workflow.
The steps I perform in GUI on the Alfresco Client portlet are:
    - Go to  My Alfresco > My folder(space)
    - Choose More Actions > Manage Content Rules
    - Choose Create Rule
   1- Select Conditions:
    Select Condition->'All Items'
          Click 'Add to List'
   2- Select Actions:
      
    Select Action->'Add simple workfolw to item'
          Click 'Set Values and Add'
             Set action values:
             - Approve Flow
             Name for approve step: 'request Approval'
             Select 'Move' radio button
             Select the destination folder
             -Reject Flow
             Choose 'No' reject flow
   3- Details
    Type: 'Update'
          Tilte: 'test'
          Description: ''
          choose 'Apply rule to sub spaces' only
I need to write Java code to perform the steps above,
my code is something like:
      Rule rule1 = new Rule();
      Action action1 = new Action();
      Condition condition1 = new Condition();
      
      Reference actionReference1; // = ref to My folder
      NamedValue[] parameters1; // = "All Items"
      
      condition1.setParameters(parameters1);
      action1.setConditions(0, condition1);

      action1.setActionName("request Approval");
      //action1.set choose 'Move item'?
      action1.setActionReference(actionReference1);
      rule1.setRuleTypes(0,"update");
      rule1.setAction(action1);
      //apply rule to subspaces

I cannot find
    how to set the condition to "All items"?
      how to make the Action to move the item from My folder to destination folder?
      are rule types defined constants somewhere?
      how to apply rule to subspaces?
Thank you,

Outcomes