String workarea = workflow.getParams().get("$IW_WORKAREA").toString(); CSVPath waPath = new CSVPath(workarea); client.getBranch(waPath, true);
String branch = workflow.getParams().get("$IW_BRANCH").toString();
2. once I get a client object how can I modify the workflow name? I didn't see any method or function of workflow object to modify the workflow name.
...any idea? how can I change workflow name?
I know setName() is available with CSWorkflow and you have WFMWorkflow
Hi Crsb,any idea? how can I change workflow name?
package XXXXXX.XXXX.XXXX;import com.interwoven.cssdk.common.CSClient;import com.interwoven.cssdk.common.CSException;import com.interwoven.cssdk.workflow.CSExternalTask;import com.interwoven.cssdk.workflow.CSWorkflow;import com.interwoven.cssdk.workflow.CSURLExternalTask;import java.util.Hashtable;import org.apache.log4j.Logger;/** * * @author cb */public class RenameJob implements CSURLExternalTask { private static Logger logger; public void execute(CSClient client, CSExternalTask task, Hashtable params) throws CSException { try { logger = Logger.getLogger(RenameJob.class); // logger.setLevel(LoggingUtil.setLogLevel("debug")); logger.debug(">>> RenameJob.execute()"); String branch = task.getArea().getVPath().getBranch().getBranchName(); branch = branch.replaceAll(".*\\/", ""); logger.debug("Branch: " + branch); CSWorkflow workflow = task.getWorkflow(); logger.debug("current workflow name: " + workflow.getName()); workflow.setName(branch + "_NewJobName"); logger.debug("new workflow name: " + workflow.getName()); } catch (Exception e) { logger.error("Exception RenameJob.execute() at :" + e); e.printStackTrace(); } finally { logger.debug("<<< RenameJob.execute()"); task.chooseTransition("", "Renamed JOb"); } }}