cancel
Showing results for 
Search instead for 
Did you mean: 

Auto Activity inWorkflow

srinivasan
Champ in-the-making
Champ in-the-making
Hi Developers,

I need to create a workflow which triggers workflow when the document arrives and moved to specific space without user interaction, is it possible 1.3 version?


Or can i except this feature in 1.4? If so when i can get the 1.4(release) version ?


Thanks
2 REPLIES 2

anweber
Champ in-the-making
Champ in-the-making
Hi,

   Of course, it's possible with the version 1.3 to create a workflow wich triggers when the document arrives and move this document to a specific space without user interaction.  If the destination folder is always the same, you should simply use a rule that says "on INBOUND event, move the document there".  If the destination has to be calculated (for example, in function of some properties of the current document), you should write a script (in JavaScript) to manage this case, then you define a rule thats says "On INBOUND event, execute my script"; your script will have the task to calculate the target folder and to move the current document in this folder.  In both cases, it's really very easy to implement.

             Andre

srinivasan
Champ in-the-making
Champ in-the-making
Hi Andre,

Thanks for your valuable reply.

Actually i need to achieve this thru java code, Now i can able to create a workflow with manaual activity using my java code.

Here my code for creating workflow with manaul activity.

public void setWorkflowAction(ServiceRegistry serviceRegistry,NodeRef approveNode,NodeRef rejectNode,String prefixName)
   {
          RuleService ruleService = serviceRegistry.getRuleService();
           RuleType ruleType = ruleService.getRuleType(RuleType.INBOUND);
           Rule rule = ruleService.createRule(ruleType.getName());
           rule.setTitle("Review For Approval");
           rule.setDescription("Review For Approval");
           rule.applyToChildren(false);
          
           ActionService actionService = serviceRegistry.getActionService();
           //add the compare property value condition to the rule
           Map<String,Serializable> repoCondParams = new HashMap<String,Serializable>();
           repoCondParams.put(ComparePropertyValueEvaluator.PARAM_VALUE, prefixName);
          
           ActionCondition condition = actionService.createActionCondition("compare-property-value");
           condition.setParameterValues(repoCondParams);
           condition.setInvertCondition(false);
           rule.addActionCondition(condition);
          //end condition rule
          
           String ApproveNode= (String)serviceRegistry.getNodeService().getProperty(approveNode, ContentModel.PROP_NAME);
           String RejectNode= (String)serviceRegistry.getNodeService().getProperty(rejectNode, ContentModel.PROP_NAME);
          
           //start action rule
           //add properties for approve
           Map<String,Serializable> repoActionParams = new HashMap<String,Serializable>();
           repoActionParams.put(SimpleWorkflowActionExecuter.PARAM_APPROVE_STEP,"File Approve");
           repoActionParams.put(SimpleWorkflowActionExecuter.PARAM_APPROVE_MOVE,Boolean.valueOf(true));                   
           repoActionParams.put(SimpleWorkflowActionExecuter.PARAM_APPROVE_FOLDER,approveNode);   
          
           //add properties for reject
          
           repoActionParams.put(SimpleWorkflowActionExecuter.PARAM_REJECT_STEP, "File Reject");
           repoActionParams.put(SimpleWorkflowActionExecuter.PARAM_REJECT_MOVE, Boolean.valueOf(true));
           repoActionParams.put(SimpleWorkflowActionExecuter.PARAM_REJECT_FOLDER,rejectNode);
          
           Action action = actionService.createAction("simple-workflow");
           action.setParameterValues(repoActionParams);
           rule.addAction(action);
          
           //here reject node and current node are same.
           ruleService.saveRule(rejectNode,rule);
   }


is it possible to set the auto activty using java code?

if it is possible please provide the sample java code for auto activity..

Thanks

Srini
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.