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