This is one workflow in which I want to assign the task to the group depending on the condition, So in the initial check I am getting that condition true or false based on that I have also assigned group names to one variable "wf142_grouprevisor" but now I want to pass that variable name in the activiti:candidateGroups="${wf142_grouprevisor.properties.Name}" . I have tried the below code but it is not working means it is not taking the group name from the variable.. Can anyone help me in this issue.
Thanks in Advance..
<serviceTask id="workflow142InitialCheck" name="Payroll Check"
activiti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate">
<extensionElements>
<activiti:field name="runAs">
<activiti:string>
<![CDATA[admin]]>
</activiti:string>
</activiti:field>
<activiti:field name="script">
<activiti:string>
logger.error("Payroll Task starts");
var destinationFolder = companyhome.childByNamePath("Staging");
var docs = bpm_package.children;
var docType = docs[0].properties["hr:documentType"];
var keyNo = docs[0].properties["hr:keyNumber"];
var process = "";
var docTypeStr = "";
var checkSecured = "";
var nodes = search.luceneSearch("@\\{http\\
/www.bpost.be/model/hr/1.0\\}DocumentTypesDataList @hr\\:dldocType:"+docType+"\*");
logger.error("--------Length of nodes is-------------"+nodes.length);
if(nodes.length > 0){
logger.error("------------Node is-------------"+nodes[0].id);
var dataLists = search.findNode("workspace://SpacesStore/"+nodes[0].id);
var dataListItemProps = dataLists.getProperties(); //Read all the properties of the current datalistitem
docTypeStr = dataListItemProps["hr:dldocType"]
logger.log("-----docTypeStr-------"+docTypeStr);
process = dataListItemProps["hr:dlprocess"];
logger.log("+++++Process+++++"+process);
checkSecured = dataListItemProps["hr:dlsecured"];
logger.error("-------CHECK SECURED---------"+checkSecured);
}
if(checkSecured == true){
execution.setVariable('wf142_grouprevisor',"GROUP_GU_CMS_HR_PAYROLLSECWF_TEAM");
logger.error("--------wf142_grouprevisor---------------"+wf142_grouprevisor);
}else{
execution.setVariable('wf142_grouprevisor',"GROUP_GU_CMS_HR_NONSECWF_TEAM");
logger.error("--------wf142_grouprevisor---------------"+wf142_grouprevisor);
}
if(!docType || !keyNo){
execution.setVariable('wf142_initialFlag',true);
docs[0].move(destinationFolder);
logger.log("Here it is....")
}else{
execution.setVariable('wf142_initialFlag',false);
}
logger.error("Payroll Task ends");
</activiti:string>
</activiti:field>
</extensionElements>
</serviceTask>
<exclusiveGateway id="exclusiveGateway" name="Exclusive Gateway" />
<sequenceFlow id="flow11" targetRef="workflow142Review"
sourceRef="exclusiveGateway">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${wf142_initialFlag == false}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow12" targetRef="endevent" sourceRef="exclusiveGateway">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${wf142_initialFlag == true}]]></conditionExpression>
</sequenceFlow>
<userTask id="workflow142Review" name="Payroll"
activiti:candidateGroups="${wf142_grouprevisor.properties.Name}" activiti:formKey="wf142:workflow142Review">
<extensionElements>
<activiti:taskListener event="create"
class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
<![CDATA[