Issue with input button to call Soap Method
Hello Dear Campaigners,
i have extended schema and updated the database.
<srcSchema _cs="Workflows (cus)" created="2023-06-12 14:12:10.909Z" createdBy-id="0"
desc="Workflows definitions" entitySchema="xtk:srcSchema" extendedSchema="xtk:workflow"
img="xtk:workflow.png" label="Workflows" labelSingular="Workflow" lastModified="2023-06-12 15:28:33.969Z"
mappingType="sql" md5="45F3C2BF3E8134B802BA695FFCEAA60A" modifiedBy-id="0"
name="workflow" namespace="cus" xtkschema="xtk:srcSchema">
<element desc="Workflows definitions" img="xtk:workflow.png" label="Workflows"
labelSingular="Workflow" name="workflow">
<attribute label="Locked by" name="lockedBy" type="long"/>
</element>
<methods>
<method library="cus:workflow.js" name="ToggleLockOnWorkflow" static="true">
<parameters>
<param desc="Workflow id" inout="in" name="id" type="long"/>
<param desc="Status" inout="out" name="status" type="boolean"/>
</parameters>
</method>
</methods>
</srcSchema>
I have created JS library
//cus:workflow.js
function cus_workflow_ToggleLockOnWorkflow(id){
var operator = application.operator,
wkf = NLWS.xtkWorkflow.load(id)
if (wkf.lockedBy > 0)
wkf.lockedBy = 0;//unlock the workflow
else
wkf.lockedBy = operator.id;//lock the workflow
wkf.save();
return true;
}
I have added button to the form
<!--
Under diagramme
in xtk:workflow form view
-->
<!-- wlock -->
<container colspan="2" type="visibleGroup" visibleIf="@lockedBy=='0'">
<input img="nms:lock.png" label="Lock workflow" type="button">
<enter>
<!-- SOAP call to get the generated source -->
<soapCall name="ToggleLockOnWorkflow" service="cus:workflow">
<param exprIn="@id" name="id" type="number"/>
<param type="boolean" xpathOut="/tmp/@nothingHere"/>
</soapCall>
<reload/>
</enter>
</input>
</container>
<container colspan="2" type="visibleGroup" visibleIf="@lockedBy!='0'">
<input img="nms:unlock.png" label="Unlock workflow" type="button">
<enter>
<!-- SOAP call to get the generated source -->
<soapCall name="ToggleLockOnWorkflow" service="cus:workflow">
<param exprIn="@id" name="id" type="number"/>
</soapCall>
<reload/>
</enter>
</input>
</container>
<container colspan="2" padding-top="5" type="hpaned">
<static/>
</container>
Once i click on the button in the workflow i get weird error without any description that can help


On the server logs
2023-06-12 15:35:30.688Z 00078449 00078495 2 error log XSV-350000 Unable to load document of identifier 'cus:workflow' and type 'xtk:schema'. (iRc=-2003)
Maybe my settings missing somoething but have run this on already set isntance and throws same error
Thanks a lot 🙂
