Page 1 of 1

Lock/Unlock a file during workflow

PostPosted:Wed Sep 18, 2013 10:29 am
by MikeW
Hello guys
I'm pretty new to openKM and looked the whole day trough the developer manuals regarding the workflows.
I'd like to lock a file with a workflow and unlock it when the workflow is done (and by the way trying to lock any other workflow on this file as long as the workflow is ongoing).

I've tried it with a node and the <action> and with the <script> function, but without success.
Would anyone of you help me out?
Code: Select all
<node name="node1">
		<action class="com.openkm.workflow.DocumentLockActionHandler"></action>
		<transition to="task-node1"></transition>
	</node>
Code: Select all
<node name="node1">
		<event type="node-enter">
			<script>com.openkm.workflow.DocumentLockActionHandler();</script>
		</event>
		<transition to="task-node1"></transition>
	</node>
Both doesn't work - I'm sure I made a stupid mistake...

Any help would be appreciated, thanks in advance.
Mike

PS: I'm using the most recent community edition.

Re: Lock/Unlock a file during workflow

PostPosted:Thu Sep 19, 2013 11:22 am
by jllort
with document uuid you can get docPath ( methods getNodePath or getNodeUuid ) from OKMRepository
http://doxygen.openkm.com/dd/d2c/classc ... itory.html
Code: Select all
OKMRepository.getInstance().
to lock or unlock ( methods lock unlock ) from OKMDocument
http://doxygen.openkm.com/de/de7/classc ... ument.html
Code: Select all
OKMDocument.getInstance().