Page 1 of 2

Create Metadata in Workflow - Exercise 8

PostPosted:Thu Apr 16, 2015 1:16 am
by alexwgordon
Hi all!

So I'm new to the more advanced features of OpenKM and I'm trying to learn about workflows. I'm confused as to how to complete Exercise 8 http://wiki.openkm.com/index.php/Workfl ... Exercise_8

It's not immediately clear how to perform this step
In node metadata_created change document metadata status to created.
It was not demonstrated anywhere how to perform this action. Any help or ideas on how to accomplish this would be greatly appreciated! Thanks in advance!

Re: Create Metadata in Workflow - Exercise 8

PostPosted:Sat Apr 18, 2015 11:11 am
by jllort
Did you downloaded the OpenKM portable dev environment http://sourceforge.net/projects/openkmportabledev/ because there we got all samples configured and will be more easy explain.

Basically into the trasaction you should do API call
OKMPropertyGroup.getInstance().setPropertiesSimple (String token, String nodeId, String grpName, Map< String, String > properties)

Take a look here http://doxygen.openkm.com/openkm/d0/d35 ... group.html

Re: Create Metadata in Workflow - Exercise 8

PostPosted:Wed Aug 19, 2015 5:50 pm
by alexwgordon
Hi Guys!

I still haven't quite gasped what I should be doing to get the metadata creation to work. I got the portable version running, but it doesn't seem to have that metadata creation portion of the workflow completed.

Does the API call go into the Action of the Node for the metadata_created? Thanks in advance everyone!

Re: Create Metadata in Workflow - Exercise 8

PostPosted:Thu Aug 20, 2015 4:34 pm
by jllort
Metadata has three steps:
1- first register the metadata definition ( Administration / Property group )
2- ensure the node ( document ) has the group, otherwise the group must be added before setting the values
3- set the metadata

You should take a look at doxygen documentation http://doxygen.openkm.com/openkm_6.3.0/ and take control on methods in the api classes http://doxygen.openkm.com/openkm_6.3.0/ ... _1api.html in your case the OKMPropertyGroup class http://doxygen.openkm.com/openkm_6.3.0/ ... group.html

Specially the methods:
addGroup (String token, String nodePath, String grpName)
setPropertiesSimple (String token, String nodeId, String grpName, Map< String, String > properties)

for examples
Code: Select all
String systemToken = DbSessionManager.getInstance().getSystemToken();
if (!hasGroup(systemToken, "/okm:root/test.txt","okg:test")) {
   OKMPropertyGroup.getInstance().addGroup(systemToken, "/okm:root/test.txt","okg:test");
}
Map properties = new HashMap<>();
properties.put("okp.test.name","some value");
OKMPropertyGroup.getInstance().setPropertiesSimple (systemToken, "/okm:root/test.txt","okg:test",properties); 
In nodeId variable you can use the document UUID or the path. In the previous example I've used the path to provide more clear sample, but in workflow action probably will be easiest use UUID directly.

Re: Create Metadata in Workflow - Exercise 8

PostPosted:Thu Aug 20, 2015 11:11 pm
by alexwgordon
Hi jllort,

okay this is definitely starting to make more sense!

When I'm writing the addMetadata.java for this under the portable edition, it says that all my imports can't be resolved. I opened up ActorAssignment.java from exercise 7 and that one also has similar errors. How is it that I can set the portable version to show me whether my code is actually error proof?
Code: Select all
package com.openkm.workflow.exercise8;

import com.openkm.module.db.stuff.DbSessionManager;
import com.openkm.api.OKMPropertyGroup;

public class addMetadata {
	
	private static final long serialVersionUID = 1L;
	
	String uuid = request.getParameter("uuid");
	
	String systemToken = DbSessionManager.getInstance().getSystemToken();
	
	if (!hasGroup(systemToken, uuid ,"okg:Doc_Status")) {
	   OKMPropertyGroup.getInstance().addGroup(systemToken, uuid, "okg:Doc_Status");
	}
	
	Map properties = new HashMap<>();
	properties.put("okp.Doc_Status.State","Submitted");
	OKMPropertyGroup.getInstance().setPropertiesSimple (systemToken, uuid,"okg:Doc_Status",properties);
}

Re: Create Metadata in Workflow - Exercise 8

PostPosted:Fri Aug 21, 2015 3:06 pm
by jllort
You must add openkm project ( checkout ) to yours, otherwise you'll new project will not have access to that classes for compiling.

- Select project ( from navigator or project view )
- Mouse right click -> Properties -> Java build path -> tab project -> add button -> choose the openkm checkout project.

Re: Create Metadata in Workflow - Exercise 8

PostPosted:Fri Aug 21, 2015 4:45 pm
by alexwgordon
This cleared up any of the com.openkm.* imports!
How to clear the org.* ??

Thank you again for all your help! :D

Re: Create Metadata in Workflow - Exercise 8

PostPosted:Sat Aug 22, 2015 11:01 am
by jllort
which are your org.* missing packages ?

Re: Create Metadata in Workflow - Exercise 8

PostPosted:Mon Aug 24, 2015 4:16 pm
by alexwgordon
Code: Select all
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.taskmgmt.def.AssignmentHandler;
import org.jbpm.taskmgmt.exe.Assignable;
these are the ones that seem to be missing from the ActorAssigment.java from exercise 7.

Re: Create Metadata in Workflow - Exercise 8

PostPosted:Thu Aug 27, 2015 4:45 pm
by jllort
jBPM in upper case is quite strange for a package, can you try with lowecase ?

Re: Create Metadata in Workflow - Exercise 8

PostPosted:Thu Aug 27, 2015 7:52 pm
by alexwgordon
Lowercase makes no difference
Screen Shot 2015-08-27 at 12.51.35.png
Screen Shot 2015-08-27 at 12.51.35.png (39.66 KiB) Viewed 9198 times

Re: Create Metadata in Workflow - Exercise 8

PostPosted:Sat Aug 29, 2015 7:17 am
by jllort
I suppose you're using OpenKM portable dev environment https://sourceforge.net/projects/openkmportabledev/ ?

Probably when you created the project you have not created a jBPM project :
File -> Other -> JBPM 3 Project ( becase it adds the JBPM libraries automatically ).

Also can try opening your .classpath file ( at the root of the project ) and add:
Code: Select all
<classpathentry kind="con" path="JBPM/JBPM 3.3.1"/>
<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/activation.jar"/>
<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/antlr.jar"/>
<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/asm.jar"/>
<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/bsh.jar"/>
<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/commons-collections.jar"/>
<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/commons-logging.jar"/>
<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/dom4j.jar"/>
<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/hibernate.jar"/>
<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/hsqldb.jar"/>
<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/jbpm-identity.jar"/>
<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/jbpm-jpdl.jar"/>
<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/junit.jar"/>
<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/log4j.jar"/>
A complete jBPM project for me looks like this:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src/main/java"/>
	<classpathentry kind="src" path="src/main/jpdl"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
	<classpathentry kind="con" path="JBPM/JBPM 3.3.1"/>
	<classpathentry combineaccessrules="false" kind="src" path="/openkm-6.3-community"/>
	<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/tomcat"/>
	<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/activation.jar"/>
	<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/antlr.jar"/>
	<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/asm.jar"/>
	<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/bsh.jar"/>
	<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/commons-collections.jar"/>
	<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/commons-logging.jar"/>
	<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/dom4j.jar"/>
	<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/hibernate.jar"/>
	<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/hsqldb.jar"/>
	<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/jbpm-identity.jar"/>
	<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/jbpm-jpdl.jar"/>
	<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/junit.jar"/>
	<classpathentry kind="lib" path="C:/openkm-dev/tools/jbpm-3.3.1.GA/lib/log4j.jar"/>
	<classpathentry kind="output" path="bin"/>
</classpath>
If you do the change from eclipse ( after be done ) close the project, restart eclipse, open the project and refresh it.

Re: Create Metadata in Workflow - Exercise 8

PostPosted:Tue Sep 01, 2015 5:35 pm
by alexwgordon
Yes, I'm using the portable dev.

The screenshot I posted before was from the default workflows that came with the portable dev and I hadn't changed anything about it. After creating a new jBPM 3 definition of my own, everything seemed to be okay. I checked the .classpath of the "workflow-course
Code: Select all
" and it was missing all of the lines you listed below. So that resolved that. 

I'm having a new issue with the trying to get the Decision Node example working from here (even when using the sample download files [url]http://wiki.openkm.com/index.php/Use_of_decision_node[/url]

[code]OKM-015026(callbackRunProcessDefinition): OKM-01026

null
with this readout
Code: Select all
2015-09-01 10:40:50,600 [http-bio-127.0.0.1-8080-exec-8] WARN  com.openkm.module.common.CommonWorkflowModule- Process definition '91' has no forms.xml file
2015-09-01 10:40:50,657 [http-bio-127.0.0.1-8080-exec-8] ERROR org.jbpm.instantiation.FieldInstantiator- couldn't instantiate type 'com.openkm.sample.MyDecision' with the default constructor
2015-09-01 10:40:50,657 [http-bio-127.0.0.1-8080-exec-8] ERROR org.jbpm.instantiation.Delegation- couldn't instantiate delegation class 'com.openkm.sample.MyDecision'
org.jbpm.JbpmException: java.lang.InstantiationException: com.openkm.sample.MyDecision
	at org.jbpm.instantiation.FieldInstantiator.newInstance(FieldInstantiator.java:110)
	at org.jbpm.instantiation.FieldInstantiator.instantiate(FieldInstantiator.java:52)
	at org.jbpm.instantiation.Delegation.instantiate(Delegation.java:168)
	at org.jbpm.instantiation.Delegation.getInstance(Delegation.java:126)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
	at org.jbpm.instantiation.Delegation_$$_javassist_7.getInstance(Delegation_$$_javassist_7.java)
	at org.jbpm.graph.node.Decision.execute(Decision.java:100)
	at org.jbpm.graph.def.Node.enter(Node.java:390)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
	at org.jbpm.graph.def.Node_$$_javassist_119.enter(Node_$$_javassist_119.java)
	at org.jbpm.graph.def.Transition.take(Transition.java:167)
	at org.jbpm.graph.def.Node.leave(Node.java:479)
	at org.jbpm.graph.node.StartState.leave(StartState.java:82)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
	at org.jbpm.graph.def.Node_$$_javassist_119.leave(Node_$$_javassist_119.java)
	at org.jbpm.graph.exe.Token.signal(Token.java:223)
	at org.jbpm.graph.exe.Token.signal(Token.java:150)
	at com.openkm.module.common.CommonWorkflowModule.runProcessDefinition(CommonWorkflowModule.java:281)
	at com.openkm.module.db.DbWorkflowModule.runProcessDefinition(DbWorkflowModule.java:208)
	at com.openkm.api.OKMWorkflow.runProcessDefinition(OKMWorkflow.java:113)
	at com.openkm.servlet.frontend.WorkflowServlet.runProcessDefinition(WorkflowServlet.java:106)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
	at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.InstantiationException: com.openkm.sample.MyDecision
	at java.lang.Class.newInstance(Class.java:364)
	at org.jbpm.instantiation.FieldInstantiator.newInstance(FieldInstantiator.java:107)
	... 84 more
2015-09-01 10:40:50,658 [http-bio-127.0.0.1-8080-exec-8] ERROR org.jbpm.instantiation.FieldInstantiator- couldn't instantiate type 'com.openkm.sample.MyDecision' with the default constructor
2015-09-01 10:40:50,658 [http-bio-127.0.0.1-8080-exec-8] ERROR org.jbpm.instantiation.Delegation- couldn't instantiate delegation class 'com.openkm.sample.MyDecision'
org.jbpm.JbpmException: java.lang.InstantiationException: com.openkm.sample.MyDecision
	at org.jbpm.instantiation.FieldInstantiator.newInstance(FieldInstantiator.java:110)
	at org.jbpm.instantiation.FieldInstantiator.instantiate(FieldInstantiator.java:52)
	at org.jbpm.instantiation.Delegation.instantiate(Delegation.java:168)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
	at org.jbpm.instantiation.Delegation_$$_javassist_7.instantiate(Delegation_$$_javassist_7.java)
	at org.jbpm.graph.node.Decision.execute(Decision.java:102)
	at org.jbpm.graph.def.Node.enter(Node.java:390)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
	at org.jbpm.graph.def.Node_$$_javassist_119.enter(Node_$$_javassist_119.java)
	at org.jbpm.graph.def.Transition.take(Transition.java:167)
	at org.jbpm.graph.def.Node.leave(Node.java:479)
	at org.jbpm.graph.node.StartState.leave(StartState.java:82)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
	at org.jbpm.graph.def.Node_$$_javassist_119.leave(Node_$$_javassist_119.java)
	at org.jbpm.graph.exe.Token.signal(Token.java:223)
	at org.jbpm.graph.exe.Token.signal(Token.java:150)
	at com.openkm.module.common.CommonWorkflowModule.runProcessDefinition(CommonWorkflowModule.java:281)
	at com.openkm.module.db.DbWorkflowModule.runProcessDefinition(DbWorkflowModule.java:208)
	at com.openkm.api.OKMWorkflow.runProcessDefinition(OKMWorkflow.java:113)
	at com.openkm.servlet.frontend.WorkflowServlet.runProcessDefinition(WorkflowServlet.java:106)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
	at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.InstantiationException: com.openkm.sample.MyDecision
	at java.lang.Class.newInstance(Class.java:364)
	at org.jbpm.instantiation.FieldInstantiator.newInstance(FieldInstantiator.java:107)
	... 83 more
2015-09-01 10:40:50,673 [http-bio-127.0.0.1-8080-exec-8] ERROR com.openkm.servlet.frontend.WorkflowServlet- 
com.openkm.core.WorkflowException
	at com.openkm.module.common.CommonWorkflowModule.runProcessDefinition(CommonWorkflowModule.java:288)
	at com.openkm.module.db.DbWorkflowModule.runProcessDefinition(DbWorkflowModule.java:208)
	at com.openkm.api.OKMWorkflow.runProcessDefinition(OKMWorkflow.java:113)
	at com.openkm.servlet.frontend.WorkflowServlet.runProcessDefinition(WorkflowServlet.java:106)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
	at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.jbpm.graph.def.DelegationException
	at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:388)
	at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:379)
	at org.jbpm.graph.node.Decision.execute(Decision.java:185)
	at org.jbpm.graph.def.Node.enter(Node.java:390)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
	at org.jbpm.graph.def.Node_$$_javassist_119.enter(Node_$$_javassist_119.java)
	at org.jbpm.graph.def.Transition.take(Transition.java:167)
	at org.jbpm.graph.def.Node.leave(Node.java:479)
	at org.jbpm.graph.node.StartState.leave(StartState.java:82)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
	at org.jbpm.graph.def.Node_$$_javassist_119.leave(Node_$$_javassist_119.java)
	at org.jbpm.graph.exe.Token.signal(Token.java:223)
	at org.jbpm.graph.exe.Token.signal(Token.java:150)
	at com.openkm.module.common.CommonWorkflowModule.runProcessDefinition(CommonWorkflowModule.java:281)
	... 55 more
Caused by: java.lang.NullPointerException
	at org.jbpm.graph.node.Decision.execute(Decision.java:104)
	... 74 more
Any ideas? Thanks!

Re: Create Metadata in Workflow - Exercise 8

PostPosted:Wed Sep 02, 2015 6:33 pm
by jllort
Yes you forget to add the class in the par file. In the *.jbpm.xml file view -> you have an option at top right to add classes in the project. I think you missed this step.

Re: Create Metadata in Workflow - Exercise 8

PostPosted:Fri Jun 16, 2017 2:28 pm
by dferguson
jllort wrote: Sat Apr 18, 2015 11:11 am

Basically into the trasaction you should do API call
OKMPropertyGroup.getInstance().setPropertiesSimple (String token, String nodeId, String grpName, Map< String, String > properties)

Take a look here http://doxygen.openkm.com/openkm/d0/d35 ... group.html
This is a broken link. New link?