AnsweredAssumed Answered

Issue with the Workflow Submission Programitcally

Question asked by opensrcguy on May 4, 2011
Latest reply on Jul 5, 2011 by romschn
Hi All,

   I am trying to submit content to the workflow programtically using sandbox service : submitListAssets method. It shows the method is deprecated. But still when I use that method for content submission, workflow task is getting created . But in the task item, submitted content is not found under Resources.

void submitListAssets(java.lang.String sbStoreId,
                                   java.util.List relativePaths,
                                   java.lang.String workflowName,
                                   java.util.Map workflowParams,
                                   java.lang.String submitLabel,
                                   java.lang.String submitDescription,
                                   java.util.Map expirationDates,
                                   java.util.Date launchDate,
                                   boolean autoDeploy)
The reason for using this method is, I have to submit to custom created workflow. Except this method, no other method accepts workflowName as parameter.

Other issue is , when I submit the content using this method, the content file is not getting locked.

Can anyone suggest me in resolving this issue?

Attached is the code for workflow submission :

Map<QName, Serializable> workflowParams = new HashMap<QName, Serializable>(16);
Map<String,Date> expDateMap = new HashMap<String,Date>();
expDateMap.put(WCMAppModel.PROP_EXPIRATIONDATE.getLocalName(), expiryDate);
   
NodeRef workflowPackage = this.services.getWorkflowService().createPackage(AVMNodeConverter.ToNodeRef(-1, parentFolderAvmPath+"/"+fileName));
workflowParams.put(WorkflowModel.ASSOC_PACKAGE, workflowPackage);
          
            workflowParams.put(WorkflowModel.PROP_WORKFLOW_DESCRIPTION, wfComment);
            workflowParams.put(WCMWorkflowModel.PROP_LABEL, wfLabel);
            workflowParams.put(WCMWorkflowModel.PROP_FROM_PATH,WCMUtil.buildStoreRootPath(KOMPSOFT));
            workflowParams.put(WCMWorkflowModel.PROP_LAUNCH_DATE, launchDate);
            workflowParams.put(WCMWorkflowModel.PROP_AUTO_DEPLOY,
                    new Boolean(false));
            workflowParams.put(WCMWorkflowModel.PROP_WEBAPP,webProjInfo.getDefaultWebApp());
            workflowParams.put(WCMWorkflowModel.ASSOC_WEBPROJECT,webProjService.getWebProjectNodeFromStore(webProjInfo.getStoreId()));
           
            workflowParams.put(WorkflowModel.PROP_WORKFLOW_DUE_DATE, launchDate);
           
            workflowParams.put(QName.createQName(NamespaceService.BPM_MODEL_1_0_URI, "groupAssignees"),findGroup("GROUP_Marketing") );
           
           
            List<String> relativePaths = new ArrayList<String>();
            relativePaths.add(AVMUtil.splitPath(parentFolderAvmPath)[1]+"/"+fileName);
   
this.services.getSandboxService().submitListAssets(userStoreID,relativePaths , "jbpm$groupwf:groupsubmit",workflowParams,  wfLabel, wfComment, expDateMap, launchDate, false,false);

Outcomes