AnsweredAssumed Answered

Pass Custom ftl file content values in user task sequence

Question asked by noohulalthaf on Jan 9, 2018

I'm using userdetails.ftl control in workflow, when workflow gets started, the values will be entered and the list of values gets added into table , and the task  should be assigned to next assignee with the ftl control loaded with the values entered by previous assignee, but here the ftl control gets loaded in next assignee task but not the values. so i am thinking to achieve that by using jquery ajax call to put the values in new file and get those values to assign the variables in next task, but when i try to create a file by  setting the properties values , i getting the error as a response

 

Request:

 

$.ajax({

  url: 'http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/mytxt.txt/content',

  type: 'PUT',

  data: your js variables,

  success: function(data) {

    alert('done');

  }

});

 

Response:

"error": {
"errorKey": "Unable to locate resource resource for :nodes children",
"statusCode": 400,
"briefSummary": "00090007 Unable to locate resource resource for :nodes children",
"stackTrace": "[org.alfresco.rest.framework.core.ResourceLookupDictionary.locateRelationResource(ResourceLookupDictionary.java:64), org.alfresco.rest.framework.core.ResourceLookupDictionary.locateResource(ResourceLookupDictionary.java:89), org.alfresco.rest.framework.webscripts.AbstractResourceWebScript.execute(AbstractResourceWebScript.java:63), org.alfresco.rest.framework.webscripts.ApiWebScript.execute(ApiWebScript.java:127), org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:460), org.alfresco.rest.api.PublicApiRepositoryContainer.transactionedExecute(PublicApiRepositoryContainer.java:45), org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:649), org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:421), org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:301), org.alfresco.rest.api.PublicApiRepositoryContainer.access$001(PublicApiRepositoryContainer.java:26), org.alfresco.rest.api.PublicApiRepositoryContainer$1.doWork(PublicApiRepositoryContainer.java:81), org.alfresco.repo.tenant.TenantUtil.runAsWork(TenantUtil.java:119), org.alfresco.repo.tenant.TenantUtil.runAsTenant(TenantUtil.java:88), org.alfresco.rest.api.PublicApiRepositoryContainer.executeScript(PublicApiRepositoryContainer.java:77), org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378), org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209), org.alfresco.repo.web.scripts.TenantWebScriptServlet.service(TenantWebScriptServlet.java:74), org.alfresco.rest.api.PublicApiWebScriptServlet.service(PublicApiWebScriptServlet.java:53), javax.servlet.http.HttpServlet.service(HttpServlet.java:728), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210), org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210), org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:68), sun.reflect.GeneratedMethodAccessor1241.invoke(Unknown Source), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43), java.lang.reflect.Method.invoke(Method.java:498), org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:125), org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172), org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204), com.sun.proxy.$Proxy303.doFilter(Unknown Source), org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210), org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210), org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222), org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123), org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502), org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171), org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100), org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953), org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118), org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408), org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041), org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603), org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624), java.lang.Thread.run(Thread.java:748)]",
"descriptionURL": "http://developer.alfresco.com/ErrorsExplained.html#Unable to locate resource resource for :nodes children"
}

 

I come to know that nodes children in url works with alfresco 5.2 and i am using alfresco 5.1 sdk, so please suggest me any turnaround solution on this? or Is there any alternate solution to pass ftl field values in usertask sequence?

Outcomes