cancel
Showing results for 
Search instead for 
Did you mean: 

No valid SecureContext in bpmn script

georgera
Champ in-the-making
Champ in-the-making

I have a workflow which has an embedded script that does some messing around with permissions, which runs when the workflow finishes. I have the runas property set to "admin" for the task and for the most part this works. IF the overall action is triggered by a user action(completed by the assignee or canceled by the initiator ). But when it's triggered by a boundaryEvent timer I get the following error. 

2017-02-28 10:44:04,645 ERROR [impl.jobexecutor.ExecuteJobsRunnable] [pool-17-thread-1] exception during job execution: 012814135 Found 1 integrity violations:
A valid SecureContext was not provided in the RequestContext

Note it's the exact same piece of code running each time.

Here's the relevant snippet. I've also attached the entire file.

<extensionElements>
    <activiti:executionListener event="end" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
    <activiti:field name="runAs">
    <activiti:string><![CDATA[admin]]></activiti:string>
    </activiti:field>
    <activiti:field name="script">
    <activiti:string><![CDATA[
    logger.error("process extensionElements end : " + person.properties.userName);
    if( execution.getVariable('processextensionElementsend') != true )
    {
    var groupName = execution.getVariable('GroupName');
    for (var i in bpm_package.children)
    {
    bpm_package.children[i].removePermission("SiteConsumer", "GROUP_" + groupName );
    }
    groups.getGroup(groupName).deleteGroup();
    }
    execution.setVariable('processextensionElementsend',true);
    ]]></activiti:string>
    </activiti:field>
    </activiti:executionListener>
</extensionElements>

3 REPLIES 3

gdharley
Elite Collaborator
Elite Collaborator

I am not sure if the runAs property is actually supported in the stand alone Activiti product.

I can find no reference to runAs in the source outside the simple editor listener, however nothing appears to read the value.

Perhaps I am wrong, would love to hear others comments.

Greg

georgera
Champ in-the-making
Champ in-the-making

This isn't the standalone, though.

gdharley
Elite Collaborator
Elite Collaborator

OK, I will move the thread to the Alfresco One frum then,
This forum is for stand-alone Activiti.

Thanks,
Greg